I've added a QToolBar to QWidget and added a QToolButton to the QToolBar, but the image isn't showing up. If I use QPushButton, it's showing up any reason?
{
oMainLayout->setMargin(0);
oMainLayout->addWidget(oToolbar, 0, Qt::AlignTop);
oToolbar->addWidget(oClose);
connect(oClose, SIGNAL(clicked()), this, SLOT(onCloseBtnClick()));
oClose->show();
this->setLayout(oMainLayout);
}
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
oMainLayout = new QVBoxLayout();
oMainLayout->setMargin(0);
oToolbar = new QToolBar();
oMainLayout->addWidget(oToolbar, 0, Qt::AlignTop);
oClose = new QPushButton();
oToolbar->addWidget(oClose);
connect(oClose, SIGNAL(clicked()), this, SLOT(onCloseBtnClick()));
oClose->show();
this->setLayout(oMainLayout);
}
To copy to clipboard, switch view to plain text mode
[Closed:] ToolButton is added but doesn't have any border, so it was difficult to recognize. Sorry for the oversight.
Bookmarks