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. As in QML to do adaptive layout for 2 positions of the screen.
Qt 6.11 is out! See what's new in the release blog

As in QML to do adaptive layout for 2 positions of the screen.

Scheduled Pinned Locked Moved Solved QML and Qt Quick
2 Posts 2 Posters 669 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.
  • M Offline
    M Offline
    Mikeeeeee
    wrote on last edited by
    #1

    Good afternoon. If I could use if() in the ui file.qml, then it would be possible to set the width for each position, but ui.qml cannot be used if(). Please tell me how to make adaptive qml layout for 2 positions of the screen?

    ODБOïO 1 Reply Last reply
    0
    • M Mikeeeeee

      Good afternoon. If I could use if() in the ui file.qml, then it would be possible to set the width for each position, but ui.qml cannot be used if(). Please tell me how to make adaptive qml layout for 2 positions of the screen?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      hi @Mikeeeeee

      @Mikeeeeee said in As in QML to do adaptive layout for 2 positions of the screen.:

      possible to set the width for each position

      what do you mean ?

      you can replace if statement with the conditionnal operator

      property int position  : 150 
      
      property int width1 :   33
      property int width2 :   44
      
      MyItem{
      width : position < 50  width1 : width2  
      }
      
      1 Reply Last reply
      2

      • Login

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