diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-09-17 14:19:45 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2014-09-29 11:02:41 +0300 |
commit | 2b52005041912e411dd8f1e1d1e0593bd393b518 (patch) | |
tree | 707f0da9feb7c7643dd6fca84e7e0c98a7905a20 /basicsuite/shared/engine.h | |
parent | 00e72c9170c34907ed74d567a21f4744e52d1a0f (diff) |
launchersettings: various improvements
- make it scale better on screen with different
screen sizes and pixel density. For example the
current implementation looked bad on Nexus 2013.
Lets use "scaled cm" based on visual angle. Tested
on 46 inch TV, nexus, nexus 2013, Rpi with samsung
desktop monitor, demo looks as expected.
- Demo now works as expeced when deployed as stand
alone application from QtCreator. Before this change
layout was completely broken, because Screen qml
element really does not work as expected.
- Make handle of Slider more touch-friendly.
- Simplify creation of wifi GroupBox. The Loader
element was needed at the beginning when we build
QtWifi only on Android.
- Move custom styles into separate qml files and
other cleanups.
Task-number: QTEE-769
Change-Id: Ifef1caa7edbfaea14c608f6b8fae43e86b0a2442
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
Diffstat (limited to 'basicsuite/shared/engine.h')
-rw-r--r-- | basicsuite/shared/engine.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/basicsuite/shared/engine.h b/basicsuite/shared/engine.h index 43713c8..8d083ef 100644 --- a/basicsuite/shared/engine.h +++ b/basicsuite/shared/engine.h @@ -23,11 +23,6 @@ #include <QString> #include <QUrl> -class QQmlEngine; -class QQuickItem; -class FpsCounter; -class QQuickWindow; - /*! A simplified version of the one used by b2qt-launcher */ @@ -42,11 +37,15 @@ public: Q_INVOKABLE int smallFontSize() const { return qMax<int>(m_dpcm * 0.4, 10); } Q_INVOKABLE int fontSize() const { return qMax<int>(m_dpcm * 0.6, 14); } Q_INVOKABLE int titleFontSize() const { return qMax<int>(m_dpcm * 0.9, 20); } - Q_INVOKABLE int centimeter() const { return m_dpcm; } + Q_INVOKABLE int centimeter(int val = 1) const { return (m_dpcm * val); } + Q_INVOKABLE int mm(int val) const { return (int)(m_dpcm * val * 0.1); } + Q_INVOKABLE int screenWidth() const { return m_screenWidth; } + Q_INVOKABLE int screenHeight() const { return m_screenHeight; } private: QSize m_screenSize; qreal m_dpcm; + int m_screenWidth, m_screenHeight; }; #endif // ENGINE_H |