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 | |
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')
-rw-r--r-- | basicsuite/shared/SharedMain.qml | 3 | ||||
-rw-r--r-- | basicsuite/shared/engine.cpp | 2 | ||||
-rw-r--r-- | basicsuite/shared/engine.h | 11 | ||||
-rw-r--r-- | basicsuite/shared/main_landscape.qml | 5 |
4 files changed, 10 insertions, 11 deletions
diff --git a/basicsuite/shared/SharedMain.qml b/basicsuite/shared/SharedMain.qml index 98ca779..0a7ba0c 100644 --- a/basicsuite/shared/SharedMain.qml +++ b/basicsuite/shared/SharedMain.qml @@ -16,7 +16,7 @@ ** ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Enterprise.VirtualKeyboard 1.1 +import QtQuick.Enterprise.VirtualKeyboard 1.2 Item { id: root @@ -26,7 +26,6 @@ Item { anchors.top: parent.top anchors.right: parent.right anchors.bottom: inputPanel.top - source: "main.qml" } diff --git a/basicsuite/shared/engine.cpp b/basicsuite/shared/engine.cpp index da021e5..2b39efd 100644 --- a/basicsuite/shared/engine.cpp +++ b/basicsuite/shared/engine.cpp @@ -32,4 +32,6 @@ DummyEngine::DummyEngine(QObject *parent) float high = 20; float screenSizeCM = qMax<float>(qMin(m_screenSize.width(), m_screenSize.height()) / m_dpcm, low); m_dpcm *= (screenSizeCM - low) / (high - low) * 0.5 + 0.5; + m_screenWidth = m_screenSize.width(); + m_screenHeight = m_screenSize.height(); } 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 diff --git a/basicsuite/shared/main_landscape.qml b/basicsuite/shared/main_landscape.qml index 46b7fc5..233ef77 100644 --- a/basicsuite/shared/main_landscape.qml +++ b/basicsuite/shared/main_landscape.qml @@ -18,9 +18,8 @@ import QtQuick 2.0 Item { - width: 800 - height: 1280 - + width: engine.screenWidth() + height: engine.screenHeight() SharedMain { anchors.centerIn: parent width: parent.height |