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

QWindow::setScreen has no effect

    XMLWordPrintable

Details

    Description

      QWindow::SetScreen() does not have any effect if tried to move widget screen to other.

        QLabel* widget = new QLabel();
          widget->show();
          widget->windowHandle()->setScreen(screen);
          widget->setText("This should be shown in the screen " + screen->name());
          widget->resize(300,50);
          widget->show();
      

      workaround is to get screen geometry and move widget to that area

          QRect screenres = QApplication::desktop()->screenGeometry(item->text().toInt());
          widget->move(QPoint(screenres.center().x() - widget->width()/2,
                         screenres.center().y() - widget->height()/2));
      

      Attachments

        Issue Links

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

          Activity

            People

              srutledg Shawn Rutledge
              qtcomsupport Qt Support
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes