QT += qml quick
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/calqlatr
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/calqlatr
qml.files = calqlatr.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/calqlatr
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/calqlatr
INSTALLS += target qml
QT += qml quick
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/maroon
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/maroon
qml.files = maroon.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/maroon
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/maroon
INSTALLS += target qml
QT += qml quick
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/samegame
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/samegame
qml.files = samegame.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/samegame
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/samegame
INSTALLS += target qml
request += "s=" + stockId;
request += "&a=" + startDate.getDate();
request += "&b=" + startDate.getMonth();
- request += "&c=" + startDate.getYear();
+ request += "&c=" + startDate.getFullYear();
request += "&d=" + endDate.getDate();
request += "&e=" + endDate.getMonth();
- request += "&f=" + endDate.getYear();
+ request += "&f=" + endDate.getFullYear();
request += "&g=" + stockDataCycle;
request += "&ignore=.csv";
return request;
QT += qml quick
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/stocqt
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/stocqt
qml.files = stocqt.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/stocqt
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/stocqt
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/tweetsearch
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/tweetsearch
qml.files = tweetsearch.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/demos/tweetsearch
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/demos/tweetsearch
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/localstorage
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/localstorage
qml.files = localstorage.qml hello.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/localstorage
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/localstorage
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/affectors
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/affectors
qml.files = affectors.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/affectors
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/affectors
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/customparticle
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/customparticle
qml.files = customparticle.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/customparticle
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/customparticle
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/emitters
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/emitters
qml.files = emitters.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/emitters
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/emitters
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/imageparticle
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/imageparticle
qml.files = imageparticle.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/imageparticle
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/imageparticle
INSTALLS += target qml
#Install shared images too
qml.files = images
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles
INSTALLS = qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/system
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/system
qml.files = system.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/particles/system
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/particles/system
INSTALLS += target qml
OTHER_FILES += imageprovider.json
sources.files = $$SOURCES imageprovider.qml imageprovider.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/imageprovider
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/imageprovider
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/imageprovider/ImageProviderCore
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/imageprovider/ImageProviderCore
ImageProviderCore_sources.files = \
ImageProviderCore/qmldir
-ImageProviderCore_sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/imageprovider/ImageProviderCore
+ImageProviderCore_sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/imageprovider/ImageProviderCore
INSTALLS = sources ImageProviderCore_sources target
imports/TimeExample/hour.png \
imports/TimeExample/minute.png
-qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample
+qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/plugins/imports/TimeExample
sources.files += plugins.pro plugin.cpp plugins.qml
-sources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins
-target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/plugins/imports/TimeExample
+sources.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/plugins
+target.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/plugins/imports/TimeExample
INSTALLS += qdeclarativesources sources target
HEADERS += person.h
RESOURCES += adding.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/adding
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/adding
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS adding.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/adding
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/adding
INSTALLS += target sources
birthdayparty.h
RESOURCES += attached.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/attached
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/attached
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS attached.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/attached
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/attached
INSTALLS += target sources
happybirthdaysong.h
RESOURCES += binding.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/binding
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/binding
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS binding.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/binding
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/binding
INSTALLS += target sources
birthdayparty.h
RESOURCES += coercion.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/coercion
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/coercion
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS coercion.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/coercion
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/coercion
INSTALLS += target sources
birthdayparty.h
RESOURCES += default.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/default
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/default
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS default.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/default
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/default
INSTALLS += target sources
HEADERS += lineedit.h
RESOURCES += extended.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/extended
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/extended
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS extended.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/extended
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/extended
INSTALLS += target sources
birthdayparty.h
RESOURCES += grouped.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/grouped
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/grouped
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS grouped.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/grouped
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/grouped
INSTALLS += target sources
birthdayparty.h
RESOURCES += methods.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/methods
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/methods
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS methods.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/methods
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/methods
INSTALLS += target sources
birthdayparty.h
RESOURCES += properties.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/properties
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/properties
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS properties.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/properties
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/properties
INSTALLS += target sources
birthdayparty.h
RESOURCES += signal.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/signal
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/signal
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS signal.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/signal
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/signal
INSTALLS += target sources
happybirthdaysong.h
RESOURCES += valuesource.qrc
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/valuesource
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/valuesource
sources.files = $$SOURCES $$HEADERS $$RESOURCES $$FORMS valuesource.pro
-sources.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/extending/valuesource
+sources.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/extending/valuesource
INSTALLS += target sources
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/xmlhttprequest
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/xmlhttprequest
qml.files = xmlhttprequest.qml get.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/xmlhttprequest
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/qml/xmlhttprequest
INSTALLS += target qml
TARGET=tst_qmltestexample
CONFIG += qmltestcase
SOURCES += tst_qmltest.cpp
+
+# Don't install by default
+CONFIG += no_testcase_installs
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/accessibility
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/accessibility
qml.files = accessibility.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/accessibility
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/accessibility
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/animation
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/animation
qml.files = animation.qml basics behaviors easing pathanimation pathinterpolator states
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/animation
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/animation
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/canvas
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/canvas
qml.files = canvas.qml bezierCurve clip quadraticCurveTo roundedrect smile squircle tiger contents
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/canvas
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/canvas
INSTALLS += target qml
\ No newline at end of file
SOURCES += main.cpp \
maskedmousearea.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/maskedmousearea
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/maskedmousearea
qml.files = maskedmousearea.qml images
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/maskedmousearea
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/maskedmousearea
INSTALLS += target qml
qdeclarativesources.files += \
TextBalloonPlugin/qmldir
-qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/painteditem/TextBalloonPlugin
+qdeclarativesources.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/painteditem/TextBalloonPlugin
sources.files = textballoons.qml
-sources.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/painteditem
-target.path += $$[QT_INSTALL_EXAMPLES]/qtdeclarative/qml/painteditem/TextBalloonPlugin
+sources.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/painteditem
+target.path += $$[QT_INSTALL_EXAMPLES]/qtquick/qml/painteditem/TextBalloonPlugin
INSTALLS = qdeclarativesources sources target
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/draganddrop
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/draganddrop
qml.files = draganddrop.qml tiles views
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/draganddrop
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/draganddrop
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/imageelements
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/imageelements
qml.files = *.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/imageelements
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/imageelements
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/keyinteraction
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/keyinteraction
qml.files = keyinteraction.qml focus
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/keyinteraction
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/keyinteraction
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/modelviews
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/modelviews
qml.files = \
modelviews.qml \
gridview \
pathview \
visualdatamodel \
visualitemmodel
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/modelviews
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/modelviews
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/mousearea
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/mousearea
qml.files = mousearea.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/mousearea
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/mousearea
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/positioners
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/positioners
qml.files = positioners.qml positioners-transitions.qml positioners-attachedproperties.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/positioners
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/positioners
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/righttoleft
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/righttoleft
qml.files = righttoleft.qml layoutdirection layoutmirroring textalignment
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/righttoleft
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/righttoleft
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/shadereffects
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/shadereffects
qml.files = shadereffects.qml content
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/shadereffects
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/shadereffects
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/text
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/text
qml.files = fonts imgtag styledtext-layout.qml text.qml textselection
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/text
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/text
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/threading
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/threading
qml.files = threading.qml threadedlistmodel workerscript
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/threading
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/threading
INSTALLS += target qml
QT += quick qml
SOURCES += main.cpp
-target.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/touchinteraction
+target.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/touchinteraction
qml.files = flickable multipointtouch pincharea touchinteraction.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/quick/touchinteraction
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/quick/touchinteraction
INSTALLS += target qml
qPrintable(QDir::toNativeSeparators(directory.absolutePath())));\
return -1;\
}\
- } else if (QGuiApplication::platformName() == QLatin1String("Cocoa")) {\
+ } else if (QGuiApplication::platformName() == QLatin1String("cocoa")) {\
if (directory.absolutePath().endsWith(#NAME".app/Contents/MacOS"))\
for (int i = 0; i < 3; ++i) {\
if (!directory.cdUp()) {\
LauncherList.qml \
SimpleLauncherDelegate.qml \
Button.qml
-qml.path = $$[QT_INSTALL_EXAMPLES]/qtdeclarative/shared
+qml.path = $$[QT_INSTALL_EXAMPLES]/qtquick/shared
INSTALLS = qml
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
- public:
- //registerTypes is inherited from QQmlExtensionPlugin
- void registerTypes(const char *uri);
-
+public:
+ // registerTypes is inherited from QQmlExtensionPlugin
+ void registerTypes(const char *uri);
};
#endif
*/
Directory::Directory(QObject *parent) : QObject(parent)
{
- m_dir.cd( QDir::currentPath() );
+ m_dir.cd(QDir::currentPath());
- //go to the saved directory. if not found, create save directory
+ // go to the saved directory. if not found, create save directory
m_saveDir = "saves";
- if ( m_dir.cd(m_saveDir) == 0 ) {
+ if (m_dir.cd(m_saveDir) == 0) {
m_dir.mkdir(m_saveDir);
m_dir.cd(m_saveDir);
}
/*
Function called to append data onto list property
*/
-void appendFiles(QQmlListProperty<File> * property, File * file)
+void appendFiles(QQmlListProperty<File> *property, File *file)
{
Q_UNUSED(property);
Q_UNUSED(file);
/*
Function called to retrieve file in the list using an index
*/
-File* fileAt(QQmlListProperty<File> * property, int index)
+File *fileAt(QQmlListProperty<File> *property, int index)
{
return static_cast< QList<File *> *>(property->data)->at(index);
}
/*
Returns the number of files in the list
*/
-int filesSize(QQmlListProperty<File> * property)
+int filesSize(QQmlListProperty<File> *property)
{
return static_cast< QList<File *> *>(property->data)->size();
}
QQmlListProperty<File> Directory::files()
{
refresh();
- return QQmlListProperty<File>( this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr );
+ return QQmlListProperty<File>(this, &m_fileList, &appendFiles, &filesSize, &fileAt, &clearFilesPtr);
}
/*
*/
void Directory::setFilename(const QString &str)
{
- if( str != currentFile.name() ) {
+ if (str != currentFile.name()) {
currentFile.setName(str);
emit filenameChanged();
}
*/
void Directory::setFileContent(const QString &str)
{
- if(str != m_fileContent){
+ if (str != m_fileContent) {
m_fileContent = str;
emit fileContentChanged();
}
*/
void Directory::saveFile()
{
- if(currentFile.name().size() == 0){
+ if (currentFile.name().isEmpty()) {
qWarning()<< "Empty filename. no save";
return;
}
QString extendedName = currentFile.name();
- if(!currentFile.name().endsWith(".txt")){
+ if (!currentFile.name().endsWith(".txt")) {
extendedName.append(".txt");
}
- QFile file( m_dir.filePath(extendedName) );
- if ( file.open(QFile::WriteOnly | QFile::Truncate) ) {
+ QFile file(m_dir.filePath(extendedName));
+ if (file.open(QFile::WriteOnly | QFile::Truncate)) {
QTextStream outStream(&file);
outStream << m_fileContent;
}
{
m_fileContent.clear();
QString extendedName = currentFile.name();
- if( !currentFile.name().endsWith(".txt") ) {
+ if (!currentFile.name().endsWith(".txt")) {
extendedName.append(".txt");
}
- QFile file( m_dir.filePath(extendedName) );
- if ( file.open(QFile::ReadOnly ) ) {
+ QFile file(m_dir.filePath(extendedName));
+ if (file.open(QFile::ReadOnly)) {
QTextStream inStream(&file);
-
- QString line;
- do {
- line = inStream.read(75);
- m_fileContent.append(line);
- } while ( !line.isNull() ) ;
+ m_fileContent = inStream.readAll();
}
file.close();
}
m_dirFiles = m_dir.entryList(m_filterList,QDir::Files,QDir::Name);
m_fileList.clear();
- File * file;
- for(int i = 0; i < m_dirFiles.size() ; i ++) {
+ File *file;
+ for (int i = 0; i < m_dirFiles.size(); ++i) {
file = new File();
- if( m_dirFiles.at(i).endsWith(".txt") ) {
+ if (m_dirFiles.at(i).endsWith(".txt")) {
QString name = m_dirFiles.at(i);
- file->setName( name.remove(".txt",Qt::CaseSensitive) );
- }
- else {
+ file->setName(name.remove(".txt",Qt::CaseSensitive));
+ } else {
file->setName(m_dirFiles.at(i));
}
m_fileList.append(file);
#include "file.h"
#include <QDir>
+#include <QObject>
+#include <QQmlListProperty>
#include <QStringList>
#include <QTextStream>
-#include <QQmlListProperty>
-#include <QObject>
-
-class Directory : public QObject {
+class Directory : public QObject
+{
Q_OBJECT
- //number of files in the directory
+ // number of files in the directory
Q_PROPERTY(int filesCount READ filesCount)
- //list property containing file names as QString
- Q_PROPERTY(QQmlListProperty<File> files READ files CONSTANT )
+ // list property containing file names as QString
+ Q_PROPERTY(QQmlListProperty<File> files READ files CONSTANT)
- //file name of the text file to read/write
+ // file name of the text file to read/write
Q_PROPERTY(QString filename READ filename WRITE setFilename NOTIFY filenameChanged)
- //text content of the file
+ // text content of the file
Q_PROPERTY(QString fileContent READ fileContent WRITE setFileContent NOTIFY fileContentChanged)
- public:
- Directory(QObject *parent = 0);
+public:
+ Directory(QObject *parent = 0);
- //properties' read functions
- int filesCount() const;
- QString filename() const;
- QString fileContent() const;
- QQmlListProperty<File> files();
+ // properties' read functions
+ int filesCount() const;
+ QString filename() const;
+ QString fileContent() const;
+ QQmlListProperty<File> files();
- //properties' write functions
- void setFilename(const QString &str);
- void setFileContent(const QString &str);
+ // properties' write functions
+ void setFilename(const QString &str);
+ void setFileContent(const QString &str);
- //accessible from QML
- Q_INVOKABLE void saveFile();
- Q_INVOKABLE void loadFile();
+ // accessible from QML
+ Q_INVOKABLE void saveFile();
+ Q_INVOKABLE void loadFile();
- signals:
- void directoryChanged();
- void filenameChanged();
- void fileContentChanged();
+signals:
+ void directoryChanged();
+ void filenameChanged();
+ void fileContentChanged();
- private:
- QDir m_dir;
- QStringList m_dirFiles;
- File currentFile;
- QString m_saveDir;
- QStringList m_filterList;
+private:
+ QDir m_dir;
+ QStringList m_dirFiles;
+ File currentFile;
+ QString m_saveDir;
+ QStringList m_filterList;
- //contains the file data in QString format
- QString m_fileContent;
+ //contains the file data in QString format
+ QString m_fileContent;
- //Registered to QML in a plugin. Accessible from QML as a property of Directory
- QList<File *> m_fileList;
+ //Registered to QML in a plugin. Accessible from QML as a property of Directory
+ QList<File *> m_fileList;
- //refresh content of the directory
- void refresh();
+ //refresh content of the directory
+ void refresh();
};
#endif
{
}
-QString File::name() const{
+QString File::name() const
+{
return m_name;
}
-void File::setName(const QString &str){
- if(str != m_name){
+void File::setName(const QString &str)
+{
+ if (str != m_name) {
m_name = str;
emit nameChanged();
}
#ifndef FILE_H
#define FILE_H
-
-#include <QString>
#include <QObject>
+#include <QString>
-class File : public QObject{
-
+class File : public QObject
+{
Q_OBJECT
Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
- public:
- File(QObject *parent = 0);
+public:
+ File(QObject *parent = 0);
- QString name() const;
- void setName(const QString &str);
+ QString name() const;
+ void setName(const QString &str);
- signals:
- void nameChanged();
+signals:
+ void nameChanged();
- private:
- QString m_name;
+private:
+ QString m_name;
};
-#endif
\ No newline at end of file
+#endif
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0 as Window
+import QtQuick.Window 2.0
-Window.Window {
+Window {
width: 640
height: 480
visible: true //It's false by default
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQml 2.0
+
+/*
+ This object's only functionality is to exist as a root object and
+ display nothing, proving that qmlscene can run without windows.
+ (A QtObject can't even have Component.onCompleted)
+*/
+QtObject {
+ property string philosophy: "hello bleak windowless world"
+}
****************************************************************************/
import QtQuick 2.0
-import QtQuick.Window 2.0 as Window
+import QtQuick.Window 2.0
Item {
- width: 640
- height: 480
+ width: 320
+ height: 240
+ // It's not possible to set an Item's windowTitle. If you want to modify
+ // window properties, you need to explicitly create a Window.
Text {
+ id: text1
anchors.centerIn: parent
- text: "First Window"
+ text: "First Window\n" + (Qt.application.supportsMultipleWindows ?
+ "click the button to open a second window" : "only one window is allowed")
}
- MouseArea {
- anchors.fill: parent
- onClicked: Qt.quit()
+ Rectangle {
+ border.color: "black"
+ radius: 4
+ anchors.top: text1.bottom
+ anchors.horizontalCenter: text1.horizontalCenter
+ width: 100
+ height: 30
+ TextInput {
+ id: ti1
+ focus: true // but the modal popup will prevent input while it is open
+ anchors.centerIn: parent
+ }
}
- Window.Window {
- width: 640
- height: 480
- x: 640
- y: 480
- visible: true
- color: "green"
+ Rectangle {
+ border.color: "black"
+ color: childWindow.visible ? "goldenrod" : "beige"
+ radius: height / 4
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ anchors.margins: 10
+ width: text.implicitWidth + 20
+ height: text.implicitHeight + 20
+ visible: Qt.application.supportsMultipleWindows
Text {
+ id: text
+ text: "Pop up window"
anchors.centerIn: parent
- text: "Second Window"
}
- MouseArea{
+ MouseArea {
anchors.fill: parent
- onClicked: Qt.quit()
+ onClicked: childWindow.visible = !childWindow.visible
+ }
+ }
+
+ Window {
+ id: childWindow
+ width: 320
+ height: 240
+ x: 220
+ y: 120
+ color: "beige"
+ title: "Second Window"
+ modality: Qt.ApplicationModal
+ flags: Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint
+ Text {
+ id: text2
+ anchors.centerIn: parent
+ text: "Modal Frameless Stay-on-Top Window"
+ }
+ Text {
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.margins: 10
+ text: "X"
+ MouseArea{
+ anchors.fill: parent
+ onClicked: childWindow.visible = false
+ }
+ }
+ Rectangle {
+ border.color: "black"
+ radius: 4
+ anchors.top: text2.bottom
+ anchors.horizontalCenter: text2.horizontalCenter
+ width: 100
+ height: 30
+ TextInput {
+ id: ti2
+ focus: true
+ anchors.centerIn: parent
+ }
}
}
}
--- /dev/null
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+** of its contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Window 2.0
+
+QtObject {
+ property var win1: Window {
+ width: 320
+ height: 240
+ x: 0
+ y: 0
+ visible: true
+ color: "#ccffff"
+ title: "First Window"
+ Text {
+ anchors.centerIn: parent
+ text: "First Window"
+ Text {
+ id: statusText
+ anchors.top: parent.bottom
+ anchors.horizontalCenter: parent.horizontalCenter
+ }
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: win2.visible = !win2.visible
+ }
+ }
+ property var win2: Window {
+ width: 320
+ height: 240
+ x: 220
+ y: 120
+ visible: true
+ color: "green"
+ title: "Second Window: " + color
+ Rectangle {
+ anchors.fill: parent
+ anchors.margins: 10
+ Text {
+ anchors.centerIn: parent
+ text: "Second Window"
+ }
+ MouseArea {
+ anchors.fill: parent
+ onClicked: win2.color = "#ffffcc"
+ }
+ }
+ onVisibleChanged: statusText.text = "second window is " + (visible ? "visible" : "invisible")
+ }
+}
" highp float size = qt_ParticleData.z;\n"
" highp float endSize = qt_ParticleData.w;\n"
" highp float t = (qt_Timestamp - qt_ParticleData.x) / qt_ParticleData.y;\n"
+#if !defined(Q_OS_BLACKBERRY)
" highp float currentSize = mix(size, endSize, t * t);\n"
+#else
+ " highp float mixWorkaround = (endSize - size) * t * t;\n"
+ " highp float currentSize = mixWorkaround + size;\n"
+#endif
" if (t < 0. || t > 1.)\n"
" currentSize = 0.;\n"
" highp vec2 pos = qt_ParticlePos\n"
"#elif defined(DEFORM)\n"
" fTex = vPosTex.zw;\n"
"#endif\n"
+#if !defined(Q_OS_BLACKBERRY)
" highp float currentSize = mix(vData.z, vData.w, t * t);\n"
+#else
+ " highp float mixWorkaround = (vData.w - vData.z) * t * t;\n"
+ " highp float currentSize = mixWorkaround + vData.z;\n"
+#endif
" lowp float fade = 1.;\n"
" highp float fadeIn = min(t * 10., 1.);\n"
" highp float fadeOut = 1. - clamp((t - 0.75) * 4.,0., 1.);\n"
return item()->property("minimumValue");
}
+QVariant QAccessibleQuickItemValueInterface::minimumStepSize() const
+{
+ return item()->property("stepSize");
+}
+
/*!
\internal
Shared between QAccessibleQuickItem and QAccessibleQuickView
void setCurrentValue(const QVariant &value);
QVariant maximumValue() const;
QVariant minimumValue() const;
+ QVariant minimumStepSize() const;
};
#endif // QT_NO_ACCESSIBILITY
#else
Q_UNUSED(text)
#endif
- return view()->windowTitle();
+ return view()->title();
}
Qt::WindowFlags QQuickViewInspector::windowFlags() const
{
- return getMasterWindow(m_view)->windowFlags();
+ return getMasterWindow(m_view)->flags();
}
void QQuickViewInspector::setWindowFlags(Qt::WindowFlags flags)
{
QWindow *w = getMasterWindow(m_view);
- w->setWindowFlags(flags);
+ w->setFlags(flags);
// make flags are applied
w->setVisible(false);
w->setVisible(true);
\endlist
For example, if an identified module is installed into
-\c{$QML_IMPORT_PATH/ExampleModule}, the module identifier directive must be:
+\c{$QML2_IMPORT_PATH/ExampleModule}, the module identifier directive must be:
\code
module ExampleModule
\endcode
If the strict module is installed into
-\c{$QML_IMPORT_PATH/com/example/CustomUi}, the module identifier directive
+\c{$QML2_IMPORT_PATH/com/example/CustomUi}, the module identifier directive
must be:
\code
module com.example.CustomUi
\list
\li The directory of the current file
-\li The location specified by QLibraryInfo::ImportsPath
-\li Paths specified by the \c QML_IMPORT_PATH environment variable
+\li The location specified by QLibraryInfo::Qml2ImportsPath
+\li Paths specified by the \c QML2_IMPORT_PATH environment variable
\endlist
Additional import paths can be added through QQmlEngine::addImportPath() or the
-\c QML_IMPORT_PATH environment variable. When running the
+\c QML2_IMPORT_PATH environment variable. When running the
\l{Prototyping with qmlscene}{qmlscene} tool, you can also use the \c -I option
to add an import path.
}
/*!
- This method provides more advanced control over component instance creation.
+ This method provides advanced control over component instance creation.
In general, programmers should use QQmlComponent::create() to create a
component.
}
/*!
- This method provides more advanced control over component instance creation.
+ This method provides advanced control over component instance creation.
In general, programmers should use QQmlComponent::create() to create a
component.
- Complete a component creation begin with QQmlComponent::beginCreate().
+ This function completes the component creation begun with QQmlComponent::beginCreate()
+ and must be called afterwards.
\sa beginCreate()
*/
type version mapping and possibly QML extensions plugins.
By default, the list contains the directory of the application executable,
- paths specified in the \c QML_IMPORT_PATH environment variable,
- and the builtin \c ImportsPath from QLibraryInfo.
+ paths specified in the \c QML2_IMPORT_PATH environment variable,
+ and the builtin \c Qml2ImportsPath from QLibraryInfo.
\sa addImportPath(), setImportPathList()
*/
installed modules in a URL-based directory structure.
By default, the list contains the directory of the application executable,
- paths specified in the \c QML_IMPORT_PATH environment variable,
- and the builtin \c ImportsPath from QLibraryInfo.
+ paths specified in the \c QML2_IMPORT_PATH environment variable,
+ and the builtin \c Qml2ImportsPath from QLibraryInfo.
\sa importPathList(), addImportPath()
*/
{
filePluginPath << QLatin1String(".");
- // Search order is applicationDirPath(), $QML_IMPORT_PATH, QLibraryInfo::ImportsPath
+ // Search order is applicationDirPath(), $QML2_IMPORT_PATH, QLibraryInfo::Qml2ImportsPath
- QString installImportsPath = QLibraryInfo::location(QLibraryInfo::ImportsPath);
+ QString installImportsPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath);
addImportPath(installImportsPath);
// env import paths
- QByteArray envImportPath = qgetenv("QML_IMPORT_PATH");
+ QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
if (!envImportPath.isEmpty()) {
#if defined(Q_OS_WIN)
QLatin1Char pathSep(';');
{
for (int i = 0; i < types.count(); ++i)
delete types.at(i);
+
+ TypeModules::const_iterator i = uriToModule.constBegin();
+ for (; i != uriToModule.constEnd(); ++i)
+ delete *i;
}
class QQmlTypePrivate
return _parent;
}
+void QQmlPropertyCache::setParent(QQmlPropertyCache *newParent)
+{
+ _parent = newParent;
+}
+
// Returns the first C++ type's QMetaObject - that is, the first QMetaObject not created by
// QML
const QMetaObject *QQmlPropertyCache::firstCppMetaObject() const
QString defaultPropertyName() const;
QQmlPropertyData *defaultProperty() const;
QQmlPropertyCache *parent() const;
+ void setParent(QQmlPropertyCache *newParent);
inline QQmlPropertyData *overrideData(QQmlPropertyData *) const;
inline bool isAllowedInRevision(QQmlPropertyData *) const;
namespace v8 {
// Needed for V8ObjectSet
-inline uint qHash(const v8::Handle<v8::Object> &object, uint seed)
+inline uint qHash(const v8::Handle<v8::Object> &object, uint seed = 0)
{
return (object->GetIdentityHash() ^ seed);
}
// Scan through all of the "tst_*.qml" files and run each of them
// in turn with a QQuickView.
QQuickView *view = new QQuickView;
- view->setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint
+ view->setFlags(Qt::Window | Qt::WindowSystemMenuHint
| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint
| Qt::WindowCloseButtonHint);
QTestRootObject rootobj;
continue;
view->setObjectName(fi.baseName());
- view->setWindowTitle(view->objectName());
+ view->setTitle(view->objectName());
rootobj.setHasTestCase(false);
rootobj.setWindowShown(false);
rootobj.hasQuit = false;
\section3 QDeclarativeItem and QDeclarativeView
When porting to QQuickItem, note that QDeclarativeItem inherited from QGraphicsItem; in contrast,
-QQuickItem inherits directly from QObject, and any QGraphicsItem-specific functionality is longer
+QQuickItem inherits directly from QObject, and any QGraphicsItem-specific functionality is no longer
available. In particular, QQuickItem does not have a \c paint() method for performing custom
rendering through the QPainter API. Instead, in Qt 5, custom rendering should be performed through
the new \c QSG* classes to take full advantage of the scene graph. See the \l {Qt Quick Scene Graph}
tst_example -input /mnt/SDCard/qmltests
\endcode
- See \c{tests/qmlauto} in the source tree for an example of creating a
- test harness that uses the \c{QUICK_TEST_SOURCE_DIR} macro.
-
If your test case needs QML imports, then you can add them as
\c{-import} options to the the test program command-line by adding
the following line to your .pro file:
hData.reset();
vData.reset();
- hData.dragMinBound = q->minXExtent();
- vData.dragMinBound = q->minYExtent();
- hData.dragMaxBound = q->maxXExtent();
- vData.dragMaxBound = q->maxYExtent();
+ hData.dragMinBound = q->minXExtent() - hData.startMargin;
+ vData.dragMinBound = q->minYExtent() - vData.startMargin;
+ hData.dragMaxBound = q->maxXExtent() + hData.endMargin;
+ vData.dragMaxBound = q->maxYExtent() + vData.endMargin;
fixupMode = Normal;
lastPos = QPointF();
pressPos = event->localPos();
if (!vMoved)
vData.dragStartOffset = dy;
qreal newY = dy + vData.pressPos - vData.dragStartOffset;
- const qreal minY = vData.dragMinBound;
- const qreal maxY = vData.dragMaxBound;
+ // Recalculate bounds in case margins have changed, but use the content
+ // size estimate taken at the start of the drag in case the drag causes
+ // the estimate to be altered
+ const qreal minY = vData.dragMinBound + vData.startMargin;
+ const qreal maxY = vData.dragMaxBound - vData.endMargin;
if (newY > minY)
newY = minY + (newY - minY) / 2;
if (newY < maxY && maxY - minY <= 0)
if (!hMoved)
hData.dragStartOffset = dx;
qreal newX = dx + hData.pressPos - hData.dragStartOffset;
- const qreal minX = hData.dragMinBound;
- const qreal maxX = hData.dragMaxBound;
+ const qreal minX = hData.dragMinBound + hData.startMargin;
+ const qreal maxX = hData.dragMaxBound - hData.endMargin;
if (newX > minX)
newX = minX + (newX - minX) / 2;
if (newX < maxX && maxX - minX <= 0)
, viewSize(-1), startMargin(0), endMargin(0)
, origin(0)
, transitionTo(0)
- , continuousFlickVelocity(0), vTime(0)
+ , continuousFlickVelocity(0), velocityTime(), vTime(0)
, smoothVelocity(fp), atEnd(false), atBeginning(true)
, transitionToSet(false)
, fixingUp(false), inOvershoot(false), moving(false), flicking(false)
Q_PROPERTY(qreal rotation READ rotation WRITE setRotation NOTIFY rotationChanged)
Q_PROPERTY(qreal scale READ scale WRITE setScale NOTIFY scaleChanged)
Q_PROPERTY(TransformOrigin transformOrigin READ transformOrigin WRITE setTransformOrigin NOTIFY transformOriginChanged)
- Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // XXX todo - notify?
+ Q_PROPERTY(QPointF transformOriginPoint READ transformOriginPoint) // deprecated - see QTBUG-26423
Q_PROPERTY(QQmlListProperty<QQuickTransform> transform READ transform DESIGNABLE false FINAL)
Q_PROPERTY(bool smooth READ smooth WRITE setSmooth NOTIFY smoothChanged)
option.setTextDirection(layoutDirection());
option.setWrapMode(QTextOption::WrapMode(wrapMode));
option.setAlignment(Qt::Alignment(q->effectiveHAlign()));
+ if (!qmlDisableDistanceField())
+ option.setUseDesignMetrics(renderType != QQuickTextInput::NativeRendering);
+
m_textLayout.setTextOption(option);
m_textLayout.setFont(font);
data->sizeWasChanged = false;
data->windowSize = window->size();
data->isVisible = window->isVisible();
+ data->isRenderable = QQuickWindowPrivate::get(window)->isRenderable();
m_rendered_windows[window] = data;
isExternalUpdatePending = true;
WindowData *windowData = it.value();
QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window);
- if (windowPrivate->isRenderable()) {
+ windowData->isRenderable = windowPrivate->isRenderable();
+
+ if (windowData->isRenderable) {
gl->makeCurrent(window);
if (windowData->viewportSize != windowData->windowSize) {
}
windowPrivate->syncSceneGraph();
- } else {
- qWarning().nospace()
- << "Non-renderable window " << window
- << " (" << window->geometry() << ").";
}
}
inSync = false;
WindowData *windowData = it.value();
QQuickWindowPrivate *windowPrivate = QQuickWindowPrivate::get(window);
+ if (!windowData->isRenderable)
+ continue;
+
#ifdef THREAD_DEBUG
printf(" RenderThread: Rendering window %p\n", window);
#endif
uint sizeWasChanged : 1;
uint isVisible : 1;
+ uint isRenderable : 1;
};
QHash<QQuickWindow *, WindowData *> m_rendered_windows;
}
/*!
+ \internal
+
+ Set the source \a url, \a component and content \a item (root of the QML object hierarchy) directly.
+ */
+void QQuickView::setContent(const QUrl& url, QQmlComponent *component, QObject* item)
+{
+ Q_D(QQuickView);
+ d->source = url;
+ d->component = component;
+
+ if (d->component && d->component->isError()) {
+ QList<QQmlError> errorList = d->component->errors();
+ foreach (const QQmlError &error, errorList) {
+ QMessageLogger(error.url().toString().toLatin1().constData(), error.line(), 0).warning()
+ << error;
+ }
+ emit statusChanged(status());
+ return;
+ }
+
+ d->setRootObject(item);
+ emit statusChanged(status());
+}
+
+/*!
Returns the source URL, if set.
\sa setSource()
class QQmlContext;
class QQmlError;
class QQuickItem;
+class QQmlComponent;
class QQuickViewPrivate;
class Q_QUICK_EXPORT QQuickView : public QQuickWindow
public Q_SLOTS:
void setSource(const QUrl&);
+ void setContent(const QUrl& url, QQmlComponent *component, QObject *item);
Q_SIGNALS:
void statusChanged(QQuickView::Status);
}
-/*!
- \qmlproperty color QtQuick.Window2::Window::color
-
- The background color for the window.
-
- Setting this property is more efficient than using a separate Rectangle.
-*/
-
bool QQuickWindowPrivate::clearHover()
{
Q_Q(QQuickWindow);
{
if (geometry.width() <= 0 || geometry.height() <= 0)
return false;
- return visible || (renderWithoutShowing && platformWindow);
+ // Change to be applied after the visibility property is integrated in qtbase:
+// return visibility != QWindow::Hidden || (renderWithoutShowing && platformWindow);
+ // Temporary version which is implementation-agnostic but slightly less efficient:
+ const QQuickWindow *q = q_func();
+ return q->isVisible() || (renderWithoutShowing && platformWindow);
}
/*!
void QQuickWindow::setRenderTarget(QOpenGLFramebufferObject *fbo)
{
Q_D(QQuickWindow);
- if (d->context && d->context && QThread::currentThread() != d->context->thread()) {
+ if (d->context && QThread::currentThread() != d->context->thread()) {
qWarning("QQuickWindow::setRenderThread: Cannot set render target from outside the rendering thread");
return;
}
void QQuickWindow::setRenderTarget(uint fboId, const QSize &size)
{
Q_D(QQuickWindow);
- if (d->context && d->context && QThread::currentThread() != d->context->thread()) {
+ if (d->context && QThread::currentThread() != d->context->thread()) {
qWarning("QQuickWindow::setRenderThread: Cannot set render target from outside the rendering thread");
return;
}
}
/*!
+ \qmlproperty color QtQuick.Window2::Window::color
+
+ The background color for the window.
+
+ Setting this property is more efficient than using a separate Rectangle.
+*/
+
+/*!
\property QQuickWindow::color
\brief The color used to clear the OpenGL context.
d->clearColor = color;
emit colorChanged(color);
+ d->dirtyItem(contentItem());
}
QColor QQuickWindow::color() const
return d_func()->clearColor;
}
+/*!
+ \qmlproperty string QtQuick.Window2::Window::title
+
+ The window's title in the windowing system.
+ The window title might appear in the title area of the window decorations,
+ depending on the windowing system and the window flags. It might also
+ be used by the windowing system to identify the window in other contexts,
+ such as in the task switcher.
+ */
+
+/*!
+ \qmlproperty string QtQuick.Window2::Window::modality
+
+ The modality of the window.
+
+ A modal window prevents other windows from receiving input events.
+ Possible values are Qt.NonModal (the default), Qt.WindowModal,
+ and Qt.ApplicationModal.
+ */
#include "moc_qquickwindow.cpp"
s_instance = QSGContext::createWindowManager();
bool bufferQueuing = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::BufferQueueingOpenGL);
- bool fancy = bufferQueuing
- && QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL);
+#ifdef Q_OS_WIN
+ bool fancy = false; // QTBUG-28037
+#else
+ bool fancy = QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::ThreadedOpenGL);
+#endif
if (qmlNoThreadedRenderer())
fancy = false;
else if (qmlForceThreadedRenderer())
#include "qquickapplication_p.h"
#include <private/qobject_p.h>
+#include <private/qguiapplication_p.h>
+#include <qpa/qplatformintegration.h>
#include <QtGui/QGuiApplication>
#include <QtCore/QDebug>
return d->direction;
}
+bool QQuickApplication::supportsMultipleWindows() const
+{
+ return QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::MultipleWindows);
+}
+
bool QQuickApplication::eventFilter(QObject *, QEvent *event)
{
Q_D(QQuickApplication);
Q_OBJECT
Q_PROPERTY(bool active READ active NOTIFY activeChanged)
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged)
+ Q_PROPERTY(bool supportsMultipleWindows READ supportsMultipleWindows CONSTANT)
public:
explicit QQuickApplication(QObject *parent = 0);
virtual ~QQuickApplication();
bool active() const;
Qt::LayoutDirection layoutDirection() const;
+ bool supportsMultipleWindows() const;
Q_SIGNALS:
void activeChanged();
void connect();
void interrupt();
void getVersion();
- void getVersionWhenAttaching();
+// void getVersionWhenAttaching();
void applyV8Flags();
void setBreakpointInScriptWithCondition();
//void setBreakpointInFunction(); //NOT SUPPORTED
void setBreakpointOnEvent();
- void setBreakpointWhenAttaching();
+// void setBreakpointWhenAttaching();
void changeBreakpoint();
void changeBreakpointOnCondition();
QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(result())));
}
+/* TODO fails because of a race condition when starting up the engine before the view
void tst_QQmlDebugJS::getVersionWhenAttaching()
{
//void version()
client->version();
QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(result())));
}
+*/
void tst_QQmlDebugJS::applyV8Flags()
{
QVERIFY(body.value("value").toInt() > out);
}
+/* TODO fails because of a race condition when starting up the engine before the view
void tst_QQmlDebugJS::setBreakpointWhenAttaching()
{
int sourceLine = 49;
client->setBreakpoint(QLatin1String(SCRIPTREGEXP), QLatin1String(TIMER_QMLFILE), sourceLine);
QVERIFY(QQmlDebugTest::waitForSignal(client, SIGNAL(stopped())));
}
+*/
//void tst_QQmlDebugJS::setBreakpointInFunction()
//{
--- /dev/null
+import QtQuick 2.0
+import QtQuick.Window 2.0
+
+Window {
+ height: 100
+ width: 100
+}
{
}
+private:
+ void startQmlsceneProcess(const char *qmlFile);
private:
QQmlDebugProcess *m_process;
void connect();
void showAppOnTop();
void reloadQml();
+ void reloadQmlWindow();
};
-void tst_QQmlInspector::init()
+void tst_QQmlInspector::startQmlsceneProcess(const char *qmlFile)
{
const QString argument = "-qmljsdebugger=port:" STR_PORT ",block";
m_connection->connectToHost(QLatin1String("127.0.0.1"), PORT);
}
+void tst_QQmlInspector::init()
+{
+}
+
void tst_QQmlInspector::cleanup()
{
if (QTest::currentTestFailed()) {
void tst_QQmlInspector::connect()
{
+ startQmlsceneProcess("qtquick2.qml");
QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
}
void tst_QQmlInspector::showAppOnTop()
{
+ startQmlsceneProcess("qtquick2.qml");
QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
m_client->setShowAppOnTop(true);
void tst_QQmlInspector::reloadQml()
{
+ startQmlsceneProcess("qtquick2.qml");
QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
QByteArray fileContents;
QCOMPARE(m_client->m_reloadRequestId, m_client->m_responseId);
}
+void tst_QQmlInspector::reloadQmlWindow()
+{
+ startQmlsceneProcess("window.qml");
+ QTRY_COMPARE(m_client->state(), QQmlDebugClient::Enabled);
+
+ QByteArray fileContents;
+
+ QFile file(testFile("changes.txt"));
+ if (file.open(QFile::ReadOnly))
+ fileContents = file.readAll();
+ file.close();
+
+ QHash<QString, QByteArray> changesHash;
+ changesHash.insert("window.qml", fileContents);
+
+ m_client->reloadQml(changesHash);
+ QVERIFY(QQmlDebugTest::waitForSignal(m_client, SIGNAL(responseReceived())));
+
+ QEXPECT_FAIL("", "cannot debug with a QML file containing a top-level Window", Abort);
+ QTRY_COMPARE(m_process->output().contains(
+ QString("version 2.0")), true);
+
+ QCOMPARE(m_client->m_requestResult, true);
+ QCOMPARE(m_client->m_reloadRequestId, m_client->m_responseId);
+}
+
QTEST_MAIN(tst_QQmlInspector)
#include "tst_qqmlinspector.moc"
QObject::connect(receiver, member, &loop, SLOT(quit()));
timer.start(timeout);
loop.exec();
+ if (!timer.isActive())
+ qWarning("waitForSignal %s timed out after %d ms", member, timeout);
return timer.isActive();
}
QQuickView window;
window.setSource(testFileUrl("hearts.qml"));
- window.requestActivateWindow();
+ window.requestActivate();
window.show();
QTest::qWaitForWindowActive(&window);
window->setSource(testFileUrl("frameChange.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject());
// active
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(QGuiApplication::focusWindow() == &window);
QVERIFY(item->property("active").toBool());
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("rebound.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("nestedPressDelay.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *outer = qobject_cast<QQuickFlickable*>(window->rootObject());
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("wheel.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flick");
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("flickable03.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QVERIFY(window->rootObject() != 0);
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("flickable03.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("flickable03.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("flickable03.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("disabled.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flick = window->rootObject()->findChild<QQuickFlickable*>("flickable");
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("flickable03.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QQuickView *window = new QQuickView;
window->setSource(testFileUrl("cancel.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QQuickView *view = new QQuickView;
view->setSource(testFileUrl("transformedFlickable.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(view));
QVERIFY(view->rootObject() != 0);
QVERIFY(item3 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(item5 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(item3 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(view == qGuiApp->focusWindow());
QVERIFY(item3 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QVERIFY(item5 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(view->rootObject());
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
QVERIFY(item4 != 0);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTest::qWaitForWindowActive(view);
QTRY_VERIFY(view == qGuiApp->focusWindow());
view->show();
QVERIFY(view->rootObject());
- view->requestActivateWindow();
+ view->requestActivate();
qApp->processEvents();
QVERIFY(QTest::qWaitForWindowExposed(view));
view->setSource(testFileUrl("forceActiveFocus.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(view));
QTRY_VERIFY(view == qGuiApp->focusWindow());
QCOMPARE(item2->hasActiveFocus(), false);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(view == qGuiApp->focusWindow());
// view->hide(); // seemingly doesn't remove focus, so have an another view steal it.
alternateView.show();
- alternateView.requestActivateWindow();
+ alternateView.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&alternateView));
QVERIFY(QGuiApplication::focusWindow() == &alternateView);
// give the window focus, and item2 will get active focus
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(QGuiApplication::focusWindow() == view);
{
QQuickView window(testFileUrl("qtbug-20268.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
QCOMPARE(&window, qGuiApp->focusWindow());
QT += core-private gui-private v8-private qml-private quick-private testlib
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+mac:CONFIG+=insignificant_test # QTBUG-27890
gridview->setVerticalLayoutDirection(verticalLayoutDirection);
QTRY_COMPARE(QQuickItemPrivate::get(gridview)->polishScheduled, false);
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QTRY_VERIFY(qGuiApp->focusWindow() == window);
QCOMPARE(gridview->currentIndex(), 0);
QQuickView window;
window.setSource(testFileUrl("gridview4.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
QQuickGridView *view = qobject_cast<QQuickGridView*>(window.rootObject());
obj->setFillMode(fillMode);
obj->setProperty("mirror", true);
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QImage screenshot = window->grabWindow();
QQuickView view(testFileUrl(source));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QQuickImage *tiling = findItem<QQuickImage>(view.rootObject(), "tiling");
void ensureFocus(QWindow *w) {
w->show();
- w->requestActivateWindow();
+ w->requestActivate();
QTest::qWaitForWindowActive(w);
}
};
window->setSource(testFileUrl("keystest.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keyspriority.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keysim.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keynavigationtest.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keynavigationtest.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keynavigationtest.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setSource(testFileUrl("keynavigationtest_implicit.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setBaseSize(QSize(300, 300));
window->setSource(testFileUrl("propertychanges.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->setBaseSize(QSize(400, 400));
window->setSource(testFileUrl("hollowTestItem.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(QGuiApplication::focusWindow() == window);
window->rootContext()->setContextProperty("testModel", &model);
window->setSource(testFileUrl("listview-sections_delegate.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QQuickListView *listview = findItem<QQuickListView>(window->rootObject(), "list");
listview->setVerticalLayoutDirection(verticalLayoutDirection);
QTRY_COMPARE(QQuickItemPrivate::get(listview)->polishScheduled, false);
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QTRY_VERIFY(qGuiApp->focusWindow() == window);
window->setSource(testFileUrl("dragproperties.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseRegion = window->rootObject()->findChild<QQuickMouseArea*>("mouseregion");
window->rootContext()->setContextProperty("haveTarget", QVariant(true));
window->setSource(testFileUrl("dragreset.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseRegion = window->rootObject()->findChild<QQuickMouseArea*>("mouseregion");
window->setSource(testFileUrl("dragging.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWait(20);
QVERIFY(window->rootObject() != 0);
window->setSource(testFileUrl("dragging.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWait(20);
QVERIFY(window->rootObject() != 0);
window->setSource(testFileUrl("setDragOnPressed.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWait(20);
QVERIFY(window->rootObject() != 0);
QQuickView *window = createView();
window->setSource(testFileUrl("updateMousePosOnClick.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseRegion = window->rootObject()->findChild<QQuickMouseArea*>("mouseregion");
QQuickView *window = createView();
window->setSource(testFileUrl("updateMousePosOnResize.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseRegion = window->rootObject()->findChild<QQuickMouseArea*>("mouseregion");
QQuickView *window = createView();
window->setSource(testFileUrl("clickandhold.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
QQuickView *window = createView();
window->setSource(testFileUrl("noclickandhold.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QMouseEvent pressEvent(QEvent::MouseButtonPress, QPoint(100, 100), Qt::LeftButton, Qt::LeftButton, 0);
QQuickView *window = createView();
window->setSource(testFileUrl("rejectEvent.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QVERIFY(window->rootObject()->property("enabled").toBool());
QQuickView *window = createView();
window->setSource(testFileUrl("pressedCanceled.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QVERIFY(!window->rootObject()->property("pressed").toBool());
QVERIFY(!window->rootObject()->property("canceled").toBool());
QQuickView *window = createView();
window->setSource(testFileUrl("doubleclick.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseArea = window->rootObject()->findChild<QQuickMouseArea *>("mousearea");
QQuickView *window = createView();
window->setSource(testFileUrl("clicktwice.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseArea = window->rootObject()->findChild<QQuickMouseArea *>("mousearea");
QQuickView *window = createView();
window->setSource(testFileUrl("doubleclick.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseArea = window->rootObject()->findChild<QQuickMouseArea *>("mousearea");
QQuickView *window = createView();
window->setSource(testFileUrl("pressedOrdering.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QCOMPARE(window->rootObject()->property("value").toString(), QLatin1String("base"));
window->setSource(testFileUrl("preventstealing.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = qobject_cast<QQuickFlickable*>(window->rootObject());
QQuickView *window = createView();
window->setSource(testFileUrl("clickThrough.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QTest::mousePress(window, Qt::LeftButton, 0, QPoint(100,100));
window = createView();
window->setSource(testFileUrl("clickThrough2.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QTest::mousePress(window, Qt::LeftButton, 0, QPoint(100,100));
QQuickView *window = createView();
window->setSource(testFileUrl("dragging.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWait(20);
QVERIFY(window->rootObject() != 0);
QQuickView *window = createView();
window->setSource(testFileUrl("transformedMouseArea.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickMouseArea *mouseArea = window->rootObject()->findChild<QQuickMouseArea *>("mouseArea");
QQuickView *view = createView();
view->setSource(testFileUrl("simple.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(view->rootObject() != 0);
QQuickMouseArea *mouseArea = view->rootObject()->findChild<QQuickMouseArea *>("mousearea");
view->setSource(testFileUrl("changeAxis.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QTRY_VERIFY(view->rootObject() != 0);
QQuickMouseArea *mouseRegion = view->rootObject()->findChild<QQuickMouseArea*>("mouseregion");
QQuickView *window = new QQuickView(0);
window->setSource(testFileUrl(file));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
return window;
QVERIFY(window);
window->setSource(testFileUrl("pathview_package.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QQuickPathView *pathView = window->rootObject()->findChild<QQuickPathView*>("photoPathView");
QQuickView *window = createView();
window->setSource(testFileUrl("dragpath.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
window->setGeometry(0,0,400,200);
window->setSource(testFileUrl("dragpath.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("dragpath.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("dragpath.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("panels.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("pathview3.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("pathview3.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QCOMPARE(window, qGuiApp->focusWindow());
QQuickView *window = createView();
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
QQuickView *window = createView();
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
QQuickView *window = createView();
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
QQuickView *window = createView();
window->setSource(testFileUrl("pinchproperties.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QVERIFY(window->rootObject() != 0);
qApp->processEvents();
QQuickView *view = createView();
view->setSource(testFileUrl("transformedPinchArea.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QVERIFY(view->rootObject() != 0);
qApp->processEvents();
view->setSource(testFileUrl("anchorRewindBug.qml"));
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
{
QQuickView view(testFileUrl("hAlignImplicitWidth.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QQuickText *text = view.rootObject()->findChild<QQuickText*>("textItem");
{
QQuickView view(testFileUrl("underline.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QQuickText *textObject = view.rootObject()->findChild<QQuickText*>("myText");
QVERIFY(textObject != 0);
{
QQuickView view(testFileUrl("overline.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QQuickText *textObject = view.rootObject()->findChild<QQuickText*>("myText");
QVERIFY(textObject != 0);
{
QQuickView view(testFileUrl("strikeout.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&view));
QQuickText *textObject = view.rootObject()->findChild<QQuickText*>("myText");
QVERIFY(textObject != 0);
QQuickView *view = new QQuickView(qmlfile);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QQuickText *textObject = qobject_cast<QQuickText*>(view->rootObject());
QQuickView *window = createView(testFile("lineLayoutRelayout.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(window));
QQuickText *myText = window->rootObject()->findChild<QQuickText*>("myText");
textObject->setText(text);
view->show();
- view->requestActivateWindow();
+ view->requestActivate();
QVERIFY(QTest::qWaitForWindowActive(view));
QCOMPARE(textPrivate->extra->doc->lineCount(), nbLines);
QCOMPARE(textEdit->hAlign(), QQuickTextEdit::AlignLeft);
QVERIFY(textEdit->positionToRectangle(0).x() < window.width()/2);
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textEdit->hasActiveFocus());
{
QQuickView window(testFileUrl("persistentSelection.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(window.rootObject());
window.resize(100, 50);
textEditObject->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QCOMPARE(textEditObject->hasFocus(), false);
{
QQuickView window(testFileUrl("navigation.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickView window(QUrl::fromLocalFile(qmlfile));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickView window(QUrl::fromLocalFile(qmlfile));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickView window(QUrl::fromLocalFile(qmlfile));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
{
QQuickView window(testFileUrl("inputmethodhints.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
QQuickTextEdit *textEditObject = qobject_cast<QQuickTextEdit *>(window.rootObject());
QQuickView window(testFileUrl("positionAt.qml"));
QVERIFY(window.rootObject() != 0);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextEdit *texteditObject = qobject_cast<QQuickTextEdit *>(window.rootObject());
QQuickView window(testFileUrl("linkActivated.qml"));
QVERIFY(window.rootObject() != 0);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextEdit *texteditObject = qobject_cast<QQuickTextEdit *>(window.rootObject());
QFETCH(QUrl, source);
QQuickView view(source);
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
// Delegate creation is deferred until focus in or cursor visibility is forced.
view.rootContext()->setContextProperty("contextDelegate", &component);
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QQuickTextEdit *textEditObject = view.rootObject()->findChild<QQuickTextEdit*>("textEditObject");
QVERIFY(textEditObject != 0);
QQuickView view(testFileUrl("cursorVisible.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QCOMPARE(&view, qGuiApp->focusWindow());
QWindow alternateView;
alternateView.show();
- alternateView.requestActivateWindow();
+ alternateView.requestActivate();
QTest::qWaitForWindowActive(&alternateView);
QCOMPARE(edit.isCursorVisible(), false);
QCOMPARE(spy.count(), 6);
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QCOMPARE(edit.isCursorVisible(), true);
QCOMPARE(spy.count(), 7);
QQuickView view(QUrl(QLatin1String(SERVER_ADDR "/") + qmlfile));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
if (!error.isEmpty()) {
QTest::ignoreMessage(QtWarningMsg, error.toUtf8());
{
QQuickView window(testFileUrl("navigation.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
QQuickView window(testFileUrl("mouseselection_true.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
{
QQuickView window(testFileUrl("readOnly.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
{
QQuickView view(testFileUrl("inputMethodEvent.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QVERIFY(edit);
QQuickView view(testFileUrl("inputMethodEvent.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QVERIFY(edit);
QQuickView view(testFileUrl("openInputPanel.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QQuickView view(testFileUrl("inputMethodEvent.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QQuickView view(testFileUrl("inputContext.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextEdit *edit = qobject_cast<QQuickTextEdit *>(view.rootObject());
QVERIFY(textEdit != 0);
textEdit->setFocus(true);
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QInputMethodQueryEvent event(Qt::ImCursorRectangle);
QQuickWindow window;
textEdit->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textEdit->hasActiveFocus());
QQuickWindow window;
textEdit->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textEdit->hasActiveFocus());
QQuickWindow window;
textEdit->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textEdit->hasActiveFocus());
QQuickWindow window;
textEdit->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textEdit->hasActiveFocus());
QVERIFY(window.rootObject() != 0);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextEdit *input = qobject_cast<QQuickTextEdit *>(qvariant_cast<QObject *>(window.rootObject()->property("inputField")));
QVERIFY(input->hasActiveFocus());
{
QQuickView window(testFileUrl("persistentSelection.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(window.rootObject());
QQuickView window(QUrl::fromLocalFile(qmlfile));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickView window(QUrl::fromLocalFile(qmlfile));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QCOMPARE(textInput->hAlign(), QQuickTextInput::AlignLeft);
QCOMPARE(textInput->boundingRect().left(), qreal(0));
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickView window(testFileUrl("positionAt.qml"));
QVERIFY(window.rootObject() != 0);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(window.rootObject());
QQuickView window(testFileUrl("maxLength.qml"));
QVERIFY(window.rootObject() != 0);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(window.rootObject());
//QString componentStr = "import QtQuick 2.0\nTextInput { inputMask: 'HHHHhhhh'; }";
QQuickView window(testFileUrl("masks.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
QQuickTextInput *textinputObject = qobject_cast<QQuickTextInput *>(window.rootObject());
QVERIFY(textinputObject != 0);
QQuickView window(testFileUrl("validators.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
{
QQuickView window(testFileUrl("inputmethods.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
// test input method hints
{
QQuickView window(testFileUrl("navigation.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
{
QQuickView window(testFileUrl("navigation.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
// copy and paste
QQuickView window(testFileUrl("mouseselection_true.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QFETCH(QUrl, source);
QQuickView view(source);
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
// Delegate is created on demand, and so won't be available immediately. Focus in or
view.rootContext()->setContextProperty("contextDelegate", &component);
view.setSource(testFileUrl("cursorTestRemote.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QQuickTextInput *textInputObject = view.rootObject()->findChild<QQuickTextInput*>("textInputObject");
QVERIFY(textInputObject != 0);
QQuickView view(testFileUrl("cursorVisible.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QCOMPARE(input.isCursorVisible(), false);
QQuickView alternateView;
alternateView.show();
- alternateView.requestActivateWindow();
+ alternateView.requestActivate();
QTest::qWaitForWindowActive(&alternateView);
QCOMPARE(input.isCursorVisible(), false);
QCOMPARE(spy.count(), 6);
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QCOMPARE(input.isCursorVisible(), true);
QCOMPARE(spy.count(), 7);
{
QQuickView window(testFileUrl("readOnly.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(window.rootObject() != 0);
{
QQuickView window(testFileUrl("echoMode.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QSKIP("No mask delay in use");
QQuickView window(testFileUrl("echoMode.qml"));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
window.resize(100, 50);
textInputObject->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QCOMPARE(textInputObject->hasFocus(), false);
QQuickView view(testFileUrl("openInputPanel.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject());
input.setText("Hello world");
input.setParentItem(view.contentItem());
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
#ifdef Q_OS_MAC
QEXPECT_FAIL("", "QTBUG-23485", Abort);
input.componentComplete();
input2.componentComplete();
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QVERIFY(input.hasActiveFocus());
input.select(2,5);
QQuickView view(testFileUrl("preeditAutoScroll.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject());
QVERIFY(input);
QQuickView view(testFileUrl("inputMethodEvent.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject());
QVERIFY(input);
input->setText("");
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QTextLayout layout(text);
QQuickView view(testFileUrl("inputContext.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject());
QVERIFY(input);
QQuickView view(testFileUrl("inputContext.qml"));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput *input = qobject_cast<QQuickTextInput *>(view.rootObject());
QVERIFY(input);
QVERIFY(textInput != 0);
textInput->setFocus(true);
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QTest::qWaitForWindowActive(window);
QVERIFY(textInput->hasActiveFocus());
QString qmlfile = testFile("positionAt.qml");
QQuickView view(QUrl::fromLocalFile(qmlfile));
view.show();
- view.requestActivateWindow();
+ view.requestActivate();
QTest::qWaitForWindowActive(&view);
QQuickTextInput* input = qobject_cast<QQuickTextInput*>(view.rootObject());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QVERIFY(QTest::qWaitForWindowActive(&window));
QCOMPARE(QGuiApplication::focusWindow(), &window);
QQuickView window(testFileUrl(url));
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickTextInput *input = qobject_cast<QQuickTextInput*>(window.rootObject());
QQuickView window(url);
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(window.rootObject() != 0);
QQuickTextInput *input = qobject_cast<QQuickTextInput*>(window.rootObject());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QQuickWindow window;
textInput->setParentItem(window.contentItem());
window.show();
- window.requestActivateWindow();
+ window.requestActivate();
QTest::qWaitForWindowActive(&window);
QVERIFY(textInput->hasActiveFocus());
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(middleItem->lastEvent.touchPoints.isEmpty());
QVERIFY(bottomItem->lastEvent.touchPoints.isEmpty());
- // At one point this was failing with kwin (KDE window manager) because window->setPos(100, 100)
+ // At one point this was failing with kwin (KDE window manager) because window->setPosition(100, 100)
// would put the decorated window at that position rather than the window itself.
COMPARE_TOUCH_DATA(topItem->lastEvent, makeTouchData(QEvent::TouchBegin, window, Qt::TouchPointPressed, makeTouchPoint(topItem, pos)));
topItem->reset();
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QQuickWindow *window = new QQuickWindow;
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QTest::qWait(10);
QQuickWindow *window = new QQuickWindow;
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QTest::qWait(10);
QQuickWindow *window = new QQuickWindow;
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QQuickWindow *window = new QQuickWindow;
QScopedPointer<QQuickWindow> cleanup(window);
window->resize(250, 250);
- window->setPos(100, 100);
+ window->setPosition(100, 100);
window->setColor(Qt::blue);
window->show();
QVERIFY(QTest::qWaitForWindowExposed(window));
QQuickWindow *c = new QQuickWindow();
c->setColor(Qt::GlobalColor(Qt::red + i));
c->resize(300, 200);
- c->setPos(100 + i * 30, 100 + i * 20);
+ c->setPosition(100 + i * 30, 100 + i * 20);
c->show();
windows << c;
cleanup[i].reset(c);
// move them
for (int i=0; i<windows.size(); ++i) {
QQuickWindow *c = windows.at(i);
- c->setPos(100 + i * 30, 100 + i * 20 + 100);
+ c->setPosition(100 + i * 30, 100 + i * 20 + 100);
}
// resize them
CONFIG += parallel_test
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
+
+mac:CONFIG+=insignificant_test # QTBUG-27890
window->setSource(testFileUrl("singleitem.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(QTest::qWaitForWindowExposed(window));
QVERIFY(window->rootObject() != 0);
// window->setSource(testFileUrl("singleitem.qml"));
// window->show();
-// window->requestActivateWindow();
+// window->requestActivate();
// QVERIFY(window->rootObject() != 0);
// EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
window->setSource(testFileUrl("twoitems.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
window->setSource(testFileUrl("twoitems.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
window->setSource(testFileUrl("twoitems.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
EventItem *eventItem1 = window->rootObject()->findChild<EventItem*>("eventItem1");
window->setSource(testFileUrl("buttononflickable.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickFlickable *flickable = window->rootObject()->findChild<QQuickFlickable*>("flickable");
QQuickView *window = createView();
window->setSource(testFileUrl("buttonontouch.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
QQuickView *window = createView();
window->setSource(testFileUrl("pinchonflickable.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
QQuickView *window = createView();
window->setSource(testFileUrl("flickableonpinch.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
QQuickView *window = createView();
window->setSource(testFileUrl("mouseonflickableonpinch.qml"));
window->show();
- window->requestActivateWindow();
+ window->requestActivate();
QVERIFY(window->rootObject() != 0);
QQuickPinchArea *pinchArea = window->rootObject()->findChild<QQuickPinchArea*>("pincharea");
void MainWindow::showQuickView()
{
const int margin = 16;
- quickView.setPos(pos() + QPoint(0, frameGeometry().height() + margin));
+ quickView.setPosition(pos() + QPoint(0, frameGeometry().height() + margin));
quickView.raise();
quickView.show();
void MainWindow::initQml()
{
- quickView.setWindowFlags(Qt::FramelessWindowHint);
+ quickView.setFlags(Qt::FramelessWindowHint);
quickView.rootContext()->setContextProperty(QLatin1String("editor"), m_splineEditor);
quickView.setSource(QUrl("qrc:/preview.qml"));
quickView.show();
displayFileDialog(&options);
#endif
- QQmlEngine *engine = 0;
-
int exitCode = 0;
if (!options.file.isEmpty()) {
if (!options.versionDetection || checkVersion(options.file)) {
QTranslator translator;
- QQuickView qxView;
- engine = qxView.engine();
+
+ // TODO: as soon as the engine construction completes, the debug service is
+ // listening for connections. But actually we aren't ready to debug anything.
+ QQmlEngine engine;
+ QQmlComponent *component = new QQmlComponent(&engine);
for (int i = 0; i < imports.size(); ++i)
- engine->addImportPath(imports.at(i));
+ engine.addImportPath(imports.at(i));
for (int i = 0; i < bundles.size(); ++i)
- engine->addNamedBundle(bundles.at(i).first, bundles.at(i).second);
+ engine.addNamedBundle(bundles.at(i).first, bundles.at(i).second);
if (options.file.isLocalFile()) {
QFileInfo fi(options.file.toLocalFile());
loadTranslationFile(translator, fi.path());
- loadDummyDataFiles(*engine, fi.path());
+ loadDummyDataFiles(engine, fi.path());
}
- qxView.setSource(options.file);
-
- QObject::connect(engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
-
- if (options.resizeViewToRootItem)
- qxView.setResizeMode(QQuickView::SizeViewToRootObject);
- else
- qxView.setResizeMode(QQuickView::SizeRootObjectToView);
-
- if (options.transparent) {
- QSurfaceFormat surfaceFormat;
- surfaceFormat.setAlphaBufferSize(8);
- qxView.setFormat(surfaceFormat);
- qxView.setClearBeforeRendering(true);
- qxView.setColor(QColor(Qt::transparent));
- qxView.setWindowFlags(Qt::FramelessWindowHint);
+ QObject::connect(&engine, SIGNAL(quit()), QCoreApplication::instance(), SLOT(quit()));
+ component->loadUrl(options.file);
+ if ( !component->isReady() ) {
+ qFatal(qPrintable(component->errorString()));
+ return -1;
}
- qxView.setWindowFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
+ QObject *topLevel = component->create();
+ QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
+ QQuickView* qxView = 0;
+ if (!window) {
+ QQuickItem *contentItem = qobject_cast<QQuickItem *>(topLevel);
+ if (contentItem) {
+ qxView = new QQuickView(&engine, NULL);
+ window = qxView;
+ // Set window default properties; the qml can still override them
+ QString oname = contentItem->objectName();
+ window->setTitle(oname.isEmpty() ? QString::fromLatin1("qmlscene") : QString::fromLatin1("qmlscene: ") + oname);
+ window->setFlags(Qt::Window | Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint);
+ if (options.resizeViewToRootItem)
+ qxView->setResizeMode(QQuickView::SizeViewToRootObject);
+ else
+ qxView->setResizeMode(QQuickView::SizeRootObjectToView);
+ qxView->setContent(options.file, component, contentItem);
+ }
+ }
- if (options.fullscreen)
- qxView.showFullScreen();
- else if (options.maximized)
- qxView.showMaximized();
- else
- qxView.show();
+ if (window) {
+ if (options.transparent) {
+ QSurfaceFormat surfaceFormat;
+ surfaceFormat.setAlphaBufferSize(8);
+ window->setFormat(surfaceFormat);
+ window->setClearBeforeRendering(true);
+ window->setColor(QColor(Qt::transparent));
+ window->setWindowFlags(Qt::FramelessWindowHint);
+ }
+
+ if (options.fullscreen)
+ window->showFullScreen();
+ else if (options.maximized)
+ window->showMaximized();
+ else
+ window->show();
+ }
if (options.quitImmediately)
QMetaObject::invokeMethod(QCoreApplication::instance(), "quit", Qt::QueuedConnection);
+ // Now would be a good time to inform the debug service to start listening.
+
exitCode = app.exec();
#ifdef QML_RUNTIME_TESTING
RenderStatistics::printTotalStats();
#endif
+ // Ready to exit. If we created qxView, it owns the component;
+ // otherwise, the ownership is still right here. Nobody deletes the engine
+ // (which is odd since the container constructor takes the engine pointer),
+ // but it's stack-allocated anyway.
+ if (qxView)
+ delete qxView;
+ else
+ delete component;
}
}