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

Mac OS: widget geometry is misplaced after screen resolution change

XMLWordPrintable

    • macOS

      Issue is easily seen with the application below and following next steps:
      1. launch application
      2. click application. That creates new widget with same geometry on top of current.
      3. close created widget
      4. change resolution (try several) of the screen. Don't move application
      5. click application. New widget is created BUT to the wrong position.

      main.cpp
      #include <QApplication>
      #include <QtWidgets>
      
      class MyWidget : public QWidget
      {
      	void mousePressEvent(QMouseEvent* e)
      	{
      		QWidget* w = new QWidget();
      		w->setGeometry(geometry());
      		w->show();
      	}
      };
      
      int main(int argc, char *argv[])
      {
      	QApplication a(argc, argv);
      	MyWidget w;
      	w.show();
      	return a.exec();
      }
      

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

            janichol Andy Nichols
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes