mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1827 Manually produce context menu for message window in order to avoid Qt's default entries regarding input methods.
This commit is contained in:
parent
03aaa47a60
commit
8a35a53935
@ -96,14 +96,23 @@ QSize RiuMessagePanel::sizeHint() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RiuMessagePanel::slotShowContextMenu(const QPoint& pos)
|
||||
{
|
||||
QMenu* menu = m_textEdit->createStandardContextMenu();
|
||||
QMenu menu;
|
||||
|
||||
menu->addSeparator();
|
||||
menu->addAction("Clear All &Messages", this, SLOT(slotClearMessages()));
|
||||
// Reworked from implemenmtation in QTextControl::createStandardContextMenu()
|
||||
{
|
||||
QAction* a = menu.addAction("&Copy", m_textEdit, SLOT(copy()), QKeySequence::Copy);
|
||||
a->setEnabled(m_textEdit->textCursor().hasSelection());
|
||||
}
|
||||
{
|
||||
menu.addSeparator();
|
||||
QAction* a = menu.addAction("Select All", m_textEdit, SLOT(selectAll()), QKeySequence::SelectAll);
|
||||
a->setEnabled(!m_textEdit->document()->isEmpty());
|
||||
}
|
||||
|
||||
menu.addSeparator();
|
||||
menu.addAction("Clear All &Messages", this, SLOT(slotClearMessages()));
|
||||
|
||||
menu->exec(m_textEdit->mapToGlobal(pos));
|
||||
|
||||
delete menu;
|
||||
menu.exec(m_textEdit->mapToGlobal(pos));
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user