Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-7460

QPushButton on Mac does not report size correctly under some circumstances.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P3: Somewhat important P3: Somewhat important
    • 5.6.3
    • 4.6.0, 5.6.1
    • Widgets: Layout
    • None
    • Snow Leopard
    • macOS
    • e2d8c7bf2203cbc0c7ff923caf3132881aafa0b0

      Running the sample form below shows how a QPushButton widget does not get drawn correctly on the Mac with the given construct.

      Tested on cocoa, carbon and windows.

      #include <QtGui>
      class Form : public QWidget
      {
      public:
      
          QGridLayout *gridLayout;
          QDockWidget *dockWidget;
          QWidget *dockWidgetContents;
          QVBoxLayout *verticalLayout;
          QPushButton *pushButton;
      
          Form()
          {
              this->resize(320, 276);
              gridLayout = new QGridLayout(this);
              gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
              dockWidget = new QDockWidget(this);
              dockWidget->setObjectName(QString::fromUtf8("dockWidget"));
      
      //set floating makes this a tool type window, this seems to be related.
              dockWidget->setFloating(true);
      
              dockWidgetContents = new QWidget();
              dockWidgetContents->setObjectName(QString::fromUtf8("dockWidgetContents"));
              verticalLayout = new QVBoxLayout(dockWidgetContents);
              verticalLayout->setObjectName(QString::fromUtf8("verticalLayout"));
              pushButton = new QPushButton("PushButton",dockWidgetContents);
              pushButton->setObjectName(QString::fromUtf8("pushButton"));
              verticalLayout->addWidget(pushButton);
              dockWidget->setWidget(dockWidgetContents);
              gridLayout->addWidget(dockWidget, 0, 0, 1, 1);
          }
      };
      
      int main (int argc, char *argv[])
      {
          QApplication app(argc, argv);
          Form form;
          form.show();
          return app.exec();
      }
      
      

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

            andysh Andy Shaw
            dettman Dean Dettman (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes