aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmlscene/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Revert "qmlscene/qml tools: Temporarily disable High DPI options."Friedemann Kleint2015-11-261-6/+5
| | | | | | | | | | | | Re-enable the options after the attributes have their final names. Add options for enabling scaling. This reverts commit 051684f125bbc31bd882c4cd313c3482bcd145a0. Task-number: QTBUG-46615 Task-number: QTBUG-48379 Change-Id: If862061c688f9febff3b9511a4f19649b07d2011 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* qmlscene/qml tools: Temporarily disable High DPI options.Friedemann Kleint2015-11-021-0/+4
| | | | | | | | 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>
* qmlscene: Split argument parsing.Friedemann Kleint2015-10-191-31/+38
| | | | | | | | | | | Loop over argv to filter out the arguments that need to be set before Q[Gui]Application creation and use QCoreApplication::arguments() for the remaining arguments. This prevents Qt's arguments (-geometry/-platform...) from interfering with the URL argument check. Change-Id: I2a88478534179b79578f7fb979a6b264a4fae44d Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
* Tools: Fix single-character string literals.Friedemann Kleint2015-10-131-3/+3
| | | | | | | Use character literals where applicable. Change-Id: I55679dcc13c4c79567712c0dfaaabc2b84fee010 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
* qmlscene: Make it possible to pass non-local file URLs.Friedemann Kleint2015-09-221-16/+34
| | | | | | | | | Change the argument parsing to use QUrl::fromUserInput() defaulting to local files. Do version check only for local files. Wait until loading is complete. Change-Id: I0261958d7cf2e67fd23407c03d89486703bebd52 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* qml/qmlscene: Add command line option -no-scaling for Qt::AA_NoHighDpiScaling.Friedemann Kleint2015-09-071-0/+3
| | | | | | Task-number: QTBUG-46615 Change-Id: Idcea92d58c1532d956ad6cb16036646c231bb0ac Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* qmlscene: Add option --verbose to obtain diagnostic output.Friedemann Kleint2015-06-041-2/+63
| | | | | | | | | | | Print the build information and connect to QQuickWindow::openglContextCreated() to print information on the GL driver (similar to qtdiag). Set a window title indicating render type and Qt version. Task-number: QTBUG-46030 Change-Id: Ib4376126bf9c63f4cab8cb530ff1da66394b634b Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* qmlscene: Add options to control the GL renderer.Friedemann Kleint2015-06-041-18/+29
| | | | | | | | | | | Replace boolean option controlling context sharing by a vector of QCoreApplication attributes (bearing in mind that for example High DPI changes might add more attributes) and add the GL switching attributes. Task-number: QTBUG-46030 Change-Id: I934dd8910b7b50ec96ae9e00823649c9df6a00ef Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Address uninitialized pointer variablesHolger Hans Peter Freyther2015-04-201-1/+0
| | | | | | | | Coverity CID 10721, 84861, 86705, 85424, 85422, 85259, 84863, 84857 Change-Id: Ia86970b5ac4e0be9de01b79b618d33011da6a328 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-121-7/+7
| | | | | | | | | 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>
* Add -P argument to qmlscene to specify plugins search pathAlain Martin2014-12-171-0/+6
| | | | | | | Allow users to specify locations of compiled QML plugins. Change-Id: I0ad764282a7891013ce0cfa008a1cf8164cb083b Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Remove QML bundle codeSimon Hausmann2014-12-121-9/+1
| | | | | | | | | | This feature is effectively not maintained, experimental and undocumented. Consensus on the mailing list is to remove it: http://lists.qt-project.org/pipermail/development/2014-December/019384.html Change-Id: Iaa73b3e90806c338ef81bbd4307ddd2addd37964 Reviewed-by: Christopher Adams <chris.adams@jollamobile.com>
* qmlscene: Simplify context sharing logic.Pierre Rossi2014-11-071-9/+3
| | | | | | | We can use the new application attribute for this now. Change-Id: Ia0a6d13d36316ec9becfb5d3251b8461ac73a2d0 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Don't use qDebug and qWarning for formatted outputThiago Macieira2014-10-311-37/+38
| | | | | | | | | | | | | | | | | | | | They are not meant to be used like that. If you want formatted output to the console, use stdio.h functions or std::cout. Otherwise, you get something like: $ qmlscene -h [233103.196] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): Usage: qmlscene [options] <filename> [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): [233103.197] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): Options: [233103.198] (126848)(usage|?qmlscene?|__libc_start_main|?qmlscene?): --maximized ............................... Run maximized [...] I've replaced all qDebug with puts/printf and most qWarning with fprintf to stderr. In my opinion, some of the qWarnings aren't errors, so I replaced those with puts/printf too. Change-Id: I3e493950bc4a588059fec6c7441b010c2780dffd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert: use the new form of QTranslator::load() for more flexibilityShawn Rutledge2014-10-281-8/+6
| | | | | | | | | | | | | | | | | | | This reverts commit 427646b8d7c52e5b84240e07ffd391217ce3bfa8. 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>
* use the new form of QTranslator::load() for more flexibilityShawn Rutledge2014-10-011-6/+8
| | | | | | | | | | | | | | 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>
* qmlscene: load master translation file before more specific onesShawn Rutledge2014-09-041-7/+3
| | | | | | | | | | It was giving up too early because qmlscene_??.qm doesn't exist. The file qt_??.qm links to all existing Qt-provided translation files, so it is enough by itself unless there are application-specific translations besides. Change-Id: Iebedf54ddb4eef4f4d7da8a7fade1850a366aee8 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Update license headers and add new licensesJani Heikkinen2014-08-251-19/+11
| | | | | | | | | - 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>
* Use the renamed qt_gl_global_share_contextJocelyn Turcotte2014-08-051-1/+1
| | | | | Change-Id: I438c33a1dc83fd0cd1ec08bb4e4a1257a3216ca2 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Tools and examples: consistently use organization name QtProjectShawn Rutledge2014-07-021-1/+1
| | | | | | | | | | | | 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>
* Use global context sharing from QtGui instead of QSGContextJocelyn Turcotte2014-04-041-2/+2
| | | | | | | | | This removes QSGContext::sharedOpenGLContext and replace its uses with QOpenGLContextPrivate::globalShareContext, which is also going to be used by QOpenGLWidget and QQuickWidget. Change-Id: I1e296c3e6832f717caaf31ba7d7b27c06249219b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Enable GL context sharing for QtQuick windows by defaultSimon Hausmann2014-03-291-0/+15
| | | | | | | | | | | This is required for running QWebEngine inside qmlscene. It can be disabled with --disable-context-sharing and it remains off in QtQuick. Instead apps have to use QWebEngine API to enable this, where this patch here is merely convenience. Change-Id: I123893a7c8c644c49c66fe2b42d2b7b2e03622d9 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
* Fix crash in qml/qmlscene when using dummy-data with importsErik Larsson2014-03-131-5/+1
| | | | | | | | | | | | | | | | | | | 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>
* Fix error reporting in the new object creatorSimon Hausmann2013-09-081-0/+4
| | | | | | | | | | Propagate error conditions from createVMEMetaObjectAndPropertyCache to the caller and properly clean up refcounts (using QQmlRefPointer) Also fixed qmlscene to report errors if create() failed. Change-Id: I75d984798a197c102078e5d5638ed92f167ab49f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* qmlscene: ensure that the window & component get destructedJ-P Nurmi2013-07-041-13/+10
| | | | | | Task-number: QTBUG-32207 Change-Id: Ic7c45228cbdc049d3dfdb3482296d0e8c89a930c Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* qmlscene: if top-level is a QQuickWindow, set incubation controllerShawn Rutledge2013-06-041-1/+3
| | | | | | | | | | | | | | | The necessity for this is documented in the QQuickWindow::incubationController() accessor. Bug 31203 is about writing a custom main() with a QQmlApplicationEngine, not about qmlscene, but the same workaround is necessary for both. Hopefully soon we find a way to make it unnecessary, but for now it is. This fix also doesn't take care of the QtObject { Window { } } use case. Task-number: QTBUG-31203 Change-Id: Ic9a5e4a23ac918593138dc9cab3de6cd36453eaf Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* qmlscene: Set window flags correctly.Friedemann Kleint2013-05-231-1/+3
| | | | | | | Task-number: QTBUG-31258 Change-Id: I13dfc17c75075de155505d20c57400753de0a71d Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* qmlscene: don't call show() on the window if it's already showingShawn Rutledge2013-05-221-1/+1
| | | | | | | | | | That way Component.onCompleted() can optionally do showMaximized() without being overridden. Task-number: QTBUG-31260 Change-Id: I6f5c3025efd3b38809be85da4172241695168a6c Reviewed-by: Nikita Krupenko <krnekit@gmail.com> Reviewed-by: Alan Alpert <aalpert@blackberry.com>
* Show fullscreen button in qmlscene on MacGunnar Sletta2013-04-021-1/+1
| | | | | Change-Id: I3202e8e7461f457eeb73a82b7a8da40a11e4f76d Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Respect the default format from the scene graph adaptation layerGunnar Sletta2013-02-051-1/+1
| | | | | Change-Id: I080c25ed8b8cc8b743043b5aa348927749c1f0eb Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Merge branch 'stable' into devGunnar Sletta2013-01-171-5/+5
|\ | | | | | | | | | | | | | | Conflicts: src/qml/doc/qtqml.qdocconf src/quick/doc/qtquick.qdocconf Change-Id: I087fa14720995a5e53c43567dc4a3c29eb9992a9
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-101-1/+1
| | | | | | | | | | | | Change-Id: I6c3bd7bebe3d62d1cfd0fa6334544c9db8398c76 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
| * Modify qmlscene usage text to be consistentRichard Moe Gustavsen2013-01-041-4/+4
| | | | | | | | | | | | | | | | - last line was not aliged correctly with the previous lines. - usage of capital letter was inconsistent. Change-Id: Ied7caab8296a635e105764bc2e95aa9e78f1cfcb Reviewed-by: Alan Alpert <aalpert@rim.com>
* | Merge branch 'stable' into devFrederik Gladhorn2013-01-041-1/+1
|\| | | | | | | | | | | | | | | | | Conflicts: src/qml/qml/parser/qqmljskeywords_p.h sync.profile tests/auto/qml/qqmllanguage/tst_qqmllanguage.cpp Change-Id: I9bc6659e1bab924009167bec567354d40a77a8cb
| * Change qFatal to qWarningAlan Alpert2012-12-061-1/+1
| | | | | | | | | | | | | | | | | | While the process should terminate immediately with a non-zero exit code on component error, it does that in the next line already. The main difference is dropping the backtrace, which is not useful in this case. Change-Id: I866ea00e62cb9d1b7c506b9819cd9bb2750ac81f Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* | Add command-line option to enable multisamplingGunnar Sletta2012-12-111-3/+9
|/ | | | | Change-Id: I9ec8961342c23ea2c116c970e84aa412365412a9 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove the remaining usages of deprecated QWindow accessorsShawn Rutledge2012-11-301-1/+1
| | | | | Change-Id: I146e7b8e3ae0ee74f5f4e3ef85f59d50a639c0f5 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Enable mobule build with QT_NO_TRANSLATIONTasuku Suzuki2012-11-261-0/+8
| | | | | | Change-Id: Id7aeef0d499f48ddc64b4ea3e4dc713db8458c38 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Alan Alpert (RIM) <aalpert@rim.com>
* Fix security warning about passing a variable to printf-formatting.Friedemann Kleint2012-11-221-1/+1
| | | | | Change-Id: I7ea8ff54d24fe0818cd216d4aac0e8970461306e Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Examples and fixes for QML Window propertiesShawn Rutledge2012-11-091-0/+3
| | | | | | | | | Setting Window.color in QML takes effect immediately. It was only possible to set the property at startup. Examples demonstrate new Window property features. Change-Id: Ic5b43d0d84371f3fe5c42223ccc98e6de27aed10 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* All QWindow properties that have "window" in them have been renamed.Shawn Rutledge2012-11-081-1/+1
| | | | | | | Depends on patch Ie4424ec15fbdef6b29b137f90a2ae33f173edd21 in qtbase. Change-Id: I9614cc2c7ed119c663b3f6f99267483e291e529c Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* qmlscene can start with either an Item or Window as the qml rootShawn Rutledge2012-11-051-30/+56
| | | | | | | | | | | Before, it assumed that the root is an Item and needs to have a Window created. But it's useful for an application to have a Window as the root, and it was already possible by writing a different C++ main function (see qtdeclarative/examples/window/window/window.cpp). It doesn't take much to give qmlscene this flexibility too. Change-Id: Ie808e78a42074e13aa9d3c87723ec9ac8fdbaf4a Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Change organisation to Qt Project.Frederik Gladhorn2012-10-251-2/+2
| | | | | Change-Id: Ia55cf3cff4f019c82588d44c0b9c63cb97d965be Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-231-24/+24
| | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: Ie7f5d49ed8235d7a7845ab68f99ad1c220e64d5c Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* qmlscene: fixed dependency on QtWidgetsRohan McGovern2012-07-301-1/+1
| | | | | | | | Don't unnecessarily refer to QApplication for installTranslator(); this is a static member of QCoreApplication. Change-Id: I7b0e0e30abe1f3a5c114136f1107de3fd7dbc815 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* Remove work-around for Q_DECLARE_METATYPE(QFileInfo) being added to QtCoreMarc Mutz2012-07-261-3/+0
| | | | | Change-Id: Ibf1f9a451164982bcd50195b210c5b59e684937e Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Work around Q_DECLARE_METATYPE(QFileInfo) being added to QtCoreMarc Mutz2012-07-251-0/+2
| | | | | Change-Id: Ic83e5fdaa7ef289f40cbeb4633a75d93d38c0bdb Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add I18N support to qmlsceneCharles Yin2012-07-171-1/+35
| | | | | | Task-number: QTBUG-22391 Change-Id: Id567d4aabf47ce4790cf33979c4e464ba4f09357 Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>
* QQuickCanvas renamesAlan Alpert2012-07-171-1/+1
| | | | | | | | | | | | | | | | QQuickCanvas is now called QQuickWindow QQuickCanvas::rootItem is now QQuickWindow::contentItem QQuickItem::canvas is now QQuickItem::window QQuickItem::ItemChangeData::canvas is also renamed window QQuickCanvas::grabFrameBuffer is now QQuickWindow::grabWindow The functions related to the color property have dropped the clear from their names. The first three changes have interim compatibility measures in place to ease the transition. Change-Id: Id34e29546a22a74a7ae2ad90ee3a8def6fc541d2 Reviewed-by: Martin Jones <martin.jones@nokia.com>
* Remove some unnecessary indirection.Robin Burchell2012-06-251-17/+14
| | | | | | | | There's no need to heap allocate our QQuickView, and there's no need to have a seperate pointer to QWindow when we can just use the QQuickView directly. Change-Id: Ia2bc83c9dc83d1df1ec793836793f752d67e9415 Reviewed-by: Alan Alpert <alan.alpert@nokia.com>