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. Overlaying the Qt form window on the Qml window
Forum Updated to NodeBB v4.3 + New Features

Overlaying the Qt form window on the Qml window

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 636 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.
  • A Offline
    A Offline
    Aravinth Ravi
    wrote on last edited by
    #1

    Hi,

    I have overlaid the Qt form window on the Qml window. When I trigger the application, both the windows were displayed on the screen simultaneously, in such a way that, form window overlaid on the Qml window.

    But when I implement the signal slot connection between the form window and Qml window, both the windows were not displaying on the screen simultaneously, Qml window is displayed and form window is minimized and the icon is displaying on the taskbar. When I click on the icon, form window is getting overlaid on the Qml window.

    When there is no signal slot connection, both the windows were displayed simultaneously.(Signal in Qml window and slot in form window) And also when I trigger any components in Qml window, the overlaid form window is getting minimized.

    Everytime when I trigger the application, both windows has to open simultaneously and none of the window has to be minimized, when I trigger any components.

    Provide some inputs to sort out this issue. Thanks in advance.

    dheerendraD 1 Reply Last reply
    0
    • A Aravinth Ravi

      Hi,

      I have overlaid the Qt form window on the Qml window. When I trigger the application, both the windows were displayed on the screen simultaneously, in such a way that, form window overlaid on the Qml window.

      But when I implement the signal slot connection between the form window and Qml window, both the windows were not displaying on the screen simultaneously, Qml window is displayed and form window is minimized and the icon is displaying on the taskbar. When I click on the icon, form window is getting overlaid on the Qml window.

      When there is no signal slot connection, both the windows were displayed simultaneously.(Signal in Qml window and slot in form window) And also when I trigger any components in Qml window, the overlaid form window is getting minimized.

      Everytime when I trigger the application, both windows has to open simultaneously and none of the window has to be minimized, when I trigger any components.

      Provide some inputs to sort out this issue. Thanks in advance.

      dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      @Aravinth-Ravi
      Sample program would be helpful to quickly help.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      A 1 Reply Last reply
      0
      • dheerendraD dheerendra

        @Aravinth-Ravi
        Sample program would be helpful to quickly help.

        A Offline
        A Offline
        Aravinth Ravi
        wrote on last edited by
        #3

        Hi @dheerendra ,

        This is my sample code, for your reference,
        int main(int argc, char *argv[])
        {
        #if defined(Q_OS_WIN)
        QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
        #endif

        QGuiApplication app(argc, argv);
        
        
        QApplication a(argc, argv);
        QScreen *screen = QGuiApplication::primaryScreen();
        MainWindow w;
        int ScreenGeometry_width = screen->geometry().width();
        int ScreenGeometry_height = screen->geometry().height();
        w.move(100,100);
        w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
        w.resize(ScreenGeometry_width-120,ScreenGeometry_height-120);
        w.show();
        
        QQmlApplicationEngine engine1;
        QQmlComponent component(&engine1, QUrl(QLatin1String("qrc:/main.qml")));
        QObject *mainPage = component.create();
        
        QObject* item1 = mainPage->findChild<QObject *>("button2");
        
        
        
        QObject::connect(item1, SIGNAL(clickedButton1(QString)), &w, SLOT(onButtonClicked1(QString)));
        
        return app.exec();
        

        }

        dheerendraD 1 Reply Last reply
        0
        • A Aravinth Ravi

          Hi @dheerendra ,

          This is my sample code, for your reference,
          int main(int argc, char *argv[])
          {
          #if defined(Q_OS_WIN)
          QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
          #endif

          QGuiApplication app(argc, argv);
          
          
          QApplication a(argc, argv);
          QScreen *screen = QGuiApplication::primaryScreen();
          MainWindow w;
          int ScreenGeometry_width = screen->geometry().width();
          int ScreenGeometry_height = screen->geometry().height();
          w.move(100,100);
          w.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
          w.resize(ScreenGeometry_width-120,ScreenGeometry_height-120);
          w.show();
          
          QQmlApplicationEngine engine1;
          QQmlComponent component(&engine1, QUrl(QLatin1String("qrc:/main.qml")));
          QObject *mainPage = component.create();
          
          QObject* item1 = mainPage->findChild<QObject *>("button2");
          
          
          
          QObject::connect(item1, SIGNAL(clickedButton1(QString)), &w, SLOT(onButtonClicked1(QString)));
          
          return app.exec();
          

          }

          dheerendraD Offline
          dheerendraD Offline
          dheerendra
          Qt Champions 2022
          wrote on last edited by dheerendra
          #4

          @Aravinth-Ravi
          It helps if you give compilable sample code.

          Dheerendra
          @Community Service
          Certified Qt Specialist
          http://www.pthinks.com

          A 2 Replies Last reply
          0
          • dheerendraD dheerendra

            @Aravinth-Ravi
            It helps if you give compilable sample code.

            A Offline
            A Offline
            Aravinth Ravi
            wrote on last edited by
            #5

            @dheerendra,

            Is it possible to load a raw file in qml ? I did'nt find any examples to load a raw file in Qml window.

            dheerendraD 1 Reply Last reply
            0
            • A Aravinth Ravi

              @dheerendra,

              Is it possible to load a raw file in qml ? I did'nt find any examples to load a raw file in Qml window.

              dheerendraD Offline
              dheerendraD Offline
              dheerendra
              Qt Champions 2022
              wrote on last edited by
              #6

              @Aravinth-Ravi
              Raw file means ? Please clarify.

              Dheerendra
              @Community Service
              Certified Qt Specialist
              http://www.pthinks.com

              A 1 Reply Last reply
              0
              • dheerendraD dheerendra

                @Aravinth-Ravi
                Raw file means ? Please clarify.

                A Offline
                A Offline
                Aravinth Ravi
                wrote on last edited by
                #7

                @dheerendra,

                I have to load image file of .raw format in Qml window.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  Aravinth Ravi
                  wrote on last edited by
                  #8
                  This post is deleted!
                  1 Reply Last reply
                  0
                  • dheerendraD dheerendra

                    @Aravinth-Ravi
                    It helps if you give compilable sample code.

                    A Offline
                    A Offline
                    Aravinth Ravi
                    wrote on last edited by
                    #9

                    @dheerendra,

                    I have attached the code in the below mentioned link,
                    [https://panaceamedicaltechnologies.sharepoint.com/:u:/g/EQhVtXjM-nVBlvVJh7pb6nsB7btUOnsTr9f6Tm-rqTFMSQ?e=KoUV2W](link url)

                    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