PDA

View Full Version : Unable to add QToolButton to QToolbar on QWidget



rawfool
17th August 2012, 11:52
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?


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);
}


[Closed:] ToolButton is added but doesn't have any border, so it was difficult to recognize. Sorry for the oversight.