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. Use dialogs in Qt 6
Forum Updated to NodeBB v4.3 + New Features

Use dialogs in Qt 6

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
14 Posts 3 Posters 2.6k Views 3 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.
  • sierdzioS sierdzio

    It's not recognised by Qt Creator but it does work. I can see the window and the dialog in this screenshot. Qt Creator's QML code model will often fail to recognise stuff, don't worry about it. As long as it works at runtime, all is good.

    I see the dialog lacks text which you've set, though. That might be a problem. Do you see any warnings or errors in the console output?

    Q Offline
    Q Offline
    qcoderpro
    wrote on last edited by
    #5

    @sierdzio

    No, almost everything looks fine! I just get these in the Output Window:
    00:47:51: Running steps for project QML_3...
    00:47:51: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build D:/Projects/QML/QML_3/build-QML_3-Desktop_Qt_6_2_3_MinGW_64_bit-Debug --target all
    [1/10 7.0/sec] Automatic MOC for target appQML_3
    [2/9 9.6/sec] Running AUTOMOC file extraction for target appQML_3
    [3/4 1.1/sec] Building CXX object CMakeFiles/appQML_3.dir/main.cpp.obj
    [4/4 1.3/sec] Linking CXX executable appQML_3.exe
    00:47:55: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited normally.
    00:47:55: Elapsed time: 00:03.

    So what should be the reason for the window to appear this way to you, please?
    That's really strange we have to do that much modification, and suffer from the output and the red line under the element just to be able to use it in the code! :|

    Q 1 Reply Last reply
    0
    • Q qcoderpro

      @sierdzio

      No, almost everything looks fine! I just get these in the Output Window:
      00:47:51: Running steps for project QML_3...
      00:47:51: Starting: "C:\Qt\Tools\CMake_64\bin\cmake.exe" --build D:/Projects/QML/QML_3/build-QML_3-Desktop_Qt_6_2_3_MinGW_64_bit-Debug --target all
      [1/10 7.0/sec] Automatic MOC for target appQML_3
      [2/9 9.6/sec] Running AUTOMOC file extraction for target appQML_3
      [3/4 1.1/sec] Building CXX object CMakeFiles/appQML_3.dir/main.cpp.obj
      [4/4 1.3/sec] Linking CXX executable appQML_3.exe
      00:47:55: The process "C:\Qt\Tools\CMake_64\bin\cmake.exe" exited normally.
      00:47:55: Elapsed time: 00:03.

      So what should be the reason for the window to appear this way to you, please?
      That's really strange we have to do that much modification, and suffer from the output and the red line under the element just to be able to use it in the code! :|

      Q Offline
      Q Offline
      qcoderpro
      wrote on last edited by
      #6

      @qcoderpro

      Or don't we have a better alternative, please?

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #7

        Sorry I don't understand anymore what the problem is.

        So at runtime the program works OK, no problems, right?

        You are only complaining about the editor telling you about MessageDialog being not recognised? That's just Qt Creator's code model being stupid. You can just ignore it, it's pretty common.

        (Z(:^

        Q 1 Reply Last reply
        0
        • sierdzioS sierdzio

          Sorry I don't understand anymore what the problem is.

          So at runtime the program works OK, no problems, right?

          You are only complaining about the editor telling you about MessageDialog being not recognised? That's just Qt Creator's code model being stupid. You can just ignore it, it's pretty common.

          Q Offline
          Q Offline
          qcoderpro
          wrote on last edited by
          #8

          @sierdzio
          That red underline would be ignorable, that is.
          But the problem is the way the MessageDialog looks, that's undoubtedly not what we want. It's shown at the screenshot sent above if you, please, scroll up a little.

          1 Reply Last reply
          0
          • sierdzioS Offline
            sierdzioS Offline
            sierdzio
            Moderators
            wrote on last edited by
            #9

            OK, I misunderstood your previous comment then.

            I've never used this MessageDialog thing so it's hard for me to say. The code looks ok, maybe take a look at command line output (not compilation output you pasted above but Application Output tab in Qt Creator). Maybe there are some warnings there?

            The documentation suggests this dialog is NOT available on Windows:

            A native platform message dialog is currently available on the following platforms:
            iOS
            Android
            WinRT

            (https://doc.qt.io/qt-5/qml-qt-labs-platform-messagedialog.html)

            maybe that's the reason. Try the MessageDialog from QtQuick.Dialogs instead of Qt.labs. https://doc.qt.io/qt-5/qml-qtquick-dialogs-messagedialog.html

            (Z(:^

            Q 1 Reply Last reply
            1
            • sierdzioS sierdzio

              OK, I misunderstood your previous comment then.

              I've never used this MessageDialog thing so it's hard for me to say. The code looks ok, maybe take a look at command line output (not compilation output you pasted above but Application Output tab in Qt Creator). Maybe there are some warnings there?

              The documentation suggests this dialog is NOT available on Windows:

              A native platform message dialog is currently available on the following platforms:
              iOS
              Android
              WinRT

              (https://doc.qt.io/qt-5/qml-qt-labs-platform-messagedialog.html)

              maybe that's the reason. Try the MessageDialog from QtQuick.Dialogs instead of Qt.labs. https://doc.qt.io/qt-5/qml-qtquick-dialogs-messagedialog.html

              Q Offline
              Q Offline
              qcoderpro
              wrote on last edited by
              #10

              Application Output tab in Qt Creator). Maybe there are some warnings there?

              No, nothing different. Normal.

              maybe that's the reason

              Yes, that must be.

              Try the MessageDialog from QtQuick.Dialogs instead of Qt

              I created a new QtQuick project using CMake and Qt version 5.15 and tested an example of that page but get this error!
              QQmlApplicationEngine failed to load component
              qrc:/main.qml:3:1: module "QtQuick.Dialogs" version 1.3 is not installed

              JKSHJ 1 Reply Last reply
              0
              • sierdzioS Offline
                sierdzioS Offline
                sierdzio
                Moderators
                wrote on last edited by
                #11

                I don't know, maybe try some lower import like 1.2 or 1.1.

                (Z(:^

                Q 1 Reply Last reply
                0
                • sierdzioS sierdzio

                  I don't know, maybe try some lower import like 1.2 or 1.1.

                  Q Offline
                  Q Offline
                  qcoderpro
                  wrote on last edited by
                  #12

                  @sierdzio

                  I don't know, maybe try some lower import like 1.2 or 1.1.

                  I've already tried both (and even one without a version) but similar errors! :(

                  1 Reply Last reply
                  0
                  • Q qcoderpro

                    Application Output tab in Qt Creator). Maybe there are some warnings there?

                    No, nothing different. Normal.

                    maybe that's the reason

                    Yes, that must be.

                    Try the MessageDialog from QtQuick.Dialogs instead of Qt

                    I created a new QtQuick project using CMake and Qt version 5.15 and tested an example of that page but get this error!
                    QQmlApplicationEngine failed to load component
                    qrc:/main.qml:3:1: module "QtQuick.Dialogs" version 1.3 is not installed

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #13

                    @qcoderpro said in Use dialogs in Qt 6:

                    qrc:/main.qml:3:1: module "QtQuick.Dialogs" version 1.3 is not installed*

                    If you're using Qt 6.2, then do import QtQuick.Dialogs 6.2.
                    If you're using Qt 5.15, then do import QtQuick.Dialogs 1.3.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    Q 1 Reply Last reply
                    2
                    • JKSHJ JKSH

                      @qcoderpro said in Use dialogs in Qt 6:

                      qrc:/main.qml:3:1: module "QtQuick.Dialogs" version 1.3 is not installed*

                      If you're using Qt 6.2, then do import QtQuick.Dialogs 6.2.
                      If you're using Qt 5.15, then do import QtQuick.Dialogs 1.3.

                      Q Offline
                      Q Offline
                      qcoderpro
                      wrote on last edited by
                      #14

                      @JKSH

                      My project is using Qt 5.15 and CMake as its build system, and as stated in the prior posts, that version is tested, the error message is:
                      module "QtQuick.Dialogs" version 1.3 is not installed

                      Neither Qt 5.15 nor Qt 6.2 is doing well with that element!
                      rqwe.PNG

                      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