summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowsclipboard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Windows: centralize how we handle error messagesYuhang Zhao2022-11-161-1/+2
| | | | | | | | | | | | | | | | Currently QtBase contains multiple implementation of how to get the Win32 and COM error messages, and they are almost exactly the same, what's worse, Qt already has a private QSystemError class to do such things, so we are re-inventing the wheel in many places. This patch removes all other custom error message implementations besides the QSystemError one. And since there are a lot of places need the COM error message, move the implementation to QSystemError so that it can handle both Win32 error and COM error. Since I'm touching these lines anyway, break them into short lines if they are above the length limit. Change-Id: I1067c874011800303f0f114b5cb8830ac6810fc0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Rename QWindowsMimeConverter to QWindowsMimeRegistry, rename filesVolker Hilsheimer2022-11-031-1/+0
| | | | | | | | | | | | The class registers converters and provides access to the converter able to handle specific formats. But it is not a converter itself. The converter would then be the implementation of the virtual interface, e.g. QWindowsMime subclasses. Task-number: QTBUG-93632 Change-Id: I150ef28e9bcead4291d72e0b0aa660be3fcd4a8a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Windows QPA: Further cleanup of pre-Win10 codeYuhang Zhao2021-11-241-7/+4
| | | | | | | | | | | | | | | | | Mostly a removal of dynamically loaded Win32 APIs. Since Qt 6's minimum supported platform is Win10 1809 (10.0.17763, code name RS5), all these functions will be available and no need to resolve them at run-time. Things not remove: WinTab functions in "qwindowstabletsupport.cpp". Not my familiar area, so not touch it. Pick-to: 6.2 Task-number: QTBUG-84432 Change-Id: I7ad6c3bc8376f6c0e3ac90f34e22f7628efeb694 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Move the Windows Event Dispatcher into QtGuiFriedemann Kleint2020-06-091-1/+1
| | | | | | Task-number: QTBUG-83255 Change-Id: Ida86f27d7f52b9be48fbea909979320866ff8dae Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* qpa: Remove references to lighthouseTor Arne Vestbø2020-04-031-2/+0
| | | | | Change-Id: I37646113f626c878883cff49f4e186ec71bcfa15 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Windows QPA: Better disambiguate Window class namesFriedemann Kleint2020-01-251-1/+1
| | | | | | | | | Use a standard prefix for Window class names containing version, build and namespace which should reduce conflicts. Task-number: QTBUG-81347 Change-Id: Ia7c20af71d364e362781f791a4e51b77d605c918 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Use UTF-16 literals where possibleFriedemann Kleint2019-12-161-2/+2
| | | | | | | This should minimize diffs to Qt 6. Change-Id: Id74c0b4085085984bd51251765420718d16e9fc7 Reviewed-by: André de la Rocha <andre.rocha@qt.io>
* Windows QPA: Improve reliability of clipboard retrievalFriedemann Kleint2019-10-101-4/+13
| | | | | | | | | | | | Clipboard retrieval sometimes fails due to the other application having the clipboard locked. Retry opening the clipboard. The choice of parameters is empirical, they have been observed to prevent failures for MS Office applications at least. Fixes: QTBUG-53979 Change-Id: Icbcaee149f0d377f33b222cdafbb2a21a7f1cf9d Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows/Direct2d QPA: Use nullptrFriedemann Kleint2019-01-281-9/+9
| | | | | Change-Id: I6ce01caa58de78e0eb61e243ee1e7b05cc1f5568 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Windows QPA: Work around intermittent clipboard copy failuresFriedemann Kleint2018-09-281-1/+10
| | | | | | | | | Repeatedly attempt to open the clipboard in case it is opened by other applications. Task-number: QTBUG-27097 Change-Id: Ic1cfec0bb17e34f8c7f744add21a4431dae4f5b7 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Windows QPA: Fix Qt include statementsFriedemann Kleint2018-05-231-10/+10
| | | | | | | | | | | | Change #include <QtCore/QDebug> to #include <QtCore/qdebug.h> according to the coding style. Change-Id: I6ba8a7424c548ddde1d18f3f6f4f87e30973d710 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Make better use of new QStringList::join(QLatin1String) overloadMarc Mutz2017-02-191-2/+2
| | | | | | | | It was added in Qt 5.8. Change-Id: I7194fbfaef9219110604f3b03a893a658c996c06 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Windows QPA plugin: Use member initializationFriedemann Kleint2016-11-301-2/+1
| | | | | | | | Use C++ 11 member initialization in value-type structs. Task-number: QTBUG-51673 Change-Id: I668389b4a0ad1d862a505b740d67357cb9c2a3dc Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* port to modularized platformsupport librariesOswald Buddenhagen2016-10-151-1/+1
| | | | | Change-Id: I20eb0e33abfd70b6a5240e7b6b0aa0425f2d2ee7 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Windows QPA: Increase API level to 0x600 (Windows Vista).Friedemann Kleint2016-04-011-2/+1
| | | | | | | | | | | | | | - Directly link against dwmapi which should be present on Windows Vista and remove duplicated header constants. - Remove struct QWindowsShell32DL since all required functions are present on Windows Vista. - Remove functions that are no longer needed from QWindowsUser32DLL with exception of the clipboard functions which are not present in the MinGW stub libraries until v5. Task-number: QTBUG-51673 Change-Id: Ia4a8a3f1db0f0d02322317d547e61ae39f9008b5 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-241-2/+2
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java src/plugins/platforms/windows/qwindowsfontengine.cpp src/plugins/platforms/windows/qwindowsnativeimage.cpp tests/auto/gui/kernel/qwindow/BLACKLIST tests/auto/gui/kernel/qwindow/tst_qwindow.cpp Change-Id: I649b32b260ce0ed2d6a5089021daa0d6a8db85f7
| * Windows QPA: Fix warnings as shown by Qt Creator's Clang based code model.Friedemann Kleint2016-02-191-2/+2
| | | | | | | | | | | | | | | | Code except font, accessibility and file qwindowswindow.cpp. Task-number: QTBUG-50804 Change-Id: I40848264f9fa16eea00cf70d7be009c484c49e92 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-111-3/+0
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * Windows QPA: Remove dead code as detected by Clang.Friedemann Kleint2016-02-051-3/+0
| | | | | | | | | | | | | | | | Task-number: QTBUG-50804 Change-Id: Id87ca4ac98eb17b1e743a10080554da38d609588 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-1/+1
| | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Windows: Move GUI event dispatcher to QtPlatformSupport.Friedemann Kleint2015-11-141-1/+2
| | | | | | | This makes it possible to reuse it for the minimalegl QPA plugin. Change-Id: I1c3dbaf67f32294a5d0e03cc1eb8557049b810a5 Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* Windows QPA: Fix debug operators.Friedemann Kleint2015-10-271-0/+2
| | | | | | | | | | Enclose all debug operators within QT_NO_DEBUG_STREAM, declare all public ones and make the others static. Add operators for POINT and WINDOWPLACEMENT. Task-number: QTBUG-48449 Change-Id: I33f2dba2bf486a8f5cb11f11f4e2b37cce086def Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows: Improve debug output of mime conversion handling.Friedemann Kleint2015-09-011-1/+4
| | | | | | | | | | | Introduce convenience function for obtaining the format name and use that. Add debug operator for struct FORMATETC including format name. Replace all code enclosed in #ifdef QMIME_DEBUG by qCDebug(). Task-number: QTBUG-47656 Change-Id: Ibb3c860c57edee4a31e8f5f37e3245feebed52a1 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows/QClipboard: Fix crash in debug output of QMimeData.Friedemann Kleint2015-07-231-17/+20
| | | | | | | | | | Rewrite QDebug operator<<(QDebug d, const QMimeData &mimeData) to take a pointer and handle 0 values. Change the formatting to the style commonly used in Qt. Make it static as it is not used anywhere else. Task-number: QTBUG-47393 Change-Id: I78174e10b75769bf4acd33a894acc0a51e525c39 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Windows QPA plugin: Fix debug formatting.Friedemann Kleint2015-04-301-7/+8
| | | | | | | | | | | | | | | | - Introduce QDebugStateSaver for all debug operators. - Remove the "Flags=" from enumerations since their type is now output by default. - Added some spaces since the previous formatting relied on space=true as a result of some debug operators erroneously returning debug.space(), which is now fixed in qtbase. - Fixed formatting, added noquote() where necessary, added some newlines, used stream modifiers instead of QString::number(n, 16) to output hex numbers. - Fix indentation. Change-Id: I64123a4262916e21448cda2aa61ae1100f07291a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-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. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Windows: Use new clipboard API for listening to changes.Friedemann Kleint2014-05-151-8/+32
| | | | | | | | | | | | | | | | | | The currently used clipboard chain API has various problems with non- responsive applications and requires checks for hung/debugged applications when sending on notifications. The new clipboard format listener API available from Windows Vista onwards requires less code and does not have these problems, however the change notifications now arrive asynchronously. Change the tst_qclipboard to be able to deal with asynchronous change notifications. Task-number: QTBUG-38670 Task-number: QTBUG-33492 Change-Id: I3c49e346a34310431c20f3051d12eaabf330a3ad Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Windows: Ensure clipboard is flushed out before QGuiApplication is destroyed.Friedemann Kleint2014-02-201-1/+17
| | | | | | | | | | Otherwise, OleFlushClipboard() might query the data again which causes problems for QMimeData-derived classes using QPixmap/QImage. Task-number: QTBUG-36958 Change-Id: I89e58eeb64bd3481e89ad789f310f19ddb4604a2 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Port Windows QPA plugin to new logger API.Friedemann Kleint2014-01-221-16/+8
| | | | | | | | | | | | | | | | Introduce logging categories and change most debug statements to qCDebug(). Retrieve the filter rules from the environment variable QT_QPA_VERBOSE (should be removed once the logging framework offers a more convenient way of configuring). Replace the old per-category variables controlling verboseness of the output by a single variable which can be set on the command line. Change-Id: Iae55ecdb0e150efd165b7d3e90b371f72853f194 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Windows: Use PostMessage for clipboard notifications for debugged apps.Friedemann Kleint2013-09-271-6/+5
| | | | | | | Task-number: QTBUG-33492 Change-Id: I68af5f8ad767c55c95f758259cbb5d8a8080e70e Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Do not send clipboard message to application under debugger.Friedemann Kleint2013-04-171-0/+20
| | | | | | | | | Fix Qt Creator hang when copying a stack trace from an application showing a runtime assert. Change-Id: I874bd48643ebce1a3551644dc850cb7cf5869522 Reviewed-by: Kai Koehne <kai.koehne@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Windows QPA plugin: Add \internal to class documentation.Friedemann Kleint2012-05-291-0/+2
| | | | | | | | Prevent the classes from appearing in the Qt documentation. Change-Id: I62abff0c57effdf16629f9d5a0dc384ea2c43d5a Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix for windows platform plugin to work with WINCE.Bjoern Breitmeyer2012-05-101-73/+0
| | | | | | | | | | | Made opengl optional. Made Clipboard and Accessability optional. Moved internal mime data into its on source file, was implemented in the clipboard source which is just strange. Change-Id: I6ddf0c656533bd45e22e24492fc2254d15b7822f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix compilation with QT_NO_DEBUG_OUTPUT definedAndy Shaw2012-04-201-0/+2
| | | | | Change-Id: If96e93c08240e0f626f8e465993b2c38b2cad832 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QClipboard: Fix autotest failsDebao Zhang2012-02-271-2/+1
| | | | | | | | | | | | | | | tst_qclipboard.cpp still has Q_WS_WIN which must be clear away. After clean up, auto test will fail under windows: When setMimeData() is called, dataChanged() signal will be emited twice. The solution for QTBUG-24184 has partially solved the problem, but it still there. Make sure emitChanged() only called by QPlatformClipboard will give our more control for this. Task-number: QTBUG-24484 Change-Id: I23566c6d3b32828b6865234c311af3635fe9e299 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix qclipboard autotest on Windows.Friedemann Kleint2012-02-181-4/+7
| | | | | | | | | Emit changed signal only if the clipboard is not owned, in which case QClipboard does it. Task-number: QTBUG-24184 Change-Id: I27420583a718a5f8cd93b9d361b1e422a75df300 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix QWindowsClipboard crash when mimeData is NULL.Miikka Heikkinen2012-02-171-2/+5
| | | | | | | | | | When setting NULL mimeData in QWindowsClipboard::setMimeData, and the OleSetClipboard call failed, the warning print crashed because it tried to access mimeData. Task-number: QTBUG-24327 Change-Id: I1f56fd28c9191a330e14a93b4b11ac9c89db6985 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | 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>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Windows: Fix clipboard test.Friedemann Kleint2011-12-121-1/+4
| | | | | | | Return the QMimeData set on the Ole object if we own it. Change-Id: I08de0968e04a7356fed1255feb495f7b85e7a6f8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Fix email address in license headers.Jason McDonald2011-09-151-1/+1
| | | | | | | Change-Id: I5abf378f91a3a8f453058f36254f04258147cc15 Reviewed-on: http://codereview.qt-project.org/4851 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Add Windows to the Lighthouse.Friedemann Kleint2011-08-181-0/+366
Add an initial Lighthouse plugin for the Windows operating system. Change-Id: I6934562266e1aa0ac270bf6107df05a9e56ef82c Reviewed-on: http://codereview.qt.nokia.com/3107 Reviewed-by: Oliver Wolff <oliver.wolff@nokia.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>