Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Question for Qt6.2 - Qt.labs.platform Dialog
Forum Updated to NodeBB v4.3 + New Features

Question for Qt6.2 - Qt.labs.platform Dialog

Scheduled Pinned Locked Moved Unsolved Qt 6
6 Posts 3 Posters 1.1k 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.
  • M Offline
    M Offline
    mingr
    wrote on 23 Sept 2021, 15:52 last edited by
    #1

    In Qt 5.15, Qt.labs.platform Dialog seems to be fine, and I can use it just by declaring it.

    But seems like for Qt6, the Dialog can no longer be used. As it will now show Dialog is an abstract base class.

    I wonder if this is the case or I set up things wrong?

    I did not see any doc mentioning the change.

    Platform: Windows/msvc_2019_64

    J 1 Reply Last reply 24 Sept 2021, 05:35
    0
    • M mingr
      23 Sept 2021, 15:52

      In Qt 5.15, Qt.labs.platform Dialog seems to be fine, and I can use it just by declaring it.

      But seems like for Qt6, the Dialog can no longer be used. As it will now show Dialog is an abstract base class.

      I wonder if this is the case or I set up things wrong?

      I did not see any doc mentioning the change.

      Platform: Windows/msvc_2019_64

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 24 Sept 2021, 05:35 last edited by
      #2

      @mingr Please take a look at https://doc-snapshots.qt.io/qt6-dev/qtlabsplatform-index.html and decide which dialog you need. Dialog is base class for the other dialogs.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply 24 Sept 2021, 15:21
      0
      • J jsulm
        24 Sept 2021, 05:35

        @mingr Please take a look at https://doc-snapshots.qt.io/qt6-dev/qtlabsplatform-index.html and decide which dialog you need. Dialog is base class for the other dialogs.

        M Offline
        M Offline
        mingr
        wrote on 24 Sept 2021, 15:21 last edited by
        #3

        @jsulm Thank you for your reply!

        Yeah, I am aware of this, but when I try using Dialog (as you mentioned, base class for the other dialogs), I will have logs saying Dialog is an abstract base class.

        So I would just like to confirm that this is intended.

        QQmlApplicationEngine failed to load component
        qrc:/main.qml:17:5: Dialog is an abstract base class
        
        import QtQuick
        import QtQuick.Controls
        import Qt.labs.platform
        
        ApplicationWindow {
            id: root
        
            width: 640
            height: 480
        
            minimumHeight: 100
            minimumWidth: 100
        
            visible: true
            title: qsTr("Test")
        
            Dialog {
                id: windowsRect
        
                anchors.fill: parent
        
                Button {
                    id: dddd
        
                    anchors.centerIn: parent
        
                    width: 100
                    height: 100
        
                    focus: true
        
                    KeyNavigation.tab: topLeft
                    KeyNavigation.up: topLeft
                    KeyNavigation.down: KeyNavigation.tab
        
                    background: Rectangle {
                        color: dddd.focus ? "yellow" : "pink"
                    }
                }
        
                Grid {
                    anchors.top: dddd.bottom
                    anchors.horizontalCenter: dddd.horizontalCenter
                    anchors.topMargin: 10
        
                    width: 100; height: 100
                    columns: 2
        
                    AbstractButton {
                        id: topLeft
                        width: 50; height: 50
                        focus: true
        
                        KeyNavigation.up: dddd
                        KeyNavigation.right: topRight
                        KeyNavigation.down: bottomLeft
        
                        background: Rectangle {
                            color: topLeft.focus ? "red" : "yellow"
                        }
                    }
        
                    AbstractButton {
                        id: topRight
                        width: 50; height: 50
        
                        KeyNavigation.left: topLeft
                        KeyNavigation.down: bottomRight
                        background: Rectangle {
                            color: topRight.focus ? "red" : "yellow"
                        }
                    }
        
                    AbstractButton {
                        id: bottomLeft
                        width: 50; height: 50
        
                        KeyNavigation.right: bottomRight
                        KeyNavigation.up: topLeft
                        background: Rectangle {
                            color: bottomLeft.focus ? "red" : "yellow"
                        }
                    }
        
                    AbstractButton {
                        id: bottomRight
                        width: 50; height: 50
        
                        KeyNavigation.left: bottomLeft
                        KeyNavigation.up: topRight
                        background: Rectangle {
                            color: bottomRight.focus ? "red" : "yellow"
                        }
                    }
                }
            }
        }
        
        
        J 1 Reply Last reply 26 Sept 2021, 14:03
        0
        • M mingr
          24 Sept 2021, 15:21

          @jsulm Thank you for your reply!

          Yeah, I am aware of this, but when I try using Dialog (as you mentioned, base class for the other dialogs), I will have logs saying Dialog is an abstract base class.

          So I would just like to confirm that this is intended.

          QQmlApplicationEngine failed to load component
          qrc:/main.qml:17:5: Dialog is an abstract base class
          
          import QtQuick
          import QtQuick.Controls
          import Qt.labs.platform
          
          ApplicationWindow {
              id: root
          
              width: 640
              height: 480
          
              minimumHeight: 100
              minimumWidth: 100
          
              visible: true
              title: qsTr("Test")
          
              Dialog {
                  id: windowsRect
          
                  anchors.fill: parent
          
                  Button {
                      id: dddd
          
                      anchors.centerIn: parent
          
                      width: 100
                      height: 100
          
                      focus: true
          
                      KeyNavigation.tab: topLeft
                      KeyNavigation.up: topLeft
                      KeyNavigation.down: KeyNavigation.tab
          
                      background: Rectangle {
                          color: dddd.focus ? "yellow" : "pink"
                      }
                  }
          
                  Grid {
                      anchors.top: dddd.bottom
                      anchors.horizontalCenter: dddd.horizontalCenter
                      anchors.topMargin: 10
          
                      width: 100; height: 100
                      columns: 2
          
                      AbstractButton {
                          id: topLeft
                          width: 50; height: 50
                          focus: true
          
                          KeyNavigation.up: dddd
                          KeyNavigation.right: topRight
                          KeyNavigation.down: bottomLeft
          
                          background: Rectangle {
                              color: topLeft.focus ? "red" : "yellow"
                          }
                      }
          
                      AbstractButton {
                          id: topRight
                          width: 50; height: 50
          
                          KeyNavigation.left: topLeft
                          KeyNavigation.down: bottomRight
                          background: Rectangle {
                              color: topRight.focus ? "red" : "yellow"
                          }
                      }
          
                      AbstractButton {
                          id: bottomLeft
                          width: 50; height: 50
          
                          KeyNavigation.right: bottomRight
                          KeyNavigation.up: topLeft
                          background: Rectangle {
                              color: bottomLeft.focus ? "red" : "yellow"
                          }
                      }
          
                      AbstractButton {
                          id: bottomRight
                          width: 50; height: 50
          
                          KeyNavigation.left: bottomLeft
                          KeyNavigation.up: topRight
                          background: Rectangle {
                              color: bottomRight.focus ? "red" : "yellow"
                          }
                      }
                  }
              }
          }
          
          
          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 26 Sept 2021, 14:03 last edited by
          #4

          @mingr That's the point: you're not supposed to use Dialog, use one of the derived dialogs.

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          M 1 Reply Last reply 27 Sept 2021, 13:46
          0
          • J jsulm
            26 Sept 2021, 14:03

            @mingr That's the point: you're not supposed to use Dialog, use one of the derived dialogs.

            M Offline
            M Offline
            mingr
            wrote on 27 Sept 2021, 13:46 last edited by
            #5

            @jsulm Ok, Thanks,

            Cause originally, I used Dialog and it seems to work as expected (like a QWidget dialog).

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jimmyCAO
              wrote on 9 Jul 2024, 08:52 last edited by
              #6

              because the qt.labs.platform has the Dialog as well, need to specifically use Dialog control in QtQuick.Controls

              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