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:
@@ -96,14 +96,23 @@ QSize RiuMessagePanel::sizeHint() const
|
|||||||
//--------------------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------------------
|
||||||
void RiuMessagePanel::slotShowContextMenu(const QPoint& pos)
|
void RiuMessagePanel::slotShowContextMenu(const QPoint& pos)
|
||||||
{
|
{
|
||||||
QMenu* menu = m_textEdit->createStandardContextMenu();
|
QMenu menu;
|
||||||
|
|
||||||
menu->addSeparator();
|
// Reworked from implemenmtation in QTextControl::createStandardContextMenu()
|
||||||
menu->addAction("Clear All &Messages", this, SLOT(slotClearMessages()));
|
{
|
||||||
|
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));
|
menu.exec(m_textEdit->mapToGlobal(pos));
|
||||||
|
|
||||||
delete menu;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user