Skip to content

Commit

Permalink
Fix copy items from value map configuration
Browse files Browse the repository at this point in the history
QAbstractItemView internally uses the KeyPress signal, so in order to
make sure our code takes precedence we need to react to the same signal.
Apparently it's not enough to trust Qt that the KeyReleased is always
triggered after a KeyPress.

Fix #32256
  • Loading branch information
m-kuhn committed Oct 30, 2019
1 parent bcf2040 commit 9bf92ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gui/editorwidgets/qgsvaluemapconfigdlg.cpp
Expand Up @@ -202,12 +202,13 @@ void QgsValueMapConfigDlg::populateComboBox( QComboBox *comboBox, const QVariant
bool QgsValueMapConfigDlg::eventFilter( QObject *watched, QEvent *event )
{
Q_UNUSED( watched )
if ( event->type() == QEvent::KeyRelease )
if ( event->type() == QEvent::KeyPress )
{
QKeyEvent *keyEvent = static_cast<QKeyEvent *>( event );
if ( keyEvent->matches( QKeySequence::Copy ) )
{
copySelectionToClipboard();
event->accept();
return true;
}
}
Expand Down

0 comments on commit 9bf92ef

Please sign in to comment.