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. QRect and QAction

QRect and QAction

Scheduled Pinned Locked Moved Solved General and Desktop
16 Posts 4 Posters 1.4k 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.
  • O Offline
    O Offline
    Oumayma
    wrote on last edited by
    #1

    My application has a QRect that moves and adjusts its size according to the Qmenu it has, I want to perform the same functionality but for the Submenus but being QAction they do not have geometry and I do not know how to do it.

    what I have:

    fbce4e9c-abf9-4931-b102-ec57dbca3b2b-image.png
    bb3afa88-6bbc-4116-9f08-9c30d9bdad7f-image.png
    8b57360f-50db-456b-82d6-c181f7570681-image.png
    a82dda9f-ec17-454b-95d9-e2f91510c7d4-image.png
    43650c65-93bd-4d00-b485-7855ee5ffbe3-image.png
    where I want to implement the same:
    c847c30b-3bbb-4e59-9eef-f06f3c7bb336-image.png

    JonBJ Pl45m4P 2 Replies Last reply
    0
    • O Oumayma

      My application has a QRect that moves and adjusts its size according to the Qmenu it has, I want to perform the same functionality but for the Submenus but being QAction they do not have geometry and I do not know how to do it.

      what I have:

      fbce4e9c-abf9-4931-b102-ec57dbca3b2b-image.png
      bb3afa88-6bbc-4116-9f08-9c30d9bdad7f-image.png
      8b57360f-50db-456b-82d6-c181f7570681-image.png
      a82dda9f-ec17-454b-95d9-e2f91510c7d4-image.png
      43650c65-93bd-4d00-b485-7855ee5ffbe3-image.png
      where I want to implement the same:
      c847c30b-3bbb-4e59-9eef-f06f3c7bb336-image.png

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

      @Oumayma
      Why in the world would you want to start out doing anything like this? Qt menus already have all of this functionality built into them, and you can influence the look via stylesheets if you wish, so why waste time reinventing the wheel?

      O 1 Reply Last reply
      2
      • JonBJ JonB

        @Oumayma
        Why in the world would you want to start out doing anything like this? Qt menus already have all of this functionality built into them, and you can influence the look via stylesheets if you wish, so why waste time reinventing the wheel?

        O Offline
        O Offline
        Oumayma
        wrote on last edited by
        #3

        @JonB Because my Text Editor is for people with physical diversity who cannot use a keyboard or a mouse. That is why I need the options to be highlighted automatically as is done by hovering over them.

        JonBJ SGaistS 2 Replies Last reply
        0
        • O Oumayma

          @JonB Because my Text Editor is for people with physical diversity who cannot use a keyboard or a mouse. That is why I need the options to be highlighted automatically as is done by hovering over them.

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

          @Oumayma
          I respect what you are saying. It is not an area I know about. But I will say two things:

          1. Still is it not possible to use the existing QMenu functionality and add in whatever you need, rather than completely rewriting it yourself? It seems to me you will do a lot of work to duplicate existing functionality.

          2. Have you at least looked through Accessibility for QWidget Applications, to see what Qt Accessibility already has to help you?

          O 1 Reply Last reply
          1
          • O Oumayma

            My application has a QRect that moves and adjusts its size according to the Qmenu it has, I want to perform the same functionality but for the Submenus but being QAction they do not have geometry and I do not know how to do it.

            what I have:

            fbce4e9c-abf9-4931-b102-ec57dbca3b2b-image.png
            bb3afa88-6bbc-4116-9f08-9c30d9bdad7f-image.png
            8b57360f-50db-456b-82d6-c181f7570681-image.png
            a82dda9f-ec17-454b-95d9-e2f91510c7d4-image.png
            43650c65-93bd-4d00-b485-7855ee5ffbe3-image.png
            where I want to implement the same:
            c847c30b-3bbb-4e59-9eef-f06f3c7bb336-image.png

            Pl45m4P Offline
            Pl45m4P Offline
            Pl45m4
            wrote on last edited by
            #5

            @Oumayma

            I guess you can still do it using stylesheet.

            QString style = "QMenuBar::item:selected { background: red; }";
            
            

            If debugging is the process of removing software bugs, then programming must be the process of putting them in.

            ~E. W. Dijkstra

            1 Reply Last reply
            1
            • O Oumayma

              @JonB Because my Text Editor is for people with physical diversity who cannot use a keyboard or a mouse. That is why I need the options to be highlighted automatically as is done by hovering over them.

              SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Hi,

              @Oumayma said in QRect and QAction:

              @JonB Because my Text Editor is for people with physical diversity who cannot use a keyboard or a mouse. That is why I need the options to be highlighted automatically as is done by hovering over them.

              That's something that you should have mentioned in the first place.

              As @JonB suggested you should start with the Accessibility module first.

              Then, people with one form or another of impairing usually have their OS or Desktop Manager tailored for them in different ways with for example hight contrast themes. Your customization might run afoul of that.

              They may also use input devices that are adapted to their needs.

              So, while your intentions are good, you might be doing counter productive work.

              Do you have any users in the pools you are targeting to test your application ?
              Do you have a design document requiring these special cases ?
              As said earlier, you might be emulating something that already exists and has been proven to work.

              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
              3
              • JonBJ JonB

                @Oumayma
                I respect what you are saying. It is not an area I know about. But I will say two things:

                1. Still is it not possible to use the existing QMenu functionality and add in whatever you need, rather than completely rewriting it yourself? It seems to me you will do a lot of work to duplicate existing functionality.

                2. Have you at least looked through Accessibility for QWidget Applications, to see what Qt Accessibility already has to help you?

                O Offline
                O Offline
                Oumayma
                wrote on last edited by Oumayma
                #7

                @JonB @SGaist From the information I have been looking for, I understand that the accessibility implementation in Qt is a tool that helps the speech synthesizer to read the options that I have correctly. It is something very useful that I will implement later, but now the implementation that I am doing is that a user by means of a button can select the options of the menu or submenus that he has, for this I need to be able to modify the existing functionality of the menus so that instead If you have to move the mouse over the menu so that the options are highlighted, the options are automatically highlighted one by one and by means of the button select the option that the user wants.

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

                  What device does he use to handle mouse like interfaces ?

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

                  O 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    What device does he use to handle mouse like interfaces ?

                    O Offline
                    O Offline
                    Oumayma
                    wrote on last edited by
                    #9

                    @SGaist I have not understood your question correctly but if you ask me, what is used as a substitute for the mouse? They use the mouse itself as a button or specific button

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

                      Can you give a bit more details about how this should work ?

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

                      O 1 Reply Last reply
                      0
                      • SGaistS SGaist

                        Can you give a bit more details about how this should work ?

                        O Offline
                        O Offline
                        Oumayma
                        wrote on last edited by
                        #11

                        @SGaist I will try to explain myself better, when you select an option from the menu, the actions contained in this menu are displayed, and if you place the mouse over the angle of the actions, it is highlighted as shown in the following image.

                        024730b1-17ce-4258-98d1-e54a0ccac3e7-image.png

                        Well, I need those actions to be highlighted but without having to move the mouse and stand on top of them.

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

                          That part is clear, my question is: how does your user interact with your application ? Or even the system as a whole ? Does he have a mouse like device ? A standard mouse ? Something else ? How is he using the computer ?

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

                          O 1 Reply Last reply
                          0
                          • SGaistS SGaist

                            That part is clear, my question is: how does your user interact with your application ? Or even the system as a whole ? Does he have a mouse like device ? A standard mouse ? Something else ? How is he using the computer ?

                            O Offline
                            O Offline
                            Oumayma
                            wrote on last edited by
                            #13

                            @SGaist The user interact with switches as you can see in the link:

                            https://bjadaptaciones.com/buscar?controller=search&orderby=position&orderway=desc&search_query=pulsador&submit_search=

                            That are connected to adapters as you can see in the link:

                            https://bjadaptaciones.com/con-conmutadores/178-adaptador-usb-para-2-conmutadores.html?search_query=bj-805&results=1

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

                              Ok, so the target user will have one or maybe two buttons to do all actions ? Is that correct ?

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

                              O 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                Ok, so the target user will have one or maybe two buttons to do all actions ? Is that correct ?

                                O Offline
                                O Offline
                                Oumayma
                                wrote on last edited by
                                #15

                                @SGaist yes

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

                                  Then I think you took the problem from the wrong end. You seem to want to force a conventional GUI to be adapted to an unconventional input device.

                                  I think you should rather design your application with unconventional widgets that fits the input device.

                                  From the looks of it, your menu's entries will get highlighted one after the other and the user shall click on the button in order to select the action but how will the user get to this menu in the first place ? And even before that, what will be the goal of your application ?

                                  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
                                  0

                                  • Login

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