Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Retriving "About Qt" text sample code - REPOST
Forum Updated to NodeBB v4.3 + New Features

Retriving "About Qt" text sample code - REPOST

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 4 Posters 522 Views 2 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
    Anonymous_Banned275
    wrote on last edited by
    #1

    Here is a basic top down description:

    starting at "MDI" example
    QMenu -> add main menu item into "menu bar"
    use QAction to implement "pull-down" menu
    use addAction - one of many overloads - to show local info "about xx"
    QAction *run_test = testMenu->addAction
    (tr("&Run test submenu - local about "), this, &MainWindow::about);
    run locally defined function TOK

      use  addAction - one  many overloads - to show remote "About Qt" info "
            the access to "About Qt"  application is gained by  specifying "qApp"      pointer using #define  
    

    #define qApp (static_cast<QApplication *>(QApplication::instance()))
    and implementing another "addAction"

    aboutQtAct =
    helpMenu->addAction(tr("About &Qt "),
    qApp , &QApplication::aboutQt);

    Here is my specific problem I cannot resolve:

    1. The "MDI" example application is my main project in SUBDIRS scheme.
    2. The 'btscanner" example application is one of the subprojects.
    3. They both build / run as independent projects.
    4. The main "MDI" projects builds / runs as the SUBDIRS" scheme.
    5. "MDI" project has access / runs "About Qt" project.

    HOW to I instruct "MDI" to access/ run "btscanner" project - using QMenu (QAction) ?
    Since it works with "About Qt" it should work with other QApplication, but I have not found the way to refer from "MDI" to "btscanner" .

    Cheers

    JonBJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      You are mixing two very different things.

      aboutQt is a slot of the QApplication class.

      btscanner and "MDI" are two different executables. You can't connect them like you connect a signal to a slot.

      If you would like to execute btscanner from "MDI", you should consider using the QProcess class.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      2
      • A Anonymous_Banned275

        Here is a basic top down description:

        starting at "MDI" example
        QMenu -> add main menu item into "menu bar"
        use QAction to implement "pull-down" menu
        use addAction - one of many overloads - to show local info "about xx"
        QAction *run_test = testMenu->addAction
        (tr("&Run test submenu - local about "), this, &MainWindow::about);
        run locally defined function TOK

          use  addAction - one  many overloads - to show remote "About Qt" info "
                the access to "About Qt"  application is gained by  specifying "qApp"      pointer using #define  
        

        #define qApp (static_cast<QApplication *>(QApplication::instance()))
        and implementing another "addAction"

        aboutQtAct =
        helpMenu->addAction(tr("About &Qt "),
        qApp , &QApplication::aboutQt);

        Here is my specific problem I cannot resolve:

        1. The "MDI" example application is my main project in SUBDIRS scheme.
        2. The 'btscanner" example application is one of the subprojects.
        3. They both build / run as independent projects.
        4. The main "MDI" projects builds / runs as the SUBDIRS" scheme.
        5. "MDI" project has access / runs "About Qt" project.

        HOW to I instruct "MDI" to access/ run "btscanner" project - using QMenu (QAction) ?
        Since it works with "About Qt" it should work with other QApplication, but I have not found the way to refer from "MDI" to "btscanner" .

        Cheers

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by
        #3

        @AnneRanch
        As @SGaist says, if you want to run your btscanner as a separate program/process you can do so via QProcess.

        Or, refactor your btscanner so that it exposes its functionality through some QWodget-derived class, without a main program. Then you can "load" it into an MDI subwindow.

        1 Reply Last reply
        1
        • A Offline
          A Offline
          Anonymous_Banned275
          wrote on last edited by
          #4

          Thanks, what you are all indirectly saying - there is no particular advantage to use SUBDIRS to manage programs. Again SUBDIRS is OK to manage program ( singular) and its dependent libraries. Library as in pre-compiled code .

          Which again is nothing special - "plain" C/C++ (GCC) also manages project / libraries relations .
          Adding another layer - such qMake(s) with additional options ....

          I have used plain C/C++ IDE to add "process" , the main reason I switched to to Qt was GUI and "events" . I'll give QProcess a go.

          JonBJ 1 Reply Last reply
          0
          • nageshN Offline
            nageshN Offline
            nagesh
            wrote on last edited by
            #5

            @AnneRanch If you want to invoke the already created executable then use QProcess as suggested by others.
            If you want to have greater control of "btscanner" application and it's instance creation in mdi, then modify the btscanner project as library project and include it as library in mdi project.

            1 Reply Last reply
            0
            • A Anonymous_Banned275

              Thanks, what you are all indirectly saying - there is no particular advantage to use SUBDIRS to manage programs. Again SUBDIRS is OK to manage program ( singular) and its dependent libraries. Library as in pre-compiled code .

              Which again is nothing special - "plain" C/C++ (GCC) also manages project / libraries relations .
              Adding another layer - such qMake(s) with additional options ....

              I have used plain C/C++ IDE to add "process" , the main reason I switched to to Qt was GUI and "events" . I'll give QProcess a go.

              JonBJ Offline
              JonBJ Offline
              JonB
              wrote on last edited by JonB
              #6

              @AnneRanch
              If you run it as a sub-process, be aware that there will probably be nothing to put/show from your btscanner in an MDI subwindow. Unless it writes some text to stdout, which you would like to capture and display as text in a window.

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Again: you are mixing different concepts.

                The SUBDIRS project template is a project management tool. You can build several libraries and executables through it.

                Then, how you handle these multiple executables in the end is a different problem unrelated to the project management part.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                2

                • Login

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