Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT 5.0 fullscreen mode behavior changed in Windows 7?
Forum Updated to NodeBB v4.3 + New Features

QT 5.0 fullscreen mode behavior changed in Windows 7?

Scheduled Pinned Locked Moved General and Desktop
8 Posts 4 Posters 5.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    ffggff
    wrote on last edited by
    #1

    In a dual-screen configuration switching a window into fullscreen mode did not change the screen in all versions up to 4.8.4. In Qt 5, however, this is no longer true. Instead the window alway uses the main screen (screen 0). Is this intended behavior or just a bug?

    I really need the old behaviour and would appreciate if someone knows a way to influence the target screen for fullscreen mode.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      you can change the window to a different screen, but i have no idea ( geometry doesn't work ) how to use both screens.

      Here an example to use the last screen:

      @ QList<QScreen *> screenList = app.screens();

      viewer.setScreen(screenList.last());
      
      viewer.showFullScreen();@
      
      1 Reply Last reply
      0
      • F Offline
        F Offline
        ffggff
        wrote on last edited by
        #3

        Thanks for the response. Unfortunately it did not work. I assumed from your example that setScreen() is a member of QWidget, but this is not the case. What type is the variable "viewer" you use in your snippet? Has you ever sucessfully used this method in Qt 5?

        1 Reply Last reply
        0
        • H Offline
          H Offline
          hpollak
          wrote on last edited by
          #4

          Viewer is the QML-Viewer created by the QTCreator 2.6.1 when you begin a new QML2 Application

          1 Reply Last reply
          0
          • F Offline
            F Offline
            ffggff
            wrote on last edited by
            #5

            Thanks again! The method setScreen() is a member of QWindows but not of QWidget. However, there is a member QWidget::windowHandle() that returns the pointer to the actual QWindow (although marked as "preliminary" in the documentation).

            Therefore, using

            ex->windowHandle()->setScreen(screenList.last())

            where ex is a pointer to a QWidget, does the trick.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              levelxxl
              wrote on last edited by
              #6

              Hi, does any one found a real solution for a QWidget based application?

              This isin't working at all on my system.

              QWidget::windowHandle() returns a constant. When casting and passing the second Screen to setScreen, everything just disappears.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                ffggff
                wrote on last edited by
                #7

                The above mentioned method works at least on Windows7, that is, on my dual-monitor system

                @QWidget *ex = <assign a pointer to an existing QWidget object>;
                QList<QScreen *> screenList = app.screens();
                ex->windowHandle()->setScreen(screenList.last());
                ex->showFullScreen();@

                opens a window on the second screen. Please note that QWidget::windowHandle() returns a pointer to QWindow, not a constant.

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  b1gsnak3
                  wrote on last edited by
                  #8

                  levelxxl you shouldn't call the windowHandle method from the QWidget namespace. You should call it on your applications widget :)

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved