summaryrefslogtreecommitdiffstats
path: root/basicsuite/shared
diff options
context:
space:
mode:
authoraavit <eirik.aavitsland@digia.com>2014-10-15 11:45:42 +0200
committeraavit <eirik.aavitsland@digia.com>2014-10-15 11:48:13 +0200
commit04374090fb5d5b5f57d7c15860635c4df27e26da (patch)
tree132fc7e8606ce33ec1ee422928d45919120859af /basicsuite/shared
parentdc12a6624b5f5a397e590d378bcf1f2a2f192e51 (diff)
parent11ea1829a7057531be95c188fee081a20a7e21c3 (diff)
Merge branch 'stable' into dev
Diffstat (limited to 'basicsuite/shared')
-rw-r--r--basicsuite/shared/SharedMain.qml7
-rw-r--r--basicsuite/shared/engine.cpp6
-rw-r--r--basicsuite/shared/engine.h15
-rw-r--r--basicsuite/shared/main.cpp4
-rw-r--r--basicsuite/shared/main_landscape.qml9
5 files changed, 20 insertions, 21 deletions
diff --git a/basicsuite/shared/SharedMain.qml b/basicsuite/shared/SharedMain.qml
index 98ca779..301ccb8 100644
--- a/basicsuite/shared/SharedMain.qml
+++ b/basicsuite/shared/SharedMain.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
+** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
@@ -12,11 +12,11 @@
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
+** contact form at http://www.qt.io
**
****************************************************************************/
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..09132c1 100644
--- a/basicsuite/shared/engine.cpp
+++ b/basicsuite/shared/engine.cpp
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
+** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
@@ -12,7 +12,7 @@
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
+** contact form at http://www.qt.io
**
****************************************************************************/
#include "engine.h"
@@ -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..1c637a7 100644
--- a/basicsuite/shared/engine.h
+++ b/basicsuite/shared/engine.h
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
+** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
@@ -12,7 +12,7 @@
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
+** contact form at http://www.qt.io
**
****************************************************************************/
#ifndef 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.cpp b/basicsuite/shared/main.cpp
index 00284b3..9ddb61b 100644
--- a/basicsuite/shared/main.cpp
+++ b/basicsuite/shared/main.cpp
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
+** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
@@ -12,7 +12,7 @@
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
+** contact form at http://www.qt.io
**
****************************************************************************/
#include <QtCore/QDebug>
diff --git a/basicsuite/shared/main_landscape.qml b/basicsuite/shared/main_landscape.qml
index 46b7fc5..e5bf510 100644
--- a/basicsuite/shared/main_landscape.qml
+++ b/basicsuite/shared/main_landscape.qml
@@ -2,7 +2,7 @@
**
** Copyright (C) 2014 Digia Plc
** All rights reserved.
-** For any questions to Digia, please use contact form at http://qt.digia.com
+** For any questions to Digia, please use contact form at http://www.qt.io
**
** This file is part of Qt Enterprise Embedded.
**
@@ -12,15 +12,14 @@
** a written agreement between you and Digia.
**
** If you have questions regarding the use of this file, please use
-** contact form at http://qt.digia.com
+** contact form at http://www.qt.io
**
****************************************************************************/
import QtQuick 2.0
Item {
- width: 800
- height: 1280
-
+ width: engine.screenWidth()
+ height: engine.screenHeight()
SharedMain {
anchors.centerIn: parent
width: parent.height