Skip to content

Commit 98f34a4

Browse files
committed
Enable or disable the paste action
Depending on the validity of the clipboard data enable/disable the paste context menu item
1 parent 4e86690 commit 98f34a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

OMEdit/OMEdit/OMEditGUI/Modeling/ModelWidgetContainer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2327,7 +2327,7 @@ void GraphicsView::modelicaGraphicsViewContextMenu(QMenu *pMenu)
23272327
if (!isVisualizationView()) {
23282328
pExportMenu->addAction(MainWindow::instance()->getExportToOMNotebookAction());
23292329
pMenu->addSeparator();
2330-
mpPasteAction->setEnabled(QApplication::clipboard()->mimeData()->hasFormat(Helper::cutCopyPasteFormat));
2330+
mpPasteAction->setEnabled(QApplication::clipboard()->mimeData()->hasFormat(Helper::cutCopyPasteFormat) && qobject_cast<const MimeData*>(QApplication::clipboard()->mimeData()));
23312331
pMenu->addAction(mpPasteAction);
23322332
}
23332333
pMenu->addSeparator();

0 commit comments

Comments
 (0)