forked from qt-creator/qt-creator
QtQuickApp wizard: Add Qt Components for Meego/Harmattan
Change-Id: I4809de36e4913037439ab9eb7c56021431cff365 Reviewed-on: http://codereview.qt.nokia.com/704 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Alessandro Portale <alessandro.portale@nokia.com>
This commit is contained in:
@@ -0,0 +1,23 @@
|
|||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
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()
|
void QmlApplicationViewer::showExpanded()
|
||||||
{
|
{
|
||||||
#ifdef Q_OS_SYMBIAN
|
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN)
|
||||||
showFullScreen();
|
showFullScreen();
|
||||||
#elif defined(Q_WS_MAEMO_5)
|
#elif defined(Q_WS_MAEMO_5)
|
||||||
showMaximized();
|
showMaximized();
|
||||||
|
|||||||
@@ -163,6 +163,7 @@ QSet<QString> Qt4DesktopTargetFactory::targetFeatures(const QString & /*id*/) co
|
|||||||
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
||||||
// how to check check whether they component set is really installed?
|
// how to check check whether they component set is really installed?
|
||||||
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
||||||
|
features << Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ QSet<QString> Qt4SimulatorTargetFactory::targetFeatures(const QString & /*id*/)
|
|||||||
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
features << Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
||||||
// how to check check whether the component set is really installed?
|
// how to check check whether the component set is really installed?
|
||||||
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
features << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
||||||
|
features << Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
|
||||||
return features;
|
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 SHADOWBUILD_TARGETFEATURE_ID = "Qt4ProjectManager.TargetFeature.ShadowBuild";
|
||||||
const char * const QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID
|
const char * const QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID
|
||||||
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsSymbian";
|
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsSymbian";
|
||||||
|
const char * const QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID
|
||||||
|
= "Qt4ProjectManager.TargetFeature.QtQuickComponentsMeego";
|
||||||
|
|
||||||
|
|
||||||
// Tool chains:
|
// Tool chains:
|
||||||
|
|||||||
@@ -349,7 +349,8 @@ Core::GeneratedFiles QtQuickApp::generateFiles(QString *errorMessage) const
|
|||||||
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
|
Core::GeneratedFiles files = AbstractMobileApp::generateFiles(errorMessage);
|
||||||
if (!useExistingMainQml()) {
|
if (!useExistingMainQml()) {
|
||||||
files.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainQmlFile, errorMessage), path(MainQml)));
|
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.append(file(generateFile(QtQuickAppGeneratedFileInfo::MainPageQmlFile, errorMessage), path(MainPageQml)));
|
||||||
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
files.last().setAttributes(Core::GeneratedFile::OpenEditorAttribute);
|
||||||
}
|
}
|
||||||
@@ -451,13 +452,15 @@ QString QtQuickApp::componentSetDir(ComponentSet componentSet) const
|
|||||||
switch (componentSet) {
|
switch (componentSet) {
|
||||||
case Symbian10Components:
|
case Symbian10Components:
|
||||||
return QLatin1String("symbian10");
|
return QLatin1String("symbian10");
|
||||||
|
case Meego10Components:
|
||||||
|
return QLatin1String("meego10");
|
||||||
case QtQuick10Components:
|
case QtQuick10Components:
|
||||||
default:
|
default:
|
||||||
return QLatin1String("qtquick10");
|
return QLatin1String("qtquick10");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const int QtQuickApp::StubVersion = 12;
|
const int QtQuickApp::StubVersion = 13;
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace Qt4ProjectManager
|
} // namespace Qt4ProjectManager
|
||||||
|
|||||||
@@ -117,7 +117,8 @@ public:
|
|||||||
|
|
||||||
enum ComponentSet {
|
enum ComponentSet {
|
||||||
QtQuick10Components,
|
QtQuick10Components,
|
||||||
Symbian10Components
|
Symbian10Components,
|
||||||
|
Meego10Components
|
||||||
};
|
};
|
||||||
|
|
||||||
QtQuickApp();
|
QtQuickApp();
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ bool QtQuickAppWizardDialog::validateCurrentPage()
|
|||||||
QSet<QString> requiredFeatures;
|
QSet<QString> requiredFeatures;
|
||||||
requiredFeatures << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
requiredFeatures << Constants::QTQUICKCOMPONENTS_SYMBIAN_TARGETFEATURE_ID;
|
||||||
targetsPage()->setRequiredFeatures(requiredFeatures);
|
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();
|
return AbstractMobileAppWizardDialog::validateCurrentPage();
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ QtQuickComponentSetOptionsPage::QtQuickComponentSetOptionsPage(QWidget *parent)
|
|||||||
m_d->ui.setupUi(this);
|
m_d->ui.setupUi(this);
|
||||||
m_d->ui.buttonGroup->setId(m_d->ui.qtquick10RadioButton, 0);
|
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.symbian10RadioButton, 1);
|
||||||
|
m_d->ui.buttonGroup->setId(m_d->ui.meego10RadioButton, 2);
|
||||||
connect(m_d->ui.buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(radioButtonChecked(int)));
|
connect(m_d->ui.buttonGroup, SIGNAL(buttonClicked(int)), this, SLOT(radioButtonChecked(int)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ QtQuickComponentSetOptionsPage::~QtQuickComponentSetOptionsPage()
|
|||||||
QtQuickApp::ComponentSet QtQuickComponentSetOptionsPage::componentSet() const
|
QtQuickApp::ComponentSet QtQuickComponentSetOptionsPage::componentSet() const
|
||||||
{
|
{
|
||||||
switch (m_d->ui.buttonGroup->checkedId()) {
|
switch (m_d->ui.buttonGroup->checkedId()) {
|
||||||
|
case 2: return QtQuickApp::Meego10Components;
|
||||||
case 1: return QtQuickApp::Symbian10Components;
|
case 1: return QtQuickApp::Symbian10Components;
|
||||||
case 0:
|
case 0:
|
||||||
default: return QtQuickApp::QtQuick10Components;
|
default: return QtQuickApp::QtQuick10Components;
|
||||||
@@ -84,6 +86,7 @@ QtQuickApp::ComponentSet QtQuickComponentSetOptionsPage::componentSet() const
|
|||||||
void QtQuickComponentSetOptionsPage::setComponentSet(QtQuickApp::ComponentSet componentSet)
|
void QtQuickComponentSetOptionsPage::setComponentSet(QtQuickApp::ComponentSet componentSet)
|
||||||
{
|
{
|
||||||
switch (componentSet) {
|
switch (componentSet) {
|
||||||
|
case QtQuickApp::Meego10Components: m_d->ui.meego10RadioButton->click(); break;
|
||||||
case QtQuickApp::Symbian10Components: m_d->ui.symbian10RadioButton->click(); break;
|
case QtQuickApp::Symbian10Components: m_d->ui.symbian10RadioButton->click(); break;
|
||||||
case QtQuickApp::QtQuick10Components:
|
case QtQuickApp::QtQuick10Components:
|
||||||
default: m_d->ui.qtquick10RadioButton->click(); break;
|
default: m_d->ui.qtquick10RadioButton->click(); break;
|
||||||
|
|||||||
@@ -52,6 +52,16 @@
|
|||||||
</attribute>
|
</attribute>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</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>
|
<item>
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
@@ -71,7 +81,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QStackedWidget" name="descriptionStackedWidget">
|
<widget class="QStackedWidget" name="descriptionStackedWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="qtquick10DescriptionWidget">
|
<widget class="QWidget" name="qtquick10DescriptionWidget">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
@@ -99,7 +109,26 @@ Requires Qt 4.7.1 or newer.</string>
|
|||||||
<property name="text">
|
<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.
|
<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>
|
||||||
<property name="alignment">
|
<property name="alignment">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
|||||||
@@ -165,7 +165,8 @@ QSet<QString> Qt4MaemoTargetFactory::targetFeatures(const QString & /*id*/) cons
|
|||||||
#ifndef Q_OS_WIN
|
#ifndef Q_OS_WIN
|
||||||
features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
features << Qt4ProjectManager::Constants::SHADOWBUILD_TARGETFEATURE_ID;
|
||||||
#endif
|
#endif
|
||||||
|
// how to check check whether the component set is really installed?
|
||||||
|
features << Qt4ProjectManager::Constants::QTQUICKCOMPONENTS_MEEGO_TARGETFEATURE_ID;
|
||||||
return features;
|
return features;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user