Skip to content

Commit 8db10ef

Browse files
committed
Attempt to fix #17784, shortcuts in layouts are applied
in child widgets on OSX
1 parent 9a020ea commit 8db10ef

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/app/layout/qgslayoutdesignerdialog.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,14 @@ QgsLayoutDesignerDialog::QgsLayoutDesignerDialog( QWidget *parent, Qt::WindowFla
370370
QShortcut *backSpace = new QShortcut( QKeySequence( QStringLiteral( "Backspace" ) ), this );
371371
connect( backSpace, &QShortcut::activated, mActionDeleteSelection, &QAction::trigger );
372372

373+
#ifdef Q_OS_MAC
374+
// OSX has issues with QShortcut when certain children are focused
375+
ctrlEquals->setParent( mView );
376+
ctrlEquals->setContext( Qt::WidgetWithChildrenShortcut );
377+
backspace->setParent( mView );
378+
backspace->setContext( Qt::WidgetWithChildrenShortcut );
379+
#endif
380+
373381
mActionPreviewModeOff->setChecked( true );
374382
connect( mActionPreviewModeOff, &QAction::triggered, this, [ = ]
375383
{

0 commit comments

Comments
 (0)