Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    [Solved] Qt Popup and C++/QML Application

    General and Desktop
    2
    3
    2356
    Loading More Posts
    • 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.
    • W
      Wroman last edited by

      Hello,

      i'm unsure of where to post this but hey, having a try here.

      I'm currently developing a GUI in cpp/QML.

      I got a HMI Manager which is a QObject for the managing of the signals and the communication with the rest of the app and qml files for the Graphical part and managing actions from the user. The cpp creates the QQuickView and loads the qml at init and connect signals and all this.

      At that point, no problem.

      I just want to display a pop-up to make some kind of authentification (secured mode to control a camera rotation, etc) and I'm wondering where to create the pop-up.

      As a dynamically created QML object or in the Manager with sort of QMessageBox ( solution i tried and it asks me that i can't make QWidgets without QApplication, I got a QGuiApplication thought.) ?

      What's the best practice and what's possible to do ?

      Trust me, i'm an engineer !

      1 Reply Last reply Reply Quote 0
      • B
        b1gsnak3 last edited by

        Well... QMessageBox is part of QtWidgets module and documentation states that for QWidget based Qt applications you should use QApplication because it provides "some" functionality needed for creating QWidget instances. Therefore you need QApplication for QMessageBox. You should use QApplication for all your GUI based applications as you will be probably be needing to add QWidgets or other derived classes.

        1 Reply Last reply Reply Quote 0
        • W
          Wroman last edited by

          You're right, i'm a bit tired. Misread the docs before posting.

          Thanks !

          Trust me, i'm an engineer !

          1 Reply Last reply Reply Quote 0
          • First post
            Last post