Unsolved How should I learn about context menu's? Any good resources? / Object specific context menu
-
Hi,
I want to learn about context menu. Is there any good resource or course that covers it?
Can you have context menu's for specific items in the applications? Let's say, for a QLabel, or for a QTextTabel inside a QTextEdit?Appreciate the help. :)
-
Hi,
Take a look at the Menus Example.
It is explained for the QMainWindow class but it's also valid for others as explained at the bottom of the page.
-
I kinda get stuck on the "whats the difference between contextMenuEvent() and setContextMenuPolicy()" stuff and on the fact that when i put down this code in my own project:
protected: #ifndef QT_NO_CONTEXTMENU void contextMenuEvent(QContextMenuEvent *event) override; #endif // QT_NO_CONTEXTMENU
I get this error:
What's up with this?
-
Exactly what is written there...
If you redefine a function, you have to mark it as "override".
Put the
override
behind your function header and the warning is gone (in your case: destructor)