Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
No Version
-
None
Description
When using QtDotNetStyle on a QToolButton within a QWidget the style does not look the same as when it is used on a QToolButton that is directly in the QToolBar.
In the following example the toolbutton will look differently when the mouse is over the buttons.
Example Code:
#include <QApplication>
#include <QMainWindow>
#include <QWidget>
#include <QToolButton>
#include <QHBoxLayout>
#include <QToolBar>
#include <QPalette>
#include <QStyle>
int main(int argc, char *argv[])
{
QApplication::setStyle("qtdotnet");
QApplication a(argc, argv);
QMainWindow mainWin(0, 0);
QToolBar* pBarA = new QToolBar(&mainWin);
QToolButton* pButtonA = new QToolButton(pBarA);
pButtonA->setAutoRaise(true);
pButtonA->setText("Hi World");
pBarA->addWidget(pButtonA);
mainWin.addToolBar(pBarA);
QWidget* pTBwidget = new QWidget(&mainWin);
QToolBar* pBarB = new QToolBar(&mainWin);
QToolButton* pButtonB = new QToolButton(pTBwidget);
pButtonB->setText("Hi there");
pButtonB->setAutoRaise(true);
QHBoxLayout* pLayout = new QHBoxLayout(pBarB);
pLayout->addWidget(pButtonB);
pTBwidget->setLayout(pLayout);
pBarB->addWidget(pTBwidget);
mainWin.addToolBar(pBarB);
mainWin.show();
return a.exec();
}