summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Merge remote-tracking branch 'origin/api_changes'Lars Knoll2012-03-041-1/+1
|\ | | | | | | | | | | | | | | | | | | Conflicts: dist/changes-5.0.0 mkspecs/features/qt_module_config.prf qmake/project.cpp qmake/property.cpp Change-Id: I6e4af40743a9aeff8ed18533a48036e332acc296
| * QEvent (and subclasses): make ctors explicitMarc Mutz2012-03-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Do this regardless of whether the event subclass is public API or only used in examples. Examples are examples, used by others as templates or even copied verbatim, so they should also follow sound engineering rules. Anyway, there's only one in examples/... Change-Id: I586ff16407a956c9e89288fdd4377eed73f45c0f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* | Change bugreports.qt.nokia.com -> bugreports.qt-project.orgSergio Ahumada2012-03-021-1/+1
| | | | | | | | | | Change-Id: Ia795098f24cf358b15067f54cd08dff0bd792bc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Cleaned up examples/opengl/cube/cube.pro, removed message()Rohan McGovern2012-02-291-9/+0
|/ | | | | | | | | It's arbitrary and confusing to put a message(OpenGL support is enabled) in this one OpenGL example and no others, especially since the message is output during configure. Change-Id: I7b55868d10c288f3459a7fda594fea1e6f45bf9a Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Use new plugin system in qtbase.Friedemann Kleint2012-02-2719-28/+33
| | | | | | | | | - AccessibleWidgets - Windows printer support - Examples Change-Id: Icc162bd7fc284b3c76d9966210f983728085c743 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix compilation of examples with QStringBuilderOlivier Goffart2012-02-253-5/+5
| | | | | | | | | | | | In sub-attack an interview, one can't make two implicit conversions at once, so explicitly convert to the right type. The change in the torrent example is required because of https://codereview.qt-project.org/16168 (commit 9491272) But in that case, using a QByteArray is better anyway. Change-Id: Ieed22ac7f0d700d5ba5d1e70af3db4dd6c139c8f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* examples: compile w/o openglMarc Mutz2012-02-248-13/+20
| | | | | | | Fixes remnants of an automated QtGui -> QtWidgets port. Change-Id: I31f63bdd6ae71aee8e70b20e24def30e0eafb725 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* clean up qmake-generated projectsOswald Buddenhagen2012-02-2428-219/+23
| | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Test for QT_NO_SSL instead of QT_NO_OPENSSLShane Kearns2012-02-213-5/+5
| | | | | | | | Change the ifdefs in our own code (except openssl backend) to use the new configure flag. Change-Id: I8774734771c66b22164b5fae8fdb27814ac3df7b Reviewed-by: Richard J. Moore <rich@kde.org>
* Fortune client example - list all IP addressesShane Kearns2012-02-172-18/+28
| | | | | | | | | | | The first IP address on the machine might not be a usable one. Changed the QLineEdit to a QComboBox, and populated it with all IP addresses of the machine, along with the machine names if they are configured. Task-number: QTBUG-13121 Change-Id: I7c443f5ce6efb0d0b525c5abad1671d3dcbba33c Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Move QtConcurrent into its own moduleLars Knoll2012-02-0510-5/+11
| | | | | | | Task-number: QTBUG-20892 Change-Id: I614500aafb6428915509983608bbb0ade4e4f016 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Exclude helloconcurrent when QtConcurrent is not configuredSamuli Piippo2012-02-051-1/+2
| | | | | | | Task-number: QTBUG-23874 Change-Id: I374a08ce947e804ebb1da08c413e340e4719d9d0 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Fix the chart itemview exampleGiuseppe D'Angelo2012-02-032-2/+3
| | | | | | | | | | | Commit 054a4aa7dddacbe31778c5c5e9ffc9d41f803353 (being a SIC) breaks QAbstractItemViews that used to override the dataChanged(QModelIndex, QModelIndex) method, so this change updates the dataChanged signature accordingly. Change-Id: I632b6625c12dcb09abcb737ea2648efeeedeee8e Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Improve QSurface / QWindow API a bit and use that to avoid errorsGunnar Sletta2012-02-021-0/+2
| | | | | Change-Id: Iadba1c3a7b8e6bc7f145455132cefed2a905c11d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Reimplement QAbstractSocket::setReadBufferSize() properlyBradley T. Hughes2012-02-022-2/+2
| | | | | | | | | | | | | | | | | This function takes a qint64 argument, not an int argument. peerwireclient.h:119:10: warning: 'PeerWireClient::setReadBufferSize' hides overloaded virtual function [-Woverloaded-virtual] void setReadBufferSize(int size); ^ src/network/socket/qabstractsocket.h:162:18: note: hidden overloaded virtual function 'QAbstractSocket::setReadBufferSize' declared here virtual void setReadBufferSize(qint64 size); ^ Change-Id: I29b67b216147771ff2d662d309d2c31d977e9d3f Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi>
* Moving tiff image format support and libtiff out of qtbaseaavit2012-01-312-2/+2
| | | | | | | | | | The tiff plugin and bundled libtiff is moving to the qtimageformats project on Gerrit. Task-number: QTBUG-23887 Change-Id: I4c848232fdccddd7e7f54215f9eaa78dc4c3a53d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove Symbian specific code from qtbase.Xizhi Zhu2012-01-313-8/+0
| | | | | Change-Id: I27d37d914b71e1e43c94e2a975ffec49e1ecd456 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Add support for DNS lookups using native APIsJeremy Lainé2012-01-304-0/+229
| | | | | | | | | | | | | | | | The QDnsLookup class provides asynchronous APIs for performing DNS lookups. For now, the following lookups are supported: - A and AAAA - CNAME as defined per RFC 1035 - MX as defined per RFC 1035 - NS as defined per RFC 1035 - PTR as defined per RFC 1035 - SRV as defined per RFC 2782 - TXT as defined per RFC 1035 Task-number: QTBUG-10481 Change-Id: I46c1741ec23615863eeca3a1231d5e3f8942495e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301180-1181/+1144
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove support for the MNG file format and the bundled libmngaavit2012-01-254-4/+3
| | | | | | | | | | | | | The MNG file format is generally abandoned, and libmng has been unmaintained for several years. The MNG plugin and bundled libmng has been moved to the qtimageformats project on Gerrit. Task-number: QTBUG-21869 Change-Id: I946432347014ffde2b72307a5f8b166ca5553602 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Made window orientation API more flexible.Samuel Rødal2012-01-242-31/+26
| | | | | | | | | | | | | | | Previously we only had QWindow::setOrientation() which was a hint about the orientation the window's contents were rendered in. However, it's necessary to separate between the orientation corresponding to the window buffer layout and orientation of the contents. A game for example might typically want to use a landscape buffer even on a portrait device. Thus, we replace QWindow::orientation() with QWindow::reportContentOrientationChange() and QWindow::requestWindowOrientation(). Change-Id: I1f07362192daf36c45519cb05b43ac352f1945b5 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update obsolete contact address.Jason McDonald2012-01-234-6/+2
| | | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: Id689fdb78727abafba033bed7b0402e2cf27aba1 Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231143-1143/+1143
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* QPA/windows example: Fix positioning for virtual desktops.Friedemann Kleint2012-01-201-0/+4
| | | | | | | Position window within screen geometry. Change-Id: Id931f386c9ef5564887a2f54b71921f062320f54 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove QDir::convertSeparators()Lars Knoll2012-01-191-1/+1
| | | | | | | | | This method has been deprecated since Qt 4.2. QDir::toNativeSeparators() replaces it since then. Change-Id: I49e6e1bfd50f26aa30134e599ee82067709549a7 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Fixes examples/tests to use qinptr in QTcpServer::incomingConnection.Jonas M. Gastal2012-01-136-6/+6
| | | | | | | | This is a fix for problems introduced by bf7f170. Change-Id: If5dd8e031ef2efea578b3efb188c2e950e1ba41a Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>