diff options
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 |