Commit Graph

35 Commits

Author SHA1 Message Date
Friedemann Kleint 05e3cdd8ab Set Qt version on tools
Change-Id: I21d77b2eba7107528fc00db0cf5d87f8347b63be
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
2016-11-09 09:18:44 +00:00
Anton Kudryavtsev 3ef4fac9ff tools: replace 'foreach' with 'range for'
Mark some local variables or parameters as const
to prevent detach()'ing.
Use qAsConst where is not possible mark as const.

Change-Id: I0a777c3bd855abd3bb1ad0907152360cf4a1050e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-20 06:52:34 +00:00
Cavit Sina Dogru 4fbfbf7fe8 Qt object: Add exit(int)
This is similar to the Qt.quit() function but also specifies the return
code that the event loop will return.

[ChangeLog][QtQml] Added exit(int retCode) method to the Qt global object.
An application can call Qt.exit to specify a return code of the engine.

Task-number: QTBUG-54360
Change-Id: Iaa319e6dc4d6b99dc3a5c01845e87b936fd2cab0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2016-08-09 17:16:44 +00:00
Jani Heikkinen 38ec3bd755 Updated license headers
From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some
exceptions, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/

Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one
(in those files which will be under GPL 3 with exceptions)

Change-Id: I04760a0801837cfc516d1c7c02d4f503f6bb70b6
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-01-20 11:46:25 +00:00
Friedemann Kleint 0b51b08fcd Revert "qmlscene/qml tools: Temporarily disable High DPI options."
Re-enable the options after the attributes have their final names.
Add options for enabling scaling.

This reverts commit 051684f125.

Task-number: QTBUG-46615
Task-number: QTBUG-48379
Change-Id: If862061c688f9febff3b9511a4f19649b07d2011
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2015-11-26 21:36:05 +00:00
Friedemann Kleint 051684f125 qmlscene/qml tools: Temporarily disable High DPI options.
To be re-enabled once the attribute names are final.

Task-number: QTBUG-46615
Change-Id: Id463167ab102e3c2f3af4fe39675853eae3bb851
Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
2015-11-02 17:06:32 +00:00
Friedemann Kleint cae36255e3 qml/qmlscene: Add command line option -no-scaling for Qt::AA_NoHighDpiScaling.
Task-number: QTBUG-46615
Change-Id: Idcea92d58c1532d956ad6cb16036646c231bb0ac
Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
2015-09-07 10:32:49 +00:00
Liang Qi 4a1846acd1 Merge remote-tracking branch 'origin/5.5' into 5.6
Conflicts:
	tools/qml/main.cpp

Change-Id: I6d521b21be85d91ebb96c28e2c64186f02d94842
2015-08-21 15:18:07 +02:00
Kai Koehne c1477c4660 qml: Don't build OpenGL support if OpenGL is not available in Qt.
This is an amended backport of change 668ccf18d in dev.

Change-Id: I168a4d5a55c34592599a557bef941ce1629c8178
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2015-08-19 13:48:28 +00:00
Robin Burchell 668ccf18dc qml: Don't build OpenGL support if OpenGL is not available in Qt.
Change-Id: I66c841778eb0ae662c3951a26665c83e233851b5
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-08-17 11:21:37 +00:00
Liang Qi 5112821a37 Merge remote-tracking branch 'origin/5.5' into dev
Conflicts:
	.qmake.conf
	src/qml/qml/qqmlengine.cpp
	src/quick/items/qquickitemsmodule.cpp
	tools/qml/main.cpp

Change-Id: Ida8daf6b4d7e675385f2f5514c446e52dedaf136
2015-06-30 09:08:35 +02:00
Friedemann Kleint ed7771c6ab qml: Output information about build and GL renderer in verbose mode.
Make static contain() a member of LoadWatcher() and connect to
QQuickWindow::onOpenGlContextCreated(). Print information similar
to qtdiag.

Change-Id: I0bc6bc43418e4392c6b5e2643d4f7899ff4f4f8b
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-06-15 14:37:55 +00:00
Friedemann Kleint 926303a9f8 qml: Add options to control the GL renderer.
Task-number: QTBUG-46030
Change-Id: I5af5a0ef267444d85e8da6df196229ad8199c00f
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-06-04 07:03:54 +00:00
Alan Alpert b252c2d479 qml tool should exit on Qt.quit()
In a QML/C++ application there may be additional code after app.exec().
In a pure QML application this is not the case, and you may wish to call
Qt.quit() during scene creation (before app.exec()).

[ChangeLog][QtQml][qml] qml tool now quits immediately if Qt.quit()
is called before all scenes complete creation.

Change-Id: I5c6fb64769724350ef3d74c34e2ede2d06562e4b
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-31 17:59:26 +00:00
Alan Alpert 079c45fd0a Fix use of qml versioning in qml
The bumping of a version number shouldn't "unpublish" any types.

Change-Id: I01ceb70442cb6643478f75bb5729f3db7c989bfa
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2015-03-17 16:42:55 +00:00
Kevin Ottens 4dc68ba888 Don't limit to files ending with .qml
Especially useful when the program is invoked indirectly by a shell
running the QML file like an executable.
Such script executable often don't have an extension to make their
invocation look like that of binary executables.

[ChangeLog][QtQml] Make it possible to make script without .qml suffix

Change-Id: I5a569bdea185cfa60ce68afa27ae03278b1acdb8
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2015-03-16 18:22:39 +00:00
Kevin Ottens b049085a2c qml tool: don't process the command name
The first argument is the command name.  There's no need to
compare it against possible arguments.

Change-Id: I776f10b6872286f89f07582b81d4990260ef9ddc
Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2015-03-06 06:39:14 +00:00
Jani Heikkinen c5796292ad Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I61120571787870c0ed17066afb31779b1e6e30e9
Reviewed-by: Iikka Eklund <iikka.eklund@theqtcompany.com>
2015-02-12 10:28:11 +00:00
Pasi Petäjäjärvi e6a419d0e3 qml: obey QT_NO_REGULAREXPRESSION define
Not all platforms do have QRegularExpression as it is based on
pcre.

Change-Id: I3247f8b2213f78a6e537f6781d97b0c6382482ad
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
2014-11-11 11:11:41 +01:00
Shawn Rutledge 05d8ffb4df Revert: use the new form of QTranslator::load() for more flexibility
This reverts commit 427646b8d7.
It seems that it should have been more correct, but we are still not
shipping English translations, and static QString find_translation()
in qtranslator.cpp will return any language which is in
QLocale::uiLanguages() for which the translation file is found.
That is a long list on OSX.

Reverting the patch means find_translation() is not called in
such cases.  This change can be re-done whenever we are more sure
that the attempt to find a translation will succeed in finding a
sensible one, or fall back to not translating, rather than choosing
a language that the user didn't intend.

Task-number: QTBUG-41977
Change-Id: I425946cc71cec96b4f38629eb2b7e80220c5236d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
2014-10-28 12:37:05 +01:00
Shawn Rutledge 427646b8d7 use the new form of QTranslator::load() for more flexibility
As the docs explain, the variant of QTranslator::load() taking a
const QLocale& is better because it "uses QLocale::uiLanguages()
and not simply the locale name, which refers to the formatting of
dates and numbers and not necessarily the UI language."  And, using
a default-constructed QLocale permits QLocale::setDefault() to
override the system locale, so for example an application's
main.cpp can do that before constructing a QQmlApplicationEngine.

Task-number: QTBUG-7329
Change-Id: Ia29a4c894087c92b071c0fe484728866f2660fe6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-10-01 15:14:23 +02:00
Jani Heikkinen e7ceacda70 Update license headers and add new licenses
- Renamed LICENSE.LGPL to LICENSE.LGPLv21
- Added LICENSE.LGPLv3 & LICENSE.GPLv2
- Removed LICENSE.GPL

Change-Id: I84a565e2e0caa3b76bf291a7d188a57a4b00e1b0
Reviewed-by: Jani Heikkinen <jani.heikkinen@digia.com>
2014-08-25 11:28:46 +02:00
Shawn Rutledge 6622b87482 Tools and examples: consistently use organization name QtProject
This affects the location of the QSettings files or registry entries.
Other parts of Qt are using this organization name so it's good to
have all the settings in the same place.

[ChangeLog][QtQuick] tools and examples consistently use the
QtProject organization name

Change-Id: I1fae4eaed0248411fe95dda9572d38006648b162
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
2014-07-02 09:08:06 +02:00
Jeff Tranter 52a46d332c Fix some typos in usage string.
Fix some spelling errors in the command usage string.

Change-Id: Iee94987d0a3dff78e39f588b4c21415ed40a514c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-05-09 16:08:38 +02:00
Erik Larsson f3d8386bcd Fix crash in qml/qmlscene when using dummy-data with imports
When using the tools qml and qmlscene with dummy-data it will crash or
behave wrong, due to the dummy-data component will get the state not
ready, if the dummy-data qml-files does an import of another folder or
a js-file.  By changing the way of loading dummy-data, by letting
QQmlComponent handle the file opening instead of using the setData()
method, qmlscene and qml will be able to handle this type of
dummy-data.

The tool qml also needed to load the dummy data before loading the
regular components, otherwise the dummy-data would not be ready for the
other components to use.

Task-number: QTBUG-32721

Change-Id: Ia1cc2b2626187e23c7d7313be788202d91b12471
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2014-03-13 21:40:43 +01:00
Andrew Knight 50f8133a1a Remove several uses of module includes
Module includes are discouraged because they may increase compilation
time. While debugging a broken core module include header, a number
of module include infractions were discovered in qtdeclarative. Replace
them with their more specific counterparts.

Change-Id: I614e9a6aa2177f396e5289f3cdb3c35faa0202c9
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
2014-03-10 15:04:11 +01:00
Shawn Rutledge 61cf2b0633 qml tool on OSX: wait for a timeout before exiting
Double-clicking to open a QML file was not working because it would
exit if no files are given on the command line.  It needs to wait
a while for the QFileOpenEvent.

Task-number: QTBUG-34926
Change-Id: Icb585a777b0438db85120c62e7717f0f6eafffb1
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-11-20 16:07:26 +01:00
Kai Koehne b3d0da4ee6 Remove '-enable-debugger' argument from qml executable
Task-number: QTBUG-34836
Change-Id: I3ab2a16036a1086c0ac1f50880a402caf9f54f2d
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-11-16 07:05:29 +01:00
Alan Alpert 64bbcfa678 Add a verbose mode to qml
The extra output is primarily useful for debugging, and on windows it
will actually make an ugly command prompt window appear.

Change-Id: I552e479515a6f5249685844143601cb7449a10b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-11-11 12:18:15 +01:00
Alan Alpert 0d5ef23ee7 Fix qml runtime when loading files that imported other files
QQmlComponent::setData does not perform any URL processing. Consequently
when using that function we need to 'normalize' the URLs ourselves to
ensure that the engine finds them acceptable.

Task-number: QTBUG-34301
Change-Id: Ia0f3a51129423020f7e4d7003ca356af3f89b441
Reviewed-by: Antti Piira <apiira@blackberry.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2013-11-01 08:06:15 +01:00
Shawn Rutledge c084d32d92 qml tool: compiles with clang
The error was that app can be uninitialized if the switch goes into
the default branch.

Change-Id: Ic690e1dd257cf88ee04d019b5b81121cecb48564
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
2013-10-30 08:29:49 +01:00
Tasuku Suzuki 8d24f015b2 Make qtdeclarative compile with -no-gui
Change-Id: I079f5e09a0099550348388379c496fc8f8cfa27c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
2013-10-25 14:45:46 +02:00
Sérgio Martins 6752b6fef6 Fix WinCE build.
Change-Id: Ie0536ad94f88efe1e54226ed7f1d9e1042ffcc19
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2013-09-25 22:56:10 +02:00
Shawn Rutledge 8495296f4f qml: handle all possible QtMsgType in switch because of -Werror
Perhaps this illustrates why having -Werror is more of an annoyance
than whatever it was supposed to help:
https://codereview.qt-project.org/#change,65253 cannot be merged
until the new enum value that it adds is handled _everywhere_ that
it can be.

Change-Id: I2bba730b471683487e38693c9ace2d09be4c874d
Reviewed-by: hjk <hjk121@nokiamail.com>
2013-09-25 10:33:37 +02:00
Alan Alpert 9aec6efd1f Add qml tool
This tool simply runs QML files using a QQmlApplicationEngine.

It is configurable so as to behave, by default, like qmlscene in
that it will automatically place non-Window QtQuick 2 Items inside
a QQuickWindow with the size of the root item. The configuration
is extensible so that other GUI scenes can also use it by altering
the configuration files in their installation.

On OS X, it is an app bundle, and handles the QFileOpenEvent so that
it can be the tool with which qml files are usually launched by
double-clicking.  (This does not break the ability to use it on the
command line too: the options still work, you just have to give the
path to the executable inside the bundle.)

Change-Id: I6bac813ce188be54842a78d7b532fcf2d54dc443
Reviewed-by: Alan Alpert (Personal) <416365416c@gmail.com>
2013-09-17 03:04:56 +02:00