OSDN Git Service

Disable everything QML-related but QMLJSEditor by default
authorDaniel Molkentin <daniel.molkentin@nokia.com>
Tue, 1 Jun 2010 10:51:18 +0000 (12:51 +0200)
committerDaniel Molkentin <daniel.molkentin@nokia.com>
Tue, 1 Jun 2010 12:28:09 +0000 (14:28 +0200)
To get QML functionality back, export QTCREATOR_WITH_QML before
running qmake

Reviewed-by: Kai Koehne
src/plugins/plugins.pro
src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp
src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.ui

index 156d5ce..c8bbb79 100644 (file)
@@ -35,21 +35,28 @@ SUBDIRS   = plugin_coreplugin \
             plugin_mercurial \
             debugger/dumper.pro
 
-contains(QT_CONFIG, declarative) {
-
-    SUBDIRS += plugin_qmlprojectmanager
-
-    include(private_headers.pri)
-    exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
-        SUBDIRS += plugin_qmldesigner \
-                   plugin_qmlinspector
-    } else {
-        warning()
-        warning("QmlDesigner and QmlInspector plugins have been disabled")
-        warning("The plugins depend on on private headers from QtDeclarative module.")
-        warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.")
-        warning()
-    }
+SUPPORT_QT_QML = $$(QTCREATOR_WITH_QML)
+
+!isEmpty(SUPPORT_QT_QML) {
+    message("Adding support for Qt/QML projects.")
+    DEFINES += QTCREATOR_WITH_QML
+
+    contains(QT_CONFIG, declarative) {
+
+        SUBDIRS += plugin_qmlprojectmanager
+
+        include(private_headers.pri)
+        exists($${QT_PRIVATE_HEADERS}/QtDeclarative/private/qdeclarativecontext_p.h) {
+            SUBDIRS += plugin_qmldesigner \
+                       plugin_qmlinspector
+        } else {
+            warning()
+            warning("QmlDesigner and QmlInspector plugins have been disabled")
+            warning("The plugins depend on on private headers from QtDeclarative module.")
+            warning("To enable them, pass 'QT_PRIVATE_HEADERS=$QTDIR/include' to qmake, where $QTDIR is the source directory of qt.")
+            warning()
+       }
+   }
 }
 
 plugin_coreplugin.subdir = coreplugin
index ff565a4..b08bb5b 100644 (file)
@@ -66,6 +66,11 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
     ui(new Ui::GettingStartedWelcomePageWidget)
 {
     ui->setupUi(this);
+
+#ifndef QTCREATOR_WITH_QML
+    ui->demosExamplesFrameQml->hide();
+#endif
+
     ui->didYouKnowTextBrowser->viewport()->setAutoFillBackground(false);
 
     connect(ui->tutorialTreeWidget, SIGNAL(activated(QString)), SLOT(slotOpenHelpPage(const QString&)));
@@ -78,8 +83,10 @@ GettingStartedWelcomePageWidget::GettingStartedWelcomePageWidget(QWidget *parent
                                         QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-writing-program.html?view=split"));
     ui->tutorialTreeWidget->addItem(tr("Creating a Mobile Application"),
                                         QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-mobile-example?view=split"));
+#ifdef QTCREATOR_WITH_QML
     ui->tutorialTreeWidget->addItem(tr("Creating a Qt Quick Application"),
                                         QLatin1String("qthelp://com.nokia.qtcreator/doc/creator-qml-application.html?view=split"));
+#endif
 
     srand(QDateTime::currentDateTime().toTime_t());
     QStringList tips = tipsOfTheDay();
index a46f113..10b5ba0 100644 (file)
        </widget>
       </item>
       <item row="1" column="1">
-       <widget class="QFrame" name="demosExamplesFrame_2">
+       <widget class="QFrame" name="demosExamplesFrameQml">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
           <horstretch>0</horstretch>
         </property>
         <layout class="QVBoxLayout" name="verticalLayout_3">
          <item>
-          <widget class="Utils::WelcomeModeLabel" name="demoTitleLabel_2">
+          <widget class="Utils::WelcomeModeLabel" name="demoTitleLabeldemosExamplesFrameQml">
            <property name="text">
             <string>Explore Qt Quick (Preview) Examples</string>
            </property>