Working Sample:
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, m_toolbar( new QToolBar )
{
this->addToolBar(Qt::BottomToolBarArea, m_toolbar);
//m_toolbar->setStyleSheet("background-image: url(:/image/toolbar.png);");
m_toolbar->setStyleSheet("background-image: url(:/images/toolbar.png); border: 0px")
}
The following line doesn't work,
m_toolbar->setStyleSheet("background-image: url(:/image/toolbar.png);");
Add border : 0px
to enforce drawing, and then it shows picture.
m_toolbar->setStyleSheet("background-image: url(:/images/toolbar.png); border: 0px")
to apply style,
m_toolbar->setStyleSheet("background-image: url(:/images/toolbar.png); border: 0px")
or
this->setStyleSheet("QToolBar{background-image: url(:/images/toolbar.png); border: 0px;}");
Both of them work well.
Tested under MacOS 10.9, Qt5.1.1