summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Fix building of qtbase examples when printsupport module is disabled.Janne Anttila2012-06-1822-15/+49
| | | | | | | | | | | Printsupport module is not that interesting in embedded environments, and it also does not compile at the moment for WEC7. Fixed qtbase examples to obey the availability of printsupport module. Change-Id: I960d1b628b9ca82450aa3b0df8dd101b2544ee12 Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix encoding of non-ASCII stringsThiago Macieira2012-06-144-10/+10
| | | | | | | | | tr() only takes UTF-8 as input, so we must recode to UTF-8. But we can use QLatin1String elsewhere. Task-number: QTBUG-26086 Change-Id: I5932ddc96fb817dbe01106e5f6f2b10f58472d6b Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Change path for 'mousebuttons' widgets exampleGatis Paeglis2012-06-141-2/+2
| | | | | | | Task-number: QTBUG-26121 Change-Id: Icaeb6038d166fb0ffadf1657ddef21c18b3d3be6 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Add install path for qpa windows exampleGatis Paeglis2012-06-141-0/+6
| | | | | | Task-number: QTBUG-26150 Change-Id: I8e981318e05cca6628160aea31281f8e3baaa50f Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Use a QVector<int> instead of a QSet<int> in itemviews/models.Stephen Kelly2012-06-122-2/+2
| | | | | | | | | | | | | | The QSet<int> is a more expensive container to use and create, so it should be avoided. This is source incompatible compared to earlier Qt 5 for QAbstractItemView subclasses which reimplement dataChanged, but this patch changes nothing compared to already-present SiC compared to Qt 4. Change-Id: Id95391dfd62a0a7f487a8765790b007badefb937 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Replace deprecated QGraphicsScene::itemAt() with items()Thiago Macieira2012-06-091-1/+2
| | | | | Change-Id: I33ee03db775d3cf6807372e0963748cf6a4e07db Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Fix assert in painting demos when switching to OpenGL.Friedemann Kleint2012-06-091-3/+6
| | | | | | | | | | Fix creation order. The ArthurFrame receives a paint event with OpenGL set to true when the glw-member is still 0. Task-number: QTBUG-26084 Change-Id: Ib4b568d22ae925542e3a775403e4c983ea0b4de5 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix compilation of examples with -no-widgetsKent Hansen2012-06-075-5/+5
| | | | | | Change-Id: Ie0e19daf6c6476b5c5130f4930dfa3df92917384 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove widgets dependency from xmlstreamlint exampleKent Hansen2012-06-071-1/+1
| | | | | Change-Id: I2c7609077bd18864ffd9b2ba5086eb590aff3df0 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove widgets dependency from qtconcurrent/map autotestKent Hansen2012-06-072-3/+3
| | | | | Change-Id: I734ae73a530ab6eb27271586040ef910e6ad0e2c Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove useless "QT += widgets"Kent Hansen2012-06-0513-22/+0
| | | | | | | | These .pro files have TEMPLATE=subdirs, so there's no reason to be adding libraries here. Change-Id: I0fb0a44107710ee746d354106d0c46006958ee62 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix digiflip example build.Janne Anttila2012-05-311-0/+2
| | | | | | | digiflip examples depends on qtwidgets, let's link to it also. Change-Id: I4f4434c747d143942909797491153a4f358e6fef Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Remove the MacMainWindow example.Morten Johan Sorvig2012-05-305-506/+0
| | | | | | | | | | | | | | setUnifiedTitleAndToolBarOnMac will not be supported on Qt 5, which removes the point of having this example. The replacement for setUnifiedTitleAndToolBarOnMac will be a NSToolBar wrapper in the MacExtras module, and this example will probably re-appear in some form there. Change-Id: I46d5e70a7c45625d9334911bb48059e86f05282d Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* QApplication::syncX doesn't do anything in Qt 5 anymoreThiago Macieira2012-05-292-2/+0
| | | | | Change-Id: I325f8badeb5bd7120c691b49fdf51dc9b2649f68 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Replace QVariant::typeToName usage by QMetaType::typeName call.Jędrzej Nowacki2012-05-281-2/+2
| | | | | | | | | Type information is kept in QMetaType class. QVariant is delegating operations, so it is better to use QMetaType directly. Change-Id: I91209fa1c9dc4303d6bd47c96824d3cd64ce5291 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* OpenGL/HelloWindow example: Fix resource leaks.Friedemann Kleint2012-05-253-10/+21
| | | | | Change-Id: Icf776b5581b3a632e8cef19af1059503146c158c Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Fixed unused paramater warning in download example.Mitch Curtis2012-05-221-0/+2
| | | | | Change-Id: I9688ff6a583591f04aa81bb2714c33fc02da77c7 Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fixed "No such signal" error in download example output.Mitch Curtis2012-05-221-0/+3
| | | | | | | | | The signal sslErrors is not defined by QNetworkReply when QT_NO_SSL is undefined. The solution was to add the an ifndef guard around the call to connect so that the signal is only used when it is defined. Change-Id: I9f104ec630ed448af65669b0861df233de5172ac Reviewed-by: Martin Petersson <Martin.Petersson@nokia.com>
* Fixed unused variable warning in anchorlayout example.Mitch Curtis2012-05-191-23/+23
| | | | | Change-Id: I54c6e471531485e33b20b6a6da7f52dab5c3a32a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fixed unused variable warning in chart example.Mitch Curtis2012-05-191-5/+0
| | | | | Change-Id: I0985ff1b1224b29a394ae2a594aeaa783d650ffa Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fixed unused parameter warning in hellowindow example.Mitch Curtis2012-05-181-0/+2
| | | | | Change-Id: I48ea19b5548a179d8116685fa481c4d1b3804bba Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Fixed unused variable warning in diagramscene example.Mitch Curtis2012-05-181-1/+0
| | | | | | Change-Id: I85cc038602e22c140f0564b15ebcb3872750b162 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge "Merge branch 'docs-refactoring' into master" into refs/staging/masterMarius Storm-Olsen2012-05-101-0/+2
|\
| * Merge branch 'docs-refactoring' into masterMarius Storm-Olsen2012-05-101-0/+2
| |\ | | | | | | | | | Change-Id: Iebd1966abace3cdf7f9428dcfc1ded5b124ab113
| | * Properly implement a 'make docs' target for subdirs and apps/libsMarius Storm-Olsen2012-05-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only call qdoc for projects which sets the QMAKE_DOCS variable to point to a qdocconf file. Exclude examples/ and tests/ from the qdoc run, by adding no_docs_target to CONFIG for those projects. Change-Id: Ic856c8f19db59309302d0602b3e99735609e525a Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* | | gettingStarted, part 3-5: sanitize parameter names and compile fixhjk2012-05-106-6/+9
|/ / | | | | | | | | Change-Id: I12795439de71a41728f98b3d3438324664b27a0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | gettingStarted: sanitize parameter names and compile fix for Qt 5hjk2012-05-094-5/+7
| | | | | | | | | | Change-Id: I3f30ccee89b8add8718a9a36f0f16fa7b2e9bad1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* | Expose QPA API under qpa/*Girish Ramakrishnan2012-05-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main reasons for doing this are: 1. _qpa.h end up in the master QtGui include file. QtGui is meant for userland applications. qpa code is neither binary nor source compatible. Inadvertant use of QPA api makes the user code binary-incompatible. 2. syncqt creates forwarding headers for non-private header files. This gives people the impression that this is public API. As discussed on the mailing list, even though QPA api is internal and subject to change, it needs to treated differently from private headers since they will be used by in-qtbase and out-of-qtbase plugins. This commit does the following: 1. The _qpa in QPA header files is dropped. 2. syncqt now treats any file with qplatform prefix as a special file and moves it to qpa/ directory. The recommended way of using QPA API in plugins is: #include <qpa/qplatformfoo.h>. This allows the user include QPA API from multiple modules (for example, qplatformfoo might be in QtPrintSupport) 3. The user needs to explicitly add QT += <module>-private to get access to the qpa api. 4. Creates compat headers for the olden style qplatformfoo_qpa.h and QPlatformFoo includes. This commit does not change the cpp filenames. This requires a more careful merging of existing non qpa cpp files and existing cpp files on a case by case basis. This can be done at anytime. The following files are not renamed as part of this changed but will be fixed as part of a future change: src/gui/kernel/qgenericpluginfactory_qpa.h src/gui/kernel/qgenericplugin_qpa.h src/gui/kernel/qwindowsysteminterface_qpa.h files were renamed using for x in `find . -name "qplatform*_qpa.h"`; do git mv $x "${x/_qpa.h/.h}"; done for x in `find . -name "qplatform*_qpa_p.h"`; do git mv $x "${x/_qpa_p.h/_p.h}"; done includes were renamed using script for file in `find . -name "*.h" -or -name "*.cpp" -or -name "*.mm"`; do sed -i -e 's,.*#.*include.*<\(Qt.*/\)\?\(QPlatform.*\)>,#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.*"\(Qt.*/\)\?\(QPlatform.*\)",#include <qpa/\L\2.h>,g' \ -e 's,.*#.*include.* "\(qplatform.*\)_qpa.h",#include <qpa/\L\1.h>,g' \ -e 's,.*#.*include.*"\(qplatform.*\)_qpa_p.h",#include <qpa/\L\1_p.h>,g' \ -e 's,.*#.*include.*<\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)>,#include <qpa/\2\3>,g' \ -e 's,.*#.*include.*"\(Qt.*/\|Qt.*/private/\|private/\)\?\(qplatform.*\)_qpa\(.*\)",#include <qpa/\2\3>,g' \ $file done Change-Id: I04a350314a45746e3911f54b3b21ad03315afb67 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* | Rename setResizeMode to setSectionResizeMode.Stephen Kelly2012-05-076-6/+6
|/ | | | | | | | | The overload of this method was renamed in b64426248d2212eb59535b2ca383d30fdb5e1c7a but this one was not. Change-Id: I60a6ddf0fcf9deea31ccf51e7b0db16c66023356 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [platformsupport]Thiago Macieira2012-05-042-4/+4
| | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ie1a4e5ceca21c31e7357f28b90abc9129b122104 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtNetwork]Thiago Macieira2012-05-041-1/+1
| | | | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I94cc301ea75cc689bcb6e2d417120cf14e36808d Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Shane Kearns <shane.kearns@accenture.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* Use org.example instead of com.trolltech for the D-Bus examplesThiago Macieira2012-04-2218-31/+31
| | | | | | | | | | We could use org.qtproject, but since this is an example anyway, and since example.org and example.com are reserved to IANA by RFC 2606 anyway, let's use that. Task-number: QTBUG-23274 Change-Id: Icdb1ac0390f88b72fa21b02ab362f1a98f26266c Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
* Examples: Don't use deprecated methodsOlivier Goffart2012-04-2114-26/+28
| | | | | Change-Id: Ib6e795f6b5bb6a3ac19882a5fb224460ef1fc8ad Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Made hellowindow example respect the expose event.Samuel Rødal2012-04-202-4/+11
| | | | | | | The expose event is sent when the window can start rendering. Change-Id: Ifdfb01a107e3bf665fb7be65802cdaabea4c5a34 Reviewed-by: Laszlo Agocs <laszlo.p.agocs@nokia.com>
* Compile fix if QT_NO_CLIPBOARD definedAndreas Holzammer2012-04-192-0/+18
| | | | | Change-Id: Ie8ecaa2ba8f99d0b531b3a81b5f0005508e677eb Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Compile fix if QT_NO_CLIPBOARD definedAndreas Holzammer2012-04-192-0/+13
| | | | | Change-Id: I818122f2b2d2119248ad2e84b138aab8ab621a41 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Merge remote-tracking branch 'origin/master' into api_changesOswald Buddenhagen2012-04-101-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: configure src/widgets/styles/qwindowsxpstyle.cpp tests/auto/gui/kernel/qwindow/qwindow.pro tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I624b6d26abce9874c610c04954c1c45bc074bef3
| * Fix multicast join/leave when binding to QHostAddress::Any.Robin Burchell2012-04-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On OS X and Windows, this was not working, because the socket was being bound in v6 mode (due to ::Any being for dual mode), but the address passed was a v4 address, meaning it took the wrong codepath. Linux, strangely, apparently works anyway. This is fixable in OS X (by using the v6 join path when bound in v6/dual mode), but the same fix doesn't work on Windows, failing with WSAEADDRNOTAVAIL. Don't allow this behaviour, and provide a sane error message telling the user what to do instead. Done-with: Shane Kearns Task-number: QTBUG-25047 Change-Id: Iaf5bbee82e13ac92e11b60c558f5af9ce26f474b Reviewed-by: Shane Kearns <shane.kearns@accenture.com>
* | Merge master into api_changesKent Hansen2012-03-232-3/+6
|\| | | | | | | Change-Id: I93551e4d13a1b0815b359b9415060e9089477db1
| * Disable some tests and examples when --no-widgets is specifiedJędrzej Nowacki2012-03-192-3/+6
| | | | | | | | | | | | | | | | There are many tests, examples that depends on widgets. This patch disables some of them if Qt is configured without widgets. Change-Id: I5460dadca736c54221874adcd518a7021725d90a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* | Got rid of Map / Unmap events in favor of Expose event.Samuel Rødal2012-03-221-7/+7
|/ | | | | | | | | | | | | | | | | | Since change 2e4d8f67a871f2033 the need for Map and Unmap events has gone away, as now the Expose event is used to notify the application about when it can start rendering. The Map and Unmap events weren't really used except by QWidget to set the WA_Mapped flag, which we now set based on the expose / unexpose. Also guarantee that a Resize event is always sent before the first Expose, by re-introducing an asynchronous expose event handler. Since an expose is required before rendering to a QWindow, show a warning if QOpenGLContext::swapBuffers() or QBackingStore::flush() if called on a window that has not received its first expose. Change-Id: Ia6b609aa275d5b463b5011a96f2fd9bbe52e9bc4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove all QWS centric examplesDonald Carr2012-03-1537-3192/+0
| | | | | | | | Change-Id: I1bd9c40c7cc70e088a23283d1c3e89d12c1c5f7d Reviewed-by: Donald Carr <donald.carr@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
* Use QRect::united(), QRect::unite() is deprecated.Sergio Martins2012-03-142-2/+2
| | | | | Change-Id: Ia7aac74596c2f251c96fecf157d2aa4a935cf602 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix icon suffixes in systray example.Friedemann Kleint2012-03-131-3/+3
| | | | | Change-Id: If464befa88f26a881557724b4fc175f0a82c90b6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Re-add the Systray example.Friedemann Kleint2012-03-129-1/+467
| | | | | | | | Remove its dependency on QtSvg by converting the icons to (optimized) png files. Change-Id: If63257938dc816d7ab76a3042b9ac88ef3d51b07 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* examples: compile w/QT_NO_CAST_FROM_BYTEARRAY, at least on UnixMarc Mutz2012-03-085-9/+9
| | | | | | | | This is all pretty straight-forward, adding .constData() or using QString::fromLatin1() instead of QLatin1String(). Change-Id: I984706452db7d0841620a0f64e179906123f3849 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* examples: use QVector<QPointF> instead of QList<QPointF>Marc Mutz2012-03-082-7/+4
| | | | | | | | | | | QPointF is in the category of types for which QList is needlessly inefficient (elements are copy-constructed onto the heap and held through pointers). Use a vector instead. This is consistent with the QPainter API. Change-Id: Id0e910c067a60d12fbc175e7ee7da824834be374 Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Example build fix.Jędrzej Nowacki2012-03-071-0/+0
| | | | | | | | | | buttontester.pro has to be renamed to mousebuttons.pro because it lives in mousebuttons subdirectory, to which examples/widgets/widgets.pro is pointing by SUBDIRS variable. Change-Id: I04bbd85713321337fbe8cbccfa6284f12b677279 Reviewed-by: Rick Stockton <rickstockton@reno-computerhelp.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* add widget mousebuttons example 'mousetester'.Rick Stockton2012-03-065-0/+321
| | | | | | | | | | This is an xev-like program. A user clicks a mouse button inside the Window, and the program displays (a) the "raw" button number; (b) the corresponding Qt::MouseButton name; and (c) the type of mouse Event. Task-number: QTBUG-24112 Change-Id: I8a76ff37b5b85639f662706072cc4a2ce490754b Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* add strategy support to sqlbrowser exampleMark Brand2012-03-063-79/+200
| | | | | | | | | | | Several useful options added to context menu. Also added yellow background for unsubmitted changes. Change-Id: I132cd4498a5fb7275ea10c0497910aba99c06a2b Reviewed-by: Honglei Zhang <honglei.zhang@nokia.com> Reviewed-by: Yunqiao Yin <charles.yin@nokia.com>