Skip to content
Snippets Groups Projects
Commit 5c9b8946 authored by Kai Koehne's avatar Kai Koehne
Browse files

QtQuickApp wizard: Add Qt Components for Meego/Harmattan

Change-Id: I4809de36e4913037439ab9eb7c56021431cff365
Reviewed-on: http://codereview.qt.nokia.com/704


Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarAlessandro Portale <alessandro.portale@nokia.com>
parent f7286529
No related branches found
No related tags found
No related merge requests found
Showing
with 106 additions and 7 deletions
import QtQuick 1.1
import com.meego 1.0
Page {
tools: commonTools
Label {
id: label
anchors.centerIn: parent
text: qsTr("Hello world!")
visible: false
}
Button{
anchors {
horizontalCenter: parent.horizontalCenter
top: label.bottom
topMargin: 10
}
text: qsTr("Click here!")
onClicked: label.visible = true
}
}
import QtQuick 1.1
import com.meego 1.0
PageStackWindow {
id: appWindow
initialPage: mainPage
MainPage {
id: mainPage
}
ToolBarLayout {
id: commonTools
visible: true
ToolIcon {
platformIconId: "toolbar-view-menu"
anchors.right: (parent === undefined) ? undefined : parent.right
onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
}
}
Menu {
id: myMenu
visualParent: pageStack
MenuLayout {
MenuItem { text: qsTr("Sample menu item") }
}
}
}
......@@ -146,7 +146,7 @@ void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
void QmlApplicationViewer::showExpanded()
{
#ifdef Q_OS_SYMBIAN
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN)
showFullScreen();
#elif defined(Q_WS_MAEMO_5)
showMaximized();
......
......@@ -163,6 +163,7 @@ QSet<QString> Qt4DesktopTargetFactory::targetFeatures(const QString & /*id*/) co
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
// how to check check whether they component set is really installed?
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
features << Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
return features;
}
......
......@@ -131,6 +131,7 @@ QSet<QString> Qt4SimulatorTargetFactory::targetFeatures(const QString & /*id*/)
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
// how to check check whether the component set is really installed?
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
features << Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
return features;
}
......
......@@ -98,6 +98,8 @@ const char * const DESKTOP_TARGETFEATURE_ID = "Qt4ProjectManager.TargetFeature.D
const char * const SHADOWBUILD_TARGETFEATURE_ID = "Qt4ProjectManager.TargetFeature.ShadowBuild";
const char * const QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsSymbian";
const char * const QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsMeego";
// Tool chains:
......
......@@ -349,7 +349,8 @@ Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
if (!useExistingMainQml()) {
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)));
if (componentSet() == QtQuickApp::Symbian10Components)
if ((componentSet() == QtQuickApp::Symbian10Components)
|| (componentSet() == QtQuickApp::Meego10Components))
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainPageQmlFile, errorMessage), path(MainPageQml)));
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
}
......@@ -451,13 +452,15 @@ QString QtQuickApp::componentSetDir(ComponentSet componentSet) const
switch (componentSet) {
case Symbian10Components:
return QLatin1String("symbian10");
case Meego10Components:
return QLatin1String("meego10");
case QtQuick10Components:
default:
return QLatin1String("qtquick10");
}
}
const int QtQuickApp::StubVersion = 12;
const int QtQuickApp::StubVersion = 13;
} // namespace Internal
} // namespace Qt4ProjectManager
......@@ -117,7 +117,8 @@ public:
enum ComponentSet {
QtQuick10Components,
Symbian10Components
Symbian10Components,
Meego10Components
};
QtQuickApp();
......
......@@ -95,6 +95,11 @@ bool QtQuickAppWizardDialog::validateCurrentPage()
QSet<QString> requiredFeatures;
requiredFeatures << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
targetsPage()->setRequiredFeatures(requiredFeatures);
} else if (m_componentOptionsPage->componentSet() == QtQuickApp::Meego10Components) {
targetsPage()->setMinimumQtVersion(QtSupport::QtVersionNumber(4, 7, 4));
QSet<QString> requiredFeatures;
requiredFeatures << Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
targetsPage()->setRequiredFeatures(requiredFeatures);
}
}
return AbstractMobileAppWizardDialog::validateCurrentPage();
......
......@@ -64,6 +64,7 @@ QtQuickComponentSetOptionsPage::QtQuickComponentSetOptionsPage(QWidget *parent)
m_d->ui.setupUi(this);
m_d->ui.buttonGroup->setId(m_d->ui.qtquick10RadioButton, 0);
m_d->ui.buttonGroup->setId(m_d->ui.symbian10RadioButton, 1);
m_d->ui.buttonGroup->setId(m_d->ui.meego10RadioButton, 2);
connect(m_d->ui.buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(radioButtonChecked(int)));
}
......@@ -75,6 +76,7 @@ QtQuickComponentSetOptionsPage::~QtQuickComponentSetOptionsPage()
QtQuickApp::ComponentSet QtQuickComponentSetOptionsPage::componentSet() const
{
switch (m_d->ui.buttonGroup->checkedId()) {
case 2: return QtQuickApp::Meego10Components;
case 1: return QtQuickApp::Symbian10Components;
case 0:
default: return QtQuickApp::QtQuick10Components;
......@@ -84,6 +86,7 @@ QtQuickApp::ComponentSet QtQuickComponentSetOptionsPage::componentSet() const
void QtQuickComponentSetOptionsPage::setComponentSet(QtQuickApp::ComponentSet componentSet)
{
switch (componentSet) {
case QtQuickApp::Meego10Components: m_d->ui.meego10RadioButton->click(); break;
case QtQuickApp::Symbian10Components: m_d->ui.symbian10RadioButton->click(); break;
case QtQuickApp::QtQuick10Components:
default: m_d->ui.qtquick10RadioButton->click(); break;
......
......@@ -52,6 +52,16 @@
</attribute>
</widget>
</item>
<item>
<widget class="QRadioButton" name="meego10RadioButton">
<property name="text">
<string>Qt Quick Components for Meego/Harmattan</string>
</property>
<attribute name="buttonGroup">
<string>buttonGroup</string>
</attribute>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
......@@ -71,7 +81,7 @@
<item>
<widget class="QStackedWidget" name="descriptionStackedWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="qtquick10DescriptionWidget">
<layout class="QGridLayout" name="gridLayout">
......@@ -99,7 +109,26 @@ Requires Qt 4.7.1 or newer.</string>
<property name="text">
<string>The Qt Quick Components for Symbian are a set of ready-made components that are designed with specific native appearance for the Symbian platform.
Requires Qt 4.7.3 or newer, and the component set installed for your Qt version / Symbian device.</string>
Requires Qt 4.7.3 or newer, and the component set installed for your Qt version.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="meego10DescriptionWidget">
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="meego1DescriptionLabel">
<property name="text">
<string>The Qt Quick Components for Meego/Harmattan are a set of ready-made components that are designed with specific native appearance for the Meego/Harmattan platform.
Requires Qt 4.7.4 or newer, and the component set installed for your Qt version.</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
......
......@@ -165,7 +165,8 @@ QSet<QString> Qt4MaemoTargetFactory::targetFeatures(const QString & /*id*/) cons
#ifndef Q_OS_WIN
features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID;
#endif
// how to check check whether the component set is really installed?
features << Qt4ProjectManager::Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
return features;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment