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

Constantly getting QWindowsWindow::setGeometry: Unable to set geometry warning

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 5.12.0
    • GUI: Window management
    • None
    • Windows

    Description

      Since I migrated from Qt 5.6.0 to Qt 5.12.0 I get tones of message reporting setGeometry failed. This is even reported for a very simple program opening a QDialog:

       

      main.cpp:

      #include <QApplication>
      #include "mainframe.h"
      #include <qDebug>

      void MessageOutput( QtMsgType type, const QMessageLogContext &context, const QString &msg)
      {
          qDebug() << msg;
      }

      int main( int argc, char* argv[] )
      {
          QApplication app(argc, argv);

          qInstallMessageHandler(MessageOutput);

          MainFrame wnd;

          wnd.show();return app.exec();
      }

      mainframe.h:

      #include <QMainWindow>

      class MainFrame : public QMainWindow
      {
          Q_OBJECT

      public:
          MainFrame();

      public slots:
          void showPopup();
      };

       

      mainframe.cpp:

       

      #include "mainframe.h"

      #include <QDialog>
      #include <QLabel>
      #include <QPushButton>
      #include <QVBoxLayout>

      MainFrame::MainFrame()
      {
          QPushButton* pTextButton = new QPushButton( "Show popup", this );
          connect( pTextButton, SIGNAL(clicked()), this, SLOT(showPopup()) );

      setCentralWidget( pTextButton );
      }

      void MainFrame::showPopup()
      {
          QDialog dlg( this );
          dlg.setLayout( new QVBoxLayout() );
          dlg.layout()->addWidget( new QLabel("popup message",&dlg) );
          dlg.exec();
      }

       

       

      Under Windows 7, this reports warning:

      QWindowsWindow::setGeometry: Unable to set geometry 132x30+682+303 on QWidgetWin
      dow/'QDialogClassWindow'. Resulting geometry: 132x42+682+303 (frame: 4, 28, 4,
      4, custom margin: 0, 0, 0, 0, minimum size: 116x42, maximum size: 16777215x16777
      215).

      Attachments

        Issue Links

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

          Activity

            People

              kleint Friedemann Kleint
              jpo38 Jean Porcherot
              Votes:
              10 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes