Uploaded image for project: 'Qt Solutions'
  1. Qt Solutions
  2. QTSOLBUG-45

QtDotNet style not set correctly for QToolButton

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • Some Release
    • No Version
    • DotNetStyle
    • 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();
      }

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bachewii Jens
            xcm Martin Petersson (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes