Skip to content

Commit

Permalink
qtlite: Fix build the source code with -no-feature-shortcut
Browse files Browse the repository at this point in the history
Change-Id: If47149466a5da901e3eb6e6f2dcfb0a7816bc60b
Reviewed-by: Gatis Paeglis <[email protected]>
  • Loading branch information
msvetkin committed Feb 25, 2019
1 parent b56cfce commit 1be070a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,13 @@ QIconEngine * QXdgDesktopPortalTheme::createIconEngine(const QString &iconName)
return d->baseTheme->createIconEngine(iconName);
}

#if QT_CONFIG(shortcut)
QList<QKeySequence> QXdgDesktopPortalTheme::keyBindings(QKeySequence::StandardKey key) const
{
Q_D(const QXdgDesktopPortalTheme);
return d->baseTheme->keyBindings(key);
}
#endif

QString QXdgDesktopPortalTheme::standardButtonText(int button) const
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ class QXdgDesktopPortalTheme : public QPlatformTheme

QIconEngine *createIconEngine(const QString &iconName) const override;

#if QT_CONFIG(shortcut)
QList<QKeySequence> keyBindings(QKeySequence::StandardKey key) const override;
#endif

QString standardButtonText(int button) const override;

Expand Down
4 changes: 4 additions & 0 deletions src/testlib/qtestkeyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ namespace QTest
Q_DECL_UNUSED inline static void keyPress(QWindow *window, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Press, window, key, modifier, delay); }

#if QT_CONFIG(shortcut)
Q_DECL_UNUSED inline static void keySequence(QWindow *window, const QKeySequence &keySequence)
{
for (int i = 0; i < keySequence.count(); ++i) {
Expand All @@ -174,6 +175,7 @@ namespace QTest
keyClick(window, key, modifiers);
}
}
#endif

#ifdef QT_WIDGETS_LIB
static void simulateEvent(QWidget *widget, bool press, int code,
Expand Down Expand Up @@ -305,6 +307,7 @@ namespace QTest
inline static void keyClick(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay=-1)
{ keyEvent(Click, widget, key, modifier, delay); }

#if QT_CONFIG(shortcut)
inline static void keySequence(QWidget *widget, const QKeySequence &keySequence)
{
for (int i = 0; i < keySequence.count(); ++i) {
Expand All @@ -313,6 +316,7 @@ namespace QTest
keyClick(widget, key, modifiers);
}
}
#endif

#endif // QT_WIDGETS_LIB

Expand Down

0 comments on commit 1be070a

Please sign in to comment.