Unsolved I want to change the QAction::setenabled() to true after left a QContextMenu in QTreeView
-
I want to have the Action not enabled in the First Step like i did in the constructor. After that i want to set the Action enabled After i‘m Open the Context Menu with the Right Click. In the Last Step i want to set it not enabled after i‘m going to Close the context menu. Why?
I have More actions with More elements. The elements will have another enabled Actions.
@Christian-Ehrlicher that is want i want to reach. -
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.
-
@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 ?
-
You do realize that from your code you are changing two different unrelated actions ?
-
@SGaist Yeah sorry ist has to be the Same Action.
-
Then why use two different actions ?
-
@SGaist what you mean? I mean i Need the same
Action to set enabled and Set not enabled? -
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 ?
-
@SGaist yess right its exactly that Action.
-
Then use that action in your contextual menu.
-
@SGaist and then how can i set it to not enabled After i close the Context Menu?
-
Exactly like you were already explained: do that after the exec call.