QWidgetTextControl: drop some actions when QT_NO_CLIPBOARD
Drop the Cut, Copy, and Copy Link Address actions from the context menu for QT_NO_CLIPBOARD builds. This mirrors what QWidgetLineControl already does. Change-Id: Icd6e92c044a11d336fb8d7fbf54b826712bd240e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
parent
3c7231a980
commit
a115fdbe02
@ -2158,11 +2158,14 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
|
|||||||
setActionIcon(a, QStringLiteral("edit-redo"));
|
setActionIcon(a, QStringLiteral("edit-redo"));
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
|
|
||||||
|
#ifndef QT_NO_CLIPBOARD
|
||||||
a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut()));
|
a = menu->addAction(tr("Cu&t") + ACCEL_KEY(QKeySequence::Cut), this, SLOT(cut()));
|
||||||
a->setEnabled(d->cursor.hasSelection());
|
a->setEnabled(d->cursor.hasSelection());
|
||||||
setActionIcon(a, QStringLiteral("edit-cut"));
|
setActionIcon(a, QStringLiteral("edit-cut"));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef QT_NO_CLIPBOARD
|
||||||
if (showTextSelectionActions) {
|
if (showTextSelectionActions) {
|
||||||
a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy()));
|
a = menu->addAction(tr("&Copy") + ACCEL_KEY(QKeySequence::Copy), this, SLOT(copy()));
|
||||||
a->setEnabled(d->cursor.hasSelection());
|
a->setEnabled(d->cursor.hasSelection());
|
||||||
@ -2175,9 +2178,10 @@ QMenu *QWidgetTextControl::createStandardContextMenu(const QPointF &pos, QWidget
|
|||||||
a = menu->addAction(tr("Copy &Link Location"), this, SLOT(_q_copyLink()));
|
a = menu->addAction(tr("Copy &Link Location"), this, SLOT(_q_copyLink()));
|
||||||
a->setEnabled(!d->linkToCopy.isEmpty());
|
a->setEnabled(!d->linkToCopy.isEmpty());
|
||||||
}
|
}
|
||||||
|
#endif // QT_NO_CLIPBOARD
|
||||||
|
|
||||||
if (d->interactionFlags & Qt::TextEditable) {
|
if (d->interactionFlags & Qt::TextEditable) {
|
||||||
#if !defined(QT_NO_CLIPBOARD)
|
#ifndef QT_NO_CLIPBOARD
|
||||||
a = menu->addAction(tr("&Paste") + ACCEL_KEY(QKeySequence::Paste), this, SLOT(paste()));
|
a = menu->addAction(tr("&Paste") + ACCEL_KEY(QKeySequence::Paste), this, SLOT(paste()));
|
||||||
a->setEnabled(canPaste());
|
a->setEnabled(canPaste());
|
||||||
setActionIcon(a, QStringLiteral("edit-paste"));
|
setActionIcon(a, QStringLiteral("edit-paste"));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user