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. I want to change the QAction::setenabled() to true after left a QContextMenu in QTreeView
Forum Updated to NodeBB v4.3 + New Features

I want to change the QAction::setenabled() to true after left a QContextMenu in QTreeView

Scheduled Pinned Locked Moved Unsolved General and Desktop
18 Posts 3 Posters 810 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #8

    And where is that enabled action shown in your application when you trigger your contextual menu ?

    By the way, you never delete contextMenu so it will fill up memory until ui->tree is deleted.

    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
    1
    • D Offline
      D Offline
      developer_61
      wrote on last edited by developer_61
      #9

      @SGaist the Activated Action will be selectable in my
      contextmenu. So After the Right Click I can select it.
      ->it will shown in the Context Menu.

      So what you mean? Is there no Chance to realize that what i want ?

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

        You do realize that from your code you are changing two different unrelated actions ?

        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
        • D Offline
          D Offline
          developer_61
          wrote on last edited by developer_61
          #11

          @SGaist Yeah sorry ist has to be the Same Action.

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

            Then why use two different actions ?

            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
            • D Offline
              D Offline
              developer_61
              wrote on last edited by developer_61
              #13

              @SGaist what you mean? I mean i Need the same
              Action to set enabled and Set not enabled?

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

                You are explaining that you want an action to be enabled when showing your context menu and disabled afterward. Is that the action that should be shown by the contextual menu ?

                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
                • D Offline
                  D Offline
                  developer_61
                  wrote on last edited by
                  #15

                  @SGaist yess right its exactly that Action.

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

                    Then use that action in your contextual menu.

                    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
                    • D Offline
                      D Offline
                      developer_61
                      wrote on last edited by developer_61
                      #17

                      @SGaist and then how can i set it to not enabled After i close the Context Menu?

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

                        Exactly like you were already explained: do that after the exec call.

                        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
                        1

                        • Login

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