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. Layouts with screen orientation bug?
Forum Updated to NodeBB v4.3 + New Features

Layouts with screen orientation bug?

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

    I have a problem with GridLayout in ColumnLayout. When screen orientation changes to portrait I set columns to 1 and on landscape to 2

    Console log shows correct columns setting but visually it is the oposite.
    If I change ColumnLayout to Column it works as it should.

    I am using Android QT 6.5.0 Clang armeabi-v7a

    Minimal example to reproduce the problem:

    import QtQuick
    import QtQuick.Window
    import QtQuick.Layouts
    
    Window {
        id:glavni
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
    
        ColumnLayout {
            anchors.fill: parent
            Rectangle {
                Layout.fillWidth: true
                Layout.preferredHeight: 100
                color: "blue"
            }
            Rectangle {
                Layout.fillWidth: true
                Layout.preferredHeight: 100
                color: "red"
            }
            GridLayout {
                id:postavitev
                Layout.fillWidth: true
                Layout.fillHeight: true
                columns: (Screen.primaryOrientation===Qt.PortraitOrientation)?1:2
                onColumnsChanged: {
                    console.log("Columns:"+columns)
                }
    
                Rectangle {
                    Layout.fillHeight: true
                    Layout.fillWidth: true
                    color:"yellow"
                }
                Rectangle {
                    Layout.fillHeight: true
                    Layout.fillWidth: true
                    color:"gray"
                }
    
            }
        }
    }
    
    

    Is this a bug or am I doing something wrong?

    Thanks, Aleš

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AlesMarko
      wrote on last edited by
      #2

      Works as expected in QT 6.5.2

      1 Reply Last reply
      0
      • A AlesMarko has marked this topic as solved on

      • Login

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