summaryrefslogtreecommitdiff
path: root/demos
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2011-10-04 16:08:33 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-05 09:19:46 +0200
commit55cd3dcc503ad5ef8763c926a83b21d49e4f1c82 (patch)
treeb2a4424e209bb234159615da150136441ce9884e /demos
parent6f453dfcb1fd429fed4c9e48df58835a888a4e20 (diff)
downloadqtdoc-55cd3dcc503ad5ef8763c926a83b21d49e4f1c82.tar.gz
QtDemo: Compile.
Add warnings about no-longer-supported 'demos' category. Change-Id: Ic5447126ae8a0fa53240c5f8504ae87824a43ec8 Reviewed-on: http://codereview.qt-project.org/5993 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Diffstat (limited to 'demos')
-rw-r--r--demos/qtdemo/colors.cpp2
-rw-r--r--demos/qtdemo/demoitem.h4
-rw-r--r--demos/qtdemo/demoitemanimation.h2
-rw-r--r--demos/qtdemo/demoscene.h4
-rw-r--r--demos/qtdemo/mainwindow.h2
-rw-r--r--demos/qtdemo/menucontent.cpp10
-rw-r--r--demos/qtdemo/menumanager.cpp33
-rw-r--r--demos/qtdemo/menumanager.h4
-rw-r--r--demos/qtdemo/qtdemo.pro4
9 files changed, 36 insertions, 29 deletions
diff --git a/demos/qtdemo/colors.cpp b/demos/qtdemo/colors.cpp
index 0c309e53..a904f912 100644
--- a/demos/qtdemo/colors.cpp
+++ b/demos/qtdemo/colors.cpp
@@ -41,6 +41,8 @@
#include "colors.h"
+#include <QMessageBox>
+
#ifndef QT_NO_OPENGL
#include <QGLWidget>
#endif
diff --git a/demos/qtdemo/demoitem.h b/demos/qtdemo/demoitem.h
index 12a09d33..1b02ecad 100644
--- a/demos/qtdemo/demoitem.h
+++ b/demos/qtdemo/demoitem.h
@@ -42,7 +42,7 @@
#ifndef DEMO_ITEM_H
#define DEMO_ITEM_H
-#include <QtGui>
+#include <QtWidgets>
class DemoItemAnimation;
class Guide;
@@ -50,7 +50,7 @@ class Guide;
class SharedImage
{
public:
- SharedImage() : refCount(0), image(0), pixmap(0){};
+ SharedImage() : refCount(0), image(0), pixmap(0){}
~SharedImage()
{
delete image;
diff --git a/demos/qtdemo/demoitemanimation.h b/demos/qtdemo/demoitemanimation.h
index 4d704bb9..6f5be8a7 100644
--- a/demos/qtdemo/demoitemanimation.h
+++ b/demos/qtdemo/demoitemanimation.h
@@ -43,7 +43,7 @@
#define DEMO_ITEM_ANIMATION_H
#include <QtCore>
-#include <QtGui>
+#include <QtWidgets>
class DemoItem;
diff --git a/demos/qtdemo/demoscene.h b/demos/qtdemo/demoscene.h
index 39477800..d8daa3d4 100644
--- a/demos/qtdemo/demoscene.h
+++ b/demos/qtdemo/demoscene.h
@@ -42,12 +42,12 @@
#ifndef MAIN_VIEW_H
#define MAIN_VIEW_H
-#include <QtGui>
+#include <QtWidgets>
class DemoScene : public QGraphicsScene
{
public:
- DemoScene(QObject *parent) : QGraphicsScene(parent){};
+ DemoScene(QObject *parent) : QGraphicsScene(parent){}
protected:
void drawItems(QPainter *painter, int numItems, QGraphicsItem *items[], const QStyleOptionGraphicsItem options[], QWidget *widget);
diff --git a/demos/qtdemo/mainwindow.h b/demos/qtdemo/mainwindow.h
index c6378566..23cfe0b3 100644
--- a/demos/qtdemo/mainwindow.h
+++ b/demos/qtdemo/mainwindow.h
@@ -42,7 +42,7 @@
#ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H
-#include <QtGui>
+#include <QtWidgets>
#include <QPixmap>
class DemoTextItem;
diff --git a/demos/qtdemo/menucontent.cpp b/demos/qtdemo/menucontent.cpp
index 25eb99fa..115a4a2e 100644
--- a/demos/qtdemo/menucontent.cpp
+++ b/demos/qtdemo/menucontent.cpp
@@ -53,11 +53,11 @@ MenuContentItem::MenuContentItem(const QDomElement &el, QGraphicsScene *scene, Q
this->description1 = 0;
this->description2 = 0;
- if (el.tagName() == "demos")
- this->readmePath = QLibraryInfo::location(QLibraryInfo::DemosPath) + "/README";
- else
- this->readmePath = QLibraryInfo::location(QLibraryInfo::ExamplesPath) + "/" + el.attribute("dirname") + "/README";
-
+ if (el.tagName() == "demos") {
+ qWarning("MenuContentItem: category '%s' no longer supported.", qPrintable(el.tagName()));
+ // this->readmePath = QLibraryInfo::location(QLibraryInfo::DemosPath) + "/README";
+ }
+ this->readmePath = QLibraryInfo::location(QLibraryInfo::ExamplesPath) + "/" + el.attribute("dirname") + "/README";
}
void MenuContentItem::prepare()
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index 2ae27558..301c8f29 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -44,6 +44,11 @@
#include "menucontent.h"
#include "examplecontent.h"
+#ifndef QT_NO_DECLARATIVE
+#include <QtQuick1>
+#include <QDeclarativeEngine>
+#endif
+
MenuManager *MenuManager::pInstance = 0;
MenuManager * MenuManager::instance()
@@ -366,10 +371,11 @@ void MenuManager::launchQmlExample(const QString &name)
QString category = this->info[name]["category"];
QString fileName = this->info[name]["filename"];
QDir dir;
- if (category == "demos")
- dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
- else
- dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
+ if (category == "demos") {
+ qWarning("MenuContentItem: category '%s' no longer supported.", qPrintable(category));
+ // dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
+ }
+ dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml");
if(!file.exists()){
//try dirname.qml as well
@@ -493,11 +499,11 @@ QString MenuManager::resolveDataDir(const QString &name)
QString fileName = this->info[name]["filename"];
QDir dir;
- if (category == "demos")
- dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
- else
- dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
-
+ if (category == "demos") {
+ qWarning("MenuManager: category '%s' no longer supported.", qPrintable(category));
+ // dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
+ }
+ dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
dir.cd(dirName);
dir.cd(fileName);
return dir.absolutePath();
@@ -510,11 +516,12 @@ QString MenuManager::resolveExeFile(const QString &name)
QString fileName = this->info[name]["filename"];
QDir dir;
- if (category == "demos")
- dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
- else
- dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
+ if (category == "demos") {
+ qWarning("MenuManager: category '%s' no longer supported.", qPrintable(category));
+ // dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
+ }
+ dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
dir.cd(dirName);
dir.cd(fileName);
diff --git a/demos/qtdemo/menumanager.h b/demos/qtdemo/menumanager.h
index 64e8d384..1ca809e0 100644
--- a/demos/qtdemo/menumanager.h
+++ b/demos/qtdemo/menumanager.h
@@ -45,9 +45,6 @@
#include <QtGui>
#include <QtXml>
#include <QtHelp/QHelpEngineCore>
-#ifndef QT_NO_DECLARATIVE
-#include <QtDeclarative>
-#endif
#include "score.h"
#include "textbutton.h"
@@ -58,6 +55,7 @@ typedef QHash<QString, QString> StringHash;
typedef QHash<QString, StringHash> HashHash;
class TextButton;
+class QDeclarativeEngine;
class MenuManager : public QObject
{
diff --git a/demos/qtdemo/qtdemo.pro b/demos/qtdemo/qtdemo.pro
index 7cbe8ffb..1d04d928 100644
--- a/demos/qtdemo/qtdemo.pro
+++ b/demos/qtdemo/qtdemo.pro
@@ -6,7 +6,7 @@ DESTDIR = $$DEMO_DESTDIR/bin
INSTALLS += target sources
-QT += xml network
+QT += widgets xml network
contains(QT_CONFIG, opengl) {
DEFINES += QT_OPENGL_SUPPORT
@@ -14,7 +14,7 @@ contains(QT_CONFIG, opengl) {
}
contains(QT_CONFIG, declarative) {
- QT += declarative
+ QT += declarative qtquick1
} else {
DEFINES *= QT_NO_DECLARATIVE
}