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. ApplicationWindow width and height is not setting properly on Visibility changed

ApplicationWindow width and height is not setting properly on Visibility changed

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 141 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.
  • P Offline
    P Offline
    PriyankaBheemaraddi
    wrote on last edited by PriyankaBheemaraddi
    #1

    On restore down of window we are setting the Application window's height and width to 1280720, When application is launched and we drag the Application window for the first time, window's height and width is not setting to 1280720.

    Code sample :

    import QtQuick 2.12
    import QtQuick.Window 2.15
    import QtQuick.Layouts 1.2
    import QtQuick.Controls 2.12

    ApplicationWindow {
    id:mainWindow1
    visible: true
    flags: Qt.Window
    visibility: Qt.WindowFullScreen
    minimumWidth:1280 //Later min width will be defined
    minimumHeight:720//Later min height will be defined
    color: "gray"

    onVisibilityChanged: {
        if(mainWindow1.visibility == 4){
            mainWindow1.width =  Screen.width
            mainWindow1.height = Screen.height 
        }
         else if(mainWindow1.visibility == 2) {
            mainWindow1.width = 1280   
            mainWindow1.height = 720  
        }
    }
    

    }

    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