From 96c711fed2463e49f3d7e92063a0b6b596910336 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 10 Sep 2013 18:06:25 +0200 Subject: QMessageBox: shortcuts for selectAll, copy don't conflict with buttons You can hit a key with no modifier to select a dialog button that has the corresponding mnemonic, but it doesn't make sense to do that if the Control or Meta key is being held. Now you can hit Ctrl-A, Ctrl-C to select all the message detail text and copy it to the clipboard, even if the dialog has buttons with mnemonics like &Continue and Save &Again. But as before, Alt-C, plain C, Alt-A and plain A select the mnemonic buttons on the dialog. Change-Id: I40c052dbb7730bde444ac2de405724a3203d1472 Reviewed-by: Marc Mutz --- src/widgets/dialogs/qmessagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index 995d279e13..87f2748c92 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -1428,7 +1428,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e) #endif // !QT_NO_CLIPBOARD && !QT_NO_SHORTCUT #ifndef QT_NO_SHORTCUT - if (!(e->modifiers() & Qt::AltModifier)) { + if (!(e->modifiers() & (Qt::AltModifier | Qt::ControlModifier | Qt::MetaModifier))) { int key = e->key() & ~Qt::MODIFIER_MASK; if (key) { const QList buttons = d->buttonBox->buttons(); -- cgit v1.2.3