aboutsummaryrefslogtreecommitdiffstats
path: root/desktop-widgets/usermanual.cpp
diff options
context:
space:
mode:
authorGravatar Rolf Eike Beer <eike@sf-mail.de>2019-04-03 19:44:53 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-04-12 12:59:17 +0300
commitd19cfec457da8c286a321dd17297237ad8fa8435 (patch)
tree696ab4b98579c7efe1009c5c9a1e8747d271119e /desktop-widgets/usermanual.cpp
parent2e59196e6b8d1f5461cddfc119d37c40e0027776 (diff)
downloadsubsurface-d19cfec457da8c286a321dd17297237ad8fa8435.tar.gz
tell QObject to give the desired children right away
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
Diffstat (limited to 'desktop-widgets/usermanual.cpp')
-rw-r--r--desktop-widgets/usermanual.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/desktop-widgets/usermanual.cpp b/desktop-widgets/usermanual.cpp
index f0a91c175..66262e2ac 100644
--- a/desktop-widgets/usermanual.cpp
+++ b/desktop-widgets/usermanual.cpp
@@ -129,18 +129,13 @@ void UserManual::linkClickedSlot(const QUrl& url)
#ifdef Q_OS_MAC
void UserManual::showEvent(QShowEvent *e) {
- filterAction = NULL;
- closeAction = NULL;
MainWindow *m = MainWindow::instance();
- Q_FOREACH (QObject *o, m->children()) {
- if (o->objectName() == "actionFilterTags") {
- filterAction = qobject_cast<QAction*>(o);
- filterAction->setShortcut(QKeySequence());
- } else if (o->objectName() == "actionClose") {
- closeAction = qobject_cast<QAction*>(o);
- closeAction->setShortcut(QKeySequence());
- }
- }
+ filterAction = m->findChild<QAction *>(QLatin1String("actionFilterTags"), Qt::FindDirectChildrenOnly);
+ if (filterAction != nullptr)
+ filterAction->setShortcut(QKeySequence());
+ closeAction = m->findChild<QAction *>(QLatin1String("actionClose"), Qt::FindDirectChildrenOnly);
+ if (closeAction != nullptr)
+ closeAction->setShortcut(QKeySequence());
}
void UserManual::hideEvent(QHideEvent *e) {
if (closeAction != NULL)