diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2012-08-23 15:53:58 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-08-27 17:00:03 +0200 |
commit | e669f054069c3a1214a31c4c1d7d9269659c31c4 (patch) | |
tree | d611e865215dc8ee705a640fdf3e35660542632f /src/plugins/help/openpagesswitcher.cpp | |
parent | b674b59b3d652fa9c5d74dc4e16380e3a5d23882 (diff) | |
download | qt-creator-e669f054069c3a1214a31c4c1d7d9269659c31c4.tar.gz |
Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.
Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/help/openpagesswitcher.cpp')
-rw-r--r-- | src/plugins/help/openpagesswitcher.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/help/openpagesswitcher.cpp b/src/plugins/help/openpagesswitcher.cpp index c20f8e37cf..b0d4303104 100644 --- a/src/plugins/help/openpagesswitcher.cpp +++ b/src/plugins/help/openpagesswitcher.cpp @@ -34,6 +34,8 @@ #include "openpagesmodel.h" #include "openpageswidget.h" +#include <utils/hostosinfo.h> + #include <QEvent> #include <QKeyEvent> @@ -54,9 +56,8 @@ OpenPagesSwitcher::OpenPagesSwitcher(OpenPagesModel *model) // We disable the frame on this list view and use a QFrame around it instead. // This improves the look with QGTKStyle. -#ifndef Q_OS_MAC - setFrameStyle(m_openPagesWidget->frameStyle()); -#endif + if (!Utils::HostOsInfo::isMacHost()) + setFrameStyle(m_openPagesWidget->frameStyle()); m_openPagesWidget->setFrameStyle(QFrame::NoFrame); m_openPagesWidget->allowContextMenu(false); @@ -125,11 +126,8 @@ bool OpenPagesSwitcher::eventFilter(QObject *object, QEvent *event) emit setCurrentPage(m_openPagesWidget->currentIndex()); return true; } -#ifdef Q_OS_MAC - const Qt::KeyboardModifier modifier = Qt::AltModifier; -#else - const Qt::KeyboardModifier modifier = Qt::ControlModifier; -#endif + const Qt::KeyboardModifiers modifier = Utils::HostOsInfo::isMacHost() + ? Qt::AltModifier : Qt::ControlModifier; if (key == Qt::Key_Backtab && (ke->modifiers() == (modifier | Qt::ShiftModifier))) gotoNextPage(); |