Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to get my Fullscreen-Window to the second Screen?

How to get my Fullscreen-Window to the second Screen?

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 1.4k Views
  • 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.
  • L Offline
    L Offline
    LowLevelM
    wrote on last edited by LowLevelM
    #1

    I try to get this sample Window on my second screen, i tried serveral ways but the window always appears on screen 0

    My System: Dual-Monitor, nearly fresh Ubuntu 18.04 x64 installation with all updates, default Unity Window-Manager, NVIDIA Quadro M3000M with latest closed source driver (NVIDIA-SMI 390.116)

    import QtQuick 2.5
    import QtQuick.Window 2.5
    
    Window {
        color: "black" // is always white
        
        //tried but gives me not the correct size
        //i don't know if these flags are needed
        //modality: Qt.ApplicationModal
        //flags: Qt.Dialog | Qt.FramelessWindowHint | Qt.WindowFullScreen
        
        // correct width, height but warning:
        // Conflicting properties 'visible' and 'visibility' for Window 'fullScreen'
        visibility : Window.FullScreen
        
        // the window always appears on screen 0
        // Qt.application.screens[1] puts the window also to screen 0
        screen: Qt.application.screens[0]
        
        Rectangle {
            anchors.fill: parent
            border { width: 10; color: "yellow" }
        }
        
        MouseArea {
            anchors.fill: parent
            onClicked: {
                Qt.quit()
            }
        }
        
        Component.onCompleted : {
            var screens = Qt.application.screens;
            for (var i = 0; i < screens.length; ++i)
                console.log("screen " + screens[i].name + " has geometry " +
                            screens[i].virtualX + ", " + screens[i].virtualY + " " +
                            screens[i].width + "x" + screens[i].height)
            //output:
            //qml: screen eDP-1-1 has geometry 0, 0 1920x1080
            //qml: screen HDMI-1-1 has geometry 1920, 0 1920x1080
        }
    }
    

    My Screen settings:
    0_1564556029030_Screenshot from 2019-07-31 08-53-16.png

    1 Reply Last reply
    0
    • IntruderExcluderI Offline
      IntruderExcluderI Offline
      IntruderExcluder
      wrote on last edited by IntruderExcluder
      #2

      Have you tried Component.onCompleted: showFullScreen() (without any flags and visibility props) for your window?

      L 1 Reply Last reply
      0
      • IntruderExcluderI IntruderExcluder

        Have you tried Component.onCompleted: showFullScreen() (without any flags and visibility props) for your window?

        L Offline
        L Offline
        LowLevelM
        wrote on last edited by LowLevelM
        #3

        @intruderexcluder

        I've already fixed my problem

        i also need to set

        Window
        x: screen.virtualX
        y: screen.virtualY

        the screen property own its own does just nothing

        1 Reply Last reply
        1

        • Login

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