[Qt-interest] Extending the context menu of a QDoubleSpinBox
Bo Thorsen
bo at fioniasoftware.dk
Sat Jan 14 12:12:35 CET 2012
Den 13-01-2012 19:13, Emmanuel Mayssat skrev:
> Hello,
>
> I would like to extend the menu of q QDoubleSpinBox.
> I can modify the contextMenuEvent and trigger my custom menu.
> But I would like my custom menu to be appended to the standard menu.
>
> With some other widget , I believe it is possible to use
> the createStandardContextMenu method, but that method doesn't seem to
> exist for QDoubleSpinBox.....
Try subclassing it and implement the event handler, listen for children
added, check if a new child is a QMenu...
It's a bit of an evil hack, but sometimes you have to do stuff like this.
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk
More information about the Qt-interest-old
mailing list