Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How should I learn about context menu's? Any good resources? / Object specific context menu
bartvrossum last edited by bartvrossum
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. :)
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.
bartvrossum last edited by
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?
Pl45m4 last edited by Pl45m4
Exactly what is written there...
If you redefine a function, you have to mark it as "override".
overridebehind your function header and the warning is gone (in your case: destructor)