Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. C++ Gurus
  4. Please help with actual C++ code
Forum Updated to NodeBB v4.3 + New Features

Please help with actual C++ code

Scheduled Pinned Locked Moved Unsolved C++ Gurus
25 Posts 5 Posters 3.8k 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.
  • A Anonymous_Banned275

    This post is deleted!

    A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #13
    This post is deleted!
    Chris KawaC 1 Reply Last reply
    0
    • A Anonymous_Banned275

      This post is deleted!

      Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #14

      I would try to help, but I've no idea what you're trying to achieve. Code you posted makes no sense unfortunately.

      Maybe you could draw a layout you want and I can help achieve it in code?

      A 1 Reply Last reply
      1
      • Chris KawaC Chris Kawa

        I would try to help, but I've no idea what you're trying to achieve. Code you posted makes no sense unfortunately.

        Maybe you could draw a layout you want and I can help achieve it in code?

        A Offline
        A Offline
        Anonymous_Banned275
        wrote on last edited by
        #15
        This post is deleted!
        JonBJ 1 Reply Last reply
        0
        • A Anonymous_Banned275

          This post is deleted!

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

          @AnneRanch said in Please help with actual C++ code:

          I have been told I cannot have "check box : in main menu

          You can have a checkbox on an action in any menu, "main" or not. These are created via QMenu::addAction().

          However, if you instead add an item which is a submenu (a > that you click on to display a "slide-out" menu) you cannot have a checkbox on that item. These are created via QMenu::addMenu(). And if you think about it, what would be the point of having a checkbox on a menu item which just displays a submenu anyway?

          A 1 Reply Last reply
          1
          • JonBJ JonB

            @AnneRanch said in Please help with actual C++ code:

            I have been told I cannot have "check box : in main menu

            You can have a checkbox on an action in any menu, "main" or not. These are created via QMenu::addAction().

            However, if you instead add an item which is a submenu (a > that you click on to display a "slide-out" menu) you cannot have a checkbox on that item. These are created via QMenu::addMenu(). And if you think about it, what would be the point of having a checkbox on a menu item which just displays a submenu anyway?

            A Offline
            A Offline
            Anonymous_Banned275
            wrote on last edited by
            #17
            This post is deleted!
            A 1 Reply Last reply
            0
            • A Anonymous_Banned275

              This post is deleted!

              A Offline
              A Offline
              Anonymous_Banned275
              wrote on last edited by
              #18
              This post is deleted!
              1 Reply Last reply
              0
              • TomZT Offline
                TomZT Offline
                TomZ
                wrote on last edited by
                #19

                reading this generally,

                @AnneRanch said in Please help with actual C++ code:

                The widow just do part of the interface and then I will oopen anither widow to continue... eventually all windows will comlete the required task. So when it is all done I can close it and it would be nice to reopen ALL of then at once when required...hence I thought it could be done in main window...
                The whole idea to have uncluttered interaction as required -- one window At the time...

                I have the strong suspicion you're trying to implement a GUI idea using existing components which are not actually meant to be used like that at all.
                Specifically, QMenu and its related classes are NOT supposed to be used like windows. You're not going to get a good user experience using this kind of windows.

                If you share your GUI idea you might get suggestions on how to approach the app.

                I suspect a QML component will give you a LOT more flexibility that will allow you to get a good user experience.

                A 1 Reply Last reply
                1
                • TomZT TomZ

                  reading this generally,

                  @AnneRanch said in Please help with actual C++ code:

                  The widow just do part of the interface and then I will oopen anither widow to continue... eventually all windows will comlete the required task. So when it is all done I can close it and it would be nice to reopen ALL of then at once when required...hence I thought it could be done in main window...
                  The whole idea to have uncluttered interaction as required -- one window At the time...

                  I have the strong suspicion you're trying to implement a GUI idea using existing components which are not actually meant to be used like that at all.
                  Specifically, QMenu and its related classes are NOT supposed to be used like windows. You're not going to get a good user experience using this kind of windows.

                  If you share your GUI idea you might get suggestions on how to approach the app.

                  I suspect a QML component will give you a LOT more flexibility that will allow you to get a good user experience.

                  A Offline
                  A Offline
                  Anonymous_Banned275
                  wrote on last edited by
                  #20

                  @TomZ Thanks, however... I am just extending "windows
                  ...tile...cascade..." menu using mdiArea (example). I have it essentially working, include "connect". The "problem is " - it can be started with QMenu -that makes submenu extension easy - but adding "checkable " to sub menu is currently failing. Or I can start with QAction then adding depended sub menu fails. Right now I feel starting with "cascading menus " is cleaner ..in case I want to add sususbsub....
                  The "user" -me - has several depended tasks to accomplish - setup serial connection, then setup dependent Bluetooth connection, configure remote Bluetooth device and then attach it to "serial connection" etc.,key remote device - amateur radio transmitter, listen to "meteor scatter" pings on Internet ...
                  The basic idea is to do all this in separate forms , I got that going, to keep monitor and me , focused on task...

                  A 1 Reply Last reply
                  0
                  • A Anonymous_Banned275

                    @TomZ Thanks, however... I am just extending "windows
                    ...tile...cascade..." menu using mdiArea (example). I have it essentially working, include "connect". The "problem is " - it can be started with QMenu -that makes submenu extension easy - but adding "checkable " to sub menu is currently failing. Or I can start with QAction then adding depended sub menu fails. Right now I feel starting with "cascading menus " is cleaner ..in case I want to add sususbsub....
                    The "user" -me - has several depended tasks to accomplish - setup serial connection, then setup dependent Bluetooth connection, configure remote Bluetooth device and then attach it to "serial connection" etc.,key remote device - amateur radio transmitter, listen to "meteor scatter" pings on Internet ...
                    The basic idea is to do all this in separate forms , I got that going, to keep monitor and me , focused on task...

                    A Offline
                    A Offline
                    Anonymous_Banned275
                    wrote on last edited by
                    #21
                    This post is deleted!
                    Axel SpoerlA JonBJ 2 Replies Last reply
                    0
                    • A Anonymous_Banned275

                      This post is deleted!

                      Axel SpoerlA Offline
                      Axel SpoerlA Offline
                      Axel Spoerl
                      Moderators
                      wrote on last edited by
                      #22

                      @AnneRanch said in Please help with actual C++ code:

                      subMenu[index]->addAction(list_array[index][ 2] + " #" + QString::number( index_sub));

                      ...returns a QAction *. You need to store this pointer to connect to the action's triggeredsignal. Then you can skip the whole acrobatics about getting index inside a slot.

                      Do you understand that?

                      Software Engineer
                      The Qt Company, Oslo

                      1 Reply Last reply
                      1
                      • A Anonymous_Banned275

                        This post is deleted!

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

                        @AnneRanch

                        but I am unable to add "check box" to any of them

                        QAction *action = submenu[index]->addAction("Some text");
                        action->setCheckable(true);
                        

                        adds an action with text Some text and sets it to have a checkbox.

                        A 1 Reply Last reply
                        0
                        • JonBJ JonB

                          @AnneRanch

                          but I am unable to add "check box" to any of them

                          QAction *action = submenu[index]->addAction("Some text");
                          action->setCheckable(true);
                          

                          adds an action with text Some text and sets it to have a checkbox.

                          A Offline
                          A Offline
                          Anonymous_Banned275
                          wrote on last edited by
                          #24
                          This post is deleted!
                          A 1 Reply Last reply
                          0
                          • A Anonymous_Banned275

                            This post is deleted!

                            A Offline
                            A Offline
                            Anonymous_Banned275
                            wrote on last edited by Anonymous_Banned275
                            #25
                            This post is deleted!
                            1 Reply Last reply
                            0
                            • Axel SpoerlA Axel Spoerl referenced this topic on

                            • Login

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