summaryrefslogtreecommitdiffstats
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* Remove some more register keywordsMarc Mutz2017-05-091-1/+1
| | | | | | | | They're deprecated since C++11 and removed in C++17. Change-Id: Ia2acd9312707bfee96838743645a04ae1780e5dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b92267cd4c4a7c88aab950ad519943d85add1da2)
* Update bookmarks in the XML bookmarks examplesFriedemann Kleint2016-11-016-819/+57
| | | | | | | | Update URLs in jennifer.xbel and remove frank.xbel, which has too many outdated URLs Change-Id: I8cbc1e3988f45230f849e68202780c76cf4353d9 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Doc: Fix typos: handing > handlingTopi Reinio2016-10-281-1/+1
| | | | | Change-Id: Iecc64cba620ec639d06684e30264171052f21e10 Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
* Handle short reads in the local sockets exampleSérgio Martins2016-10-063-5/+6
| | | | | | | | | | | | | Protection against short reads was already half implemented, blockSize was being sent by the server but never used by the client. Also, blockSize was bumped to quint32: If you're in a position where short reads can happen then quint16 is probably not enough to hold the size of your data. On Linux I could only reproduce short reads for messages > 500K. Change-Id: I191a3d781da1d8a119debbdafae641c8340a1da2 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Fix compilation of findfiles examples with QT_NO_CLIPBOARDFriedemann Kleint2016-09-051-3/+7
| | | | | | | | Amends change d1a30be5abcc2d5e5340866434b2691275a135a6. Task-number: QTBUG-55661 Change-Id: Ib7b1b4afd71b3c35493c15c8bf3e2570e321c986 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Add missing \l to create link to QString in the docsSimon Hausmann2016-08-121-1/+1
| | | | | | Change-Id: I980da5cd47ebc62d0b2f028b79b331b87d07e070 Task-number: QTBUG-55258 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Change instances of '(Mac) OS X' to 'macOS'Topi Reinio2016-08-125-10/+10
| | | | | | | | | | | | | | | As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change the occurrences where the Mac platform is discussed to use a macro \macos, which expands to 'macOS'. This helps with adapting to future renaming. Update the instructions on mac-specific Q_OS_* macro usage. Add a \target for the old 'Qt for OS X' topic to keep links working for other documentation modules that try to link with the old name. Change-Id: Id33fb0cd985df702a4ae4efb4c5fd428e77d9b85 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Doc: Fix typo in the Semaphores ExampleTopi Reinio2016-08-111-1/+1
| | | | | Change-Id: I140915014836a3bbc449c953aa54452483b0b886 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* Update logo icons in icons exampleFriedemann Kleint2016-08-104-0/+0
| | | | | | Task-number: QTBUG-55137 Change-Id: I51a16a40112f5f5bbea00540178999382752a6f2 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* HiDPI Drag and Drop: Properly render the default image on MacGabriel de Dietrich2016-08-091-1/+3
| | | | | | | | | | | | | | | | | This is only when the attached MIME data contains text, and we fall back to rendering that text into a pixmap. It requires getting the device pixel ratio from the source which, for now, may be a QWidget or a QWindow. Other cases may exist, but that would bring more dependencies than desired. Similarly, it fixes the draggabletext example. Other examples would require either to get updated pixmaps or change substantially in order to support HiDPI (e.g., the fridgemagnets example). Change-Id: I66198214233e3e06c87505744e2aaa9691fe1bb6 Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix rasterwindow exampleJake Petroules2016-08-041-1/+1
| | | | | | | | | At least with the eglfs platform plugin, the QBackingStore constructor results in a null pointer access if done before creation. Change-Id: I2e78e70700fa48499a35c55797e1b962b6e6285a Reviewed-by: Rebecca Worledge <rebecca.worledge@theqtcompany.com> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Polish the findfiles example to be actually usefulFriedemann Kleint2016-08-033-48/+135
| | | | | | | | | | | | | | - Simplify the code, remove unused members - Fix the translations of plurals to use %n - Add tooltip displaying full paths in list - Add context menu allowing to copy the name and open - Display the correct slashes on Windows - Connect the returnPressed() signals of the line edits - Make the search recursive - Do not search binary files by checking the mime type Change-Id: I3663799c88931db1f58c03ea35211e7ab03737ec Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Polish the codecs exampleFriedemann Kleint2016-08-034-118/+227
| | | | | | | | | | | | | | - Port to Qt 5 connection syntax. - Remove unneeded member variables. - Adapt to screen size. - Add a tab widget with a hex dump view to the preview dialog. - Handle conversion errors in preview dialog, add status label displaying errors and warnings about failures and invalid characters encountered. - Fix translated messages. Change-Id: I916100c903e73d0d2326523753ed7398b1c34df0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Polish charactermap exampleFriedemann Kleint2016-08-024-29/+117
| | | | | | | | | | | | | - Use Qt 5 connection syntax. - Introduce helper function to calculate the square size, remove the existing 24 pixel limitation since that makes it impossible to render 20pt fonts. - Add filter chooser for font filters. - Add menu and info dialog showing DPI and default fonts. - Streamline code Change-Id: I0cd4d0475b5a7ed3c475de7a413abebbe688dfe2 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* examples: use QSignalBlockerMarc Mutz2016-07-282-29/+34
| | | | | | | | | | | | | Examples should show idiomatic Qt, and QSignalBlocker is idiomatic since it's inception in Qt 5.3. Just updating the examples was forgotten. This commit makes good for that. Fix coding-style issues as a drive-by. Change-Id: If138e87ea2ab7a444599734113f7cc6df11fb42d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* PathStrokeRenderer::initializePoints(): use float divisionEdward Welbourne2016-07-151-1/+1
| | | | | | | | | | The (example) code used a real to hold 360 / 7, which is of course 51, discarding the 3/7 that was most likely meant to be kept. Noticed by Coverity (CID 22364). Use 360.0 instead of 360 to get more accurate results. Change-Id: Ifdfbb932589d8ea728710e8b656af651c9f8a7d2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Examples: Fix stringification of the Qt versionThiago Macieira2016-07-021-1/+1
| | | | | | | | | | (QT_VERSION % 0xffff00) is useless for now, as QT_VERSION < 0x1000000 (for now). The author of this code probably meant to use bitwise-AND. But even that is unnecessary as the right shift discards the lower 8 bits anyway. Change-Id: Ie585843cfb684bc3b6e3fffd145d533b05288dfc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* mainwindow example: fix creating custom QDockWidgetOlivier Goffart2016-06-241-1/+1
| | | | | | | | The signal was connected to the wrong slot. Regressed in 2fe56e37ede40dc703a9c3c8eb240b80c9c00757. Change-Id: I33135fc79c3585dfbe0f6ebc04f819e919ed9ed7 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* Add install target to mac widget examplesAndy Nichols2016-06-012-0/+7
| | | | | | | Change-Id: I524ba3fcc82a6ef015241d90f212059ae7772443 Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* OpenGL legacy example: Fix compilation in namespaced builds.Friedemann Kleint2016-05-271-1/+2
| | | | | | | Change-Id: I6b2f3e8c240e105c73008fa61f9ed50cc9d982ac Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Fix httpwindow example.Jake Petroules2016-05-261-3/+3
| | | | | | | | DownloadLocation is not writable on some platforms (iOS) in Qt 5.6, and qt-project.org HTTPS does not work anymore. Change-Id: I78bfbee1472cd39cd05ec7f846d1195d4fbb1b2c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* Dirview example: Add option for DontUseCustomDirectoryIcons.Friedemann Kleint2016-05-111-0/+5
| | | | | | | | This enables people to toy around with the option and check what impact it has. Change-Id: I8b49c31211cc48721b3326eea48b4e74967b1a92 Reviewed-by: Sérgio Martins <iamsergio@gmail.com>
* fix example installsOswald Buddenhagen2016-05-0313-11/+25
| | | | | Change-Id: Ib34795f10b1d7120b28958127ced049af3b4f72b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* delete unreferenced fileOswald Buddenhagen2016-05-031-264/+0
| | | | | Change-Id: Ibc70cafdc098ff4f6036182d6f41a2debb15a996 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* install the opengl legacy examplesOswald Buddenhagen2016-05-031-0/+3
| | | | | | | | while they are not built, their sources should be installed as long we don't delete them completely. Change-Id: I5e628e96cc9715520cb6e5aadb2cae61d1d03a4f Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* fix build and installation of queuedcustomtype exampleOswald Buddenhagen2016-05-033-2/+6
| | | | | | | | it was not built at all (and didn't build with qt in a namespace), and consequently was not installed as well. Change-Id: I24d8ac4dd5d70927c262ad6336e5ee32a0fd003a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* normalize structure of plugandpaint exampleOswald Buddenhagen2016-05-0321-95/+97
| | | | | | | | as in other examples which come with plugins, use an additional hierarchy level which contains the app and plugin subdirs. Change-Id: I2487755967aa3474c337c8c8af10be49627b63d0 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Add missing indentationAllan Sandfeld Jensen2016-04-281-16/+16
| | | | | | | Discovered with gcc 6. Change-Id: Ib5ba49df6a1f4d9574842ffe5f3e9856da0e60d0 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* OpenGL/contextinfo-Example: Add command line options and status label.Friedemann Kleint2016-04-232-0/+29
| | | | | | | | | | Add command line options to be able to set the QCoreApplication attributes that influence Open GL context creation and add a status label at the bottom that displays it besides the QT_OPENGL environment variable. Task-number: QTBUG-52693 Change-Id: Id9793292596e0feb3da5220fde2e5b2e495f87ff Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Fix compiling examples with -no-smJoni Poikelin2016-04-072-1/+6
| | | | | | | | There is access to session manager functions which are not present when building with -no-sm. Change-Id: I1c92b4a70f7adb56816877930fb9f55b04ff8940 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
* Remove empty first lines of files.Friedemann Kleint2016-04-061-1/+0
| | | | | | | They might upset licensing related tools. Change-Id: I858d21fc418ba16959c88847b559b11bea29ed6b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QtXml/htmlnfo example: Remove Nokia-related HTML demo file.Friedemann Kleint2016-04-062-216/+0
| | | | | Change-Id: I0b0ebcf20747a607ad9eed130d7b4fe810a1f2e1 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6.0' into 5.6Frederik Gladhorn2016-03-172-0/+18
|\ | | | | | | Change-Id: Iac8ff05cd76cbacf859138a73e8e2ed0a979c75a
| * Add option to disable "session management by closing windows".Andreas Hartmetz2016-02-152-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That feature is a poor man's session management for applications that do not implement any specific session management features. It badly interferes with proper session management support, so applications must be able to disable it. This enables fixing applications with QGuiApplication::quitOnLastWindowClosed() true - the default - dying too early, before they are enumerated for the list of applications to restart on session restore, thus preventing them from being restored. See https://bugs.kde.org/show_bug.cgi?id=354724 [ChangeLog][QtGui] Qt asking to close windows on session exit as a fallback session management mechanism has been made optional. Disabling it fixes session management for applications that implement full session management. See QGuiApplication::isFallbackSessionManagementEnabled(). Task-number: QTBUG-49667 Change-Id: Ib22e58c9c64351dea8b7e2a74db91d26dd7ab7aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | Skip spurious .toLower() on returns of QUrl::scheme()Edward Welbourne2016-03-101-1/+1
| | | | | | | | | | | | | | | | | | QUrl::setScheme() parses and canonicalises the scheme, so that scheme() always returns a lower-case string anyway; no need to .toLower() it. Change-Id: Ied00814b63f159386a42552dcf06346ee56f9f97 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
* | Standarddialogs example: Remove horizontal spacer from fullscreen layout.Friedemann Kleint2016-02-091-1/+0
| | | | | | | | | | | | | | | | It does not work as expected since the QLineEdits do not expand. Amends b880b7e1ac15f3458c009d63002c872e7521eeab. Change-Id: I0b3b3822cca7fc6442a7155eecd46bd3d134d069 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Doc: Replaced Trolltech logo with Qt logoNico Vertriest2016-02-034-0/+0
|/ | | | | | Task-number: QTBUG-37505 Change-Id: If59039b2f7e60ffea3e8c7803d38e528acf35383 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* Polish the Tablet exampleShawn Rutledge2016-01-287-452/+339
| | | | | | | | | | | | | | | | | | | | | - Introduce Qt 5 signal-slot connection syntax. - Merge MainWindow::createMenus()/createActions() into MainWindow::createMenus(), removing the need to store the actions as member variables. Use QMenu::addAction() for brevity. - For actions in QActionGroups, carry the Valuator enum in QAction::data so that the slot to handle the selection does not need to compare the QAction pointer itself. - Use a non-modal QColorDialog, so that the user can change colors more easily while drawing. - Choose saner shortcut keys: control-Q should not override the default usage for quitting the application, and using shortcuts for About dialogs is anyway dubious. - Improve the example documentation. Change-Id: I57aaf5f5b885c13a953482dbcc41275dd3d6bff4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Doc: Added brief statement to XML examplesNico Vertriest2016-01-262-0/+3
| | | | | | Task-number: QTBUG-50261 Change-Id: I0ba4bd630746612d0f1f1632e87c6fdd6aef160f Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Doc: removed double occurrence of systray.qdocNico Vertriest2016-01-262-186/+6
| | | | | | Task-number: QTBUG-50287 Change-Id: Iaf8602fc338dadcc0998f33d41ad9fbc827589e2 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* Doc: Added brief statement for examples overview pageNico Vertriest2016-01-262-0/+3
| | | | | | Task-number: QTBUG-50261 Change-Id: Ia0daf0c5c7fc0b2e54904f0b7fe6ebe1220e5c4d Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2016-01-191-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/common/atomic64/atomic64.cpp configure src/3rdparty/forkfd/forkfd.c src/corelib/io/forkfd_qt.cpp src/widgets/kernel/qwidgetwindow.cpp tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp tests/auto/network/socket/qtcpsocket/tst_qtcpsocket.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp tools/configure/configureapp.cpp Change-Id: Ic6168d82e51a0ef1862c3a63bee6722e8f138414
| * Use unique shortcuts for the different actionsAndy Shaw2015-12-111-2/+2
| | | | | | | | | | Change-Id: Ibc143ffac83dfb30facc9e93651e5f18550ab612 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Standarddialogs example: Adapt layout for fullscreen platforms.Friedemann Kleint2015-12-092-7/+21
| | | | | | | | | | | | | | | | Insert a group box depending on style hints. Change-Id: I1b49dc31d5bd32c92d88f95be0683d5223329c11 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | fortuneserver/fortuneclient: Fix layout for WinRT.Friedemann Kleint2015-12-092-2/+2
| | | | | | | | | | | | | | Use the new API QStyleHints::showIsMaximized(). Change-Id: I1342b3c29ef4ccfcf635a32d403f9aa7ce0cb4e4 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Polish the fortune server/client examples.Friedemann Kleint2015-12-036-50/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | - Remove Qt::WindowContextHelpButtonHint. - Make the server label interactive (enable copy). - Introduce new connection syntax. - Remove unneeded member variables. - Use constructor initialization where appropriate. - Adapt the layout to fullscreen platforms by wrapping it into a QGroupBox. Change-Id: I6e397ad082f22ba1e99fc5a17440b2be1f9584f6 Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
* | Doc: Fortune Server Example: fix typo in function nameTopi Reinio2015-11-301-1/+1
| | | | | | | | | | Change-Id: Ib0a5030cc2f88cf90ba7d25c75871c439486abe3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | Doc: corrected error in doc static pluginsNico Vertriest2015-11-131-3/+3
| | | | | | | | | | | | | | Task-number: QTBUG-43160 Change-Id: I94f92318cec095391050b2af90980010bd1066b9 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Polish the HTTP example.Friedemann Kleint2015-11-054-127/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unneeded member variables. - Use new connection syntax. - Streamline code. - Add a QCheckBox for launching the file after download and make the default file name and download directory configureable. - Make status messages more verbose. - Set Password echo mode on authentication dialog. - Extract the progress dialog to a separate class that is directly connected to the QNetworkReply, which is created on demand. Set set minimum and duration on it. This fixes a crash that currently occurs when clicking "Abort" on the SSL error dialog and "Cancel" on the progress dialog that is then re-shown due to its internal force timer/minimum duration handling. - Resize according to screen size. Task-number: QTBUG-48332 Change-Id: Ia2611e63fe96d6f49e4cdd06049a206ddb2c2864 Reviewed-by: David Faure <david.faure@kdab.com>
* | Fix the closeEvent of the systray example on OS XAlejandro Exojo2015-11-032-1/+10
| | | | | | | | | | | | | | | | | | | | | | The implementation of the close event handler requires handling the two close events that are received on OS X when the user quits through the application menu bar or the Command+Q shortcut. The first is an spontaneous event, and the second a non-spontaneous one with the window already closed. Change-Id: I24e3d3f0de4d631bd2d5616c85ce747f085691e0 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>