hello everyone,
would like to enquire if anyone has encountered this before. Where a popup menu will appear on the scrollbar when the scroll bar is right clicked.
Is there a way to disable this menu? Thanks in advance.
hello everyone,
would like to enquire if anyone has encountered this before. Where a popup menu will appear on the scrollbar when the scroll bar is right clicked.
Is there a way to disable this menu? Thanks in advance.
try setContextMenuPolicy(Qt::NoContextMenu)
Mithin
www.mithin.in
will give it a try...must we detect any events beforehand? like contextmenu event or key event?
The fact that you widget has a scrollbar makes me think that it is sublassed from QAbsractScrollArea. With all probability you're overloading the contextMenuEvent() in your class. This causes context menu being shown over the scrollbars.
You should overload viewportEvent ( QEvent * e ) in your class and handle the event with QEvent::ContextMenu type there instead of overloading contextMenuEvent().
With all probability this will help.
Thanks for the imput guys i really appreciate your help I tried both approaches but unfortunately the scrollbar popup menu still appears.
Is this an inbuilt QT feature? could someone in trolltech confirm this? Thanks once again.
(PS i am using Qt 4.1.1)
Qt Code:
scrollArea->horizontalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu); scrollArea->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);To copy to clipboard, switch view to plain text mode
J-P Nurmi
solved the problem...thanks a lot guys...you have beena big help.
Bookmarks