diff --git a/share/qtcreator/declarative b/share/qtcreator/declarative new file mode 120000 index 0000000000000000000000000000000000000000..286404c10df5a8162d433279066f46278e4057e4 --- /dev/null +++ b/share/qtcreator/declarative @@ -0,0 +1 @@ +examples/declarative/ \ No newline at end of file diff --git a/share/qtcreator/examples b/share/qtcreator/examples new file mode 120000 index 0000000000000000000000000000000000000000..d5679a7d341db90d9c9085300dfabe7d9bd0d748 --- /dev/null +++ b/share/qtcreator/examples @@ -0,0 +1 @@ +/home/danimo/dev/qt-4.7/examples/ \ No newline at end of file diff --git a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp index 58a25be523875582dc96e98b94bef1f9b2ae3c00..a8a74ddff981d2363ecd3646e8414c5e5cb1e96e 100644 --- a/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp +++ b/src/plugins/qt4projectmanager/gettingstartedwelcomepagewidget.cpp @@ -175,8 +175,6 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa const QString &sourcePath) { ui->qmlExamplesButton->setText(tr("Choose an example...")); - QMenu *menu = new QMenu(ui->qmlExamplesButton); - ui->qmlExamplesButton->setMenu(menu); QStringList roots; roots << (examplePath + QLatin1String("/declarative")) @@ -197,14 +195,20 @@ void GettingStartedWelcomePageWidget::updateQmlExamples(const QString &examplePa exampleProjects.insert(fileName, exampleProject); } } - QMapIterator<QString, QString> it(exampleProjects); - while (it.hasNext()) { - it.next(); - QAction *exampleAction = menu->addAction(it.key()); - connect(exampleAction, SIGNAL(triggered()), SLOT(slotOpenExample())); - exampleAction->setProperty(ExamplePathPropertyName, it.value()); - // FIXME once we have help for QML examples - // exampleAction->setProperty(HelpPathPropertyName, helpPath); + + if (!exampleProjects.isEmpty()) { + QMenu *menu = new QMenu(ui->qmlExamplesButton); + ui->qmlExamplesButton->setMenu(menu); + + QMapIterator<QString, QString> it(exampleProjects); + while (it.hasNext()) { + it.next(); + QAction *exampleAction = menu->addAction(it.key()); + connect(exampleAction, SIGNAL(triggered()), SLOT(slotOpenExample())); + exampleAction->setProperty(ExamplePathPropertyName, it.value()); + // FIXME once we have help for QML examples + // exampleAction->setProperty(HelpPathPropertyName, helpPath); + } } ui->qmlExamplesButton->setEnabled(!exampleProjects.isEmpty());