summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
Commit message (Collapse)AuthorAgeFilesLines
* Add QPointF/QRectF scale functionswip/highdpiPaul Olav Tvete2015-07-011-7/+31
| | | | | Change-Id: I91c5afc061e91c6088398d039c1c1fd3d79254ca Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Clean up comments and dead codePaul Olav Tvete2015-07-013-52/+10
| | | | | Change-Id: Iadaca71328404bd6c526af5095b32e5e35548182 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Add application attribute to disable highDPI scalingPaul Olav Tvete2015-06-301-0/+8
| | | | | | | | | | Main use case is for KDE Plasma, which needs to know about real window system coordinates. Can also be used by applications that do all the scaling manually, and that do not want to have Qt scale the coordinate systems and painters. Change-Id: Ic595131c5e2fb4c0af95e9b5bd3e40beee86760b Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Add environment variable to set per-screen scalingPaul Olav Tvete2015-06-301-0/+38
| | | | | Change-Id: I0fce05998ba6092c4dd1d64790c56c0668383477 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Remove QPlatformScreen::screenGeometry()Paul Olav Tvete2015-06-292-17/+0
| | | | | | | | | | QScreen's geometry is always determined by the platform screen, since there is no Qt API to resize or move a screen. Therefore, it makes no sense for the platform screen to ask QScreen for the geometry. Change-Id: Iedaa40e06e3a878f4e4e13fddd13a67a62d1f0f9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Scale logicalDpi when turning on screen scalingPaul Olav Tvete2015-06-183-1/+19
| | | | | | | | | | | | | Assume that the logical DPI for the primary screen is sane, and keep font sizes constant as screens are scaled. The global scale factor will act as a zoom level, and will cause all fonts to be bigger. Note that since we do not change logicalDpi after application startup, the manual test sliders will not match what happens with auto scaling. We may want to fix that... Change-Id: I5a3daa57c2dacf0158836492d31573723e49399a Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Only turn off font hinting when really scalingPaul Olav Tvete2015-06-183-16/+42
| | | | | | | | | | | | | | | | | | | We don't want to turn off font hinting based on whether auto-scaling is on, otherwise Qt Creator will look bad on a low-DPI screen. Instead, we turn it off only if we have at least one screen that is scaled. QHighDpiScaling::isActive() now means that there is actual scaling going on. There is currently no need for the old meaning, so this change does not include QHighDpiScaling::isEnabled(). Note that nothing can save us from the case where there is one high-DPI and one low-DPI screen. In that case we choose looking bad on the low-DPI screen instead of looking like crap on the high-DPI screen. Also note that our font system we doesn't allow us to change our minds on hinting later when screens are plugged in or removed. Change-Id: I14a4ec7a49f4ba74a4c74684c7b951d0a71b951d Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Make drag and drop work again after the mergePaul Olav Tvete2015-06-172-2/+9
| | | | | | | | QBasicDrag does not have enough information to map the coordinates, so we move that responsibility to the plugin. Change-Id: I6eb87014b3259844bb3373ecf961d92debdb2b84 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* dirty hack to make setScreenFactor workPaul Olav Tvete2015-06-171-0/+4
| | | | | | | | | This is a seriously dirty hack, but without this, screen geometries will be wrong when scale factors are changed after application startup. Change-Id: Ia39164303ef648ec3752d7f4b9db06477a2d3fb4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* Update doc.Morten Johan Sørvig2015-06-162-25/+36
| | | | | | | | | | Move to the class documentation in the cpp file, focus on documenting the class and not necessarily high-dpi scaling in general. Change-Id: I4f04398904325b2f9061db8d3a82cd362276e977 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Add QPlatformWindow::windowClosestAcceptableGeometry().Friedemann Kleint2015-06-102-0/+16
| | | | | | | | | | Add a function to determine the closest acceptable geometry (height-for-width) to QPlatformWindow similar to the existing QPlatformWindow::windowMinimumSize(), windowMaximumSize()... Clean up the hack in the Windows platform plugin accordingly. Change-Id: I96e943cfdbafdd0ff444e0d53ee0bdf8603d33df Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Merge remote-tracking branch 'qt/dev' into dev-highdpiPaul Olav Tvete2015-06-0924-153/+373
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qsimpledrag.cpp src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface_p.h src/plugins/platforms/xcb/qxcbwindow.cpp Change-Id: Icd887552ade61d6a2b2527383970f7145aa00faf
| * Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devSimon Hausmann2015-06-0418-136/+216
| |\
| | * Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-0318-136/+216
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| | | * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-011-0/+4
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| | | | * Handle parsing of GL_VERSION as reported by Nexus 6Andy Shaw2015-05-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Nexus 6 device reports a GL_VERSION which is strictly not conformant to what is expected from GL_VERSION, so a check is added for this case so that it correctly detects the right OpenGL ES version. Change-Id: I00297dd7c1e505dd7f9ab8a7fa480f514162b488 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| | | * | QtGui/Windows: Fix static build.Friedemann Kleint2015-05-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: error: C2220: warning treated as error - no 'object' file generated qtbase\src\gui\kernel\qgenericpluginfactory.cpp:70: warning: C4100: 'specification' : unreferenced formal parameter Change-Id: I2dbb114fa9feaf862b4554b128caca0dcb5e291e Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
| | | * | QOpenGLWindow: initializeGL is to be called before resizeGLLaszlo Agocs2015-05-271-114/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This involves deinlining some private class stuff to keep things readable and maintainable. Task-number: QTBUG-46002 Change-Id: Ie2888aa6c16a6f5182b61fbaa43288cfcc96cbc4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | | * | Fix failing input device notifications on embeddedLaszlo Agocs2015-05-272-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The connection to the deviceListChanged() signal may be queued. To make it work our custom types have to be registered. The problem is only visible with input backends like evdevtouch that live on their own thread. Task-number: QTBUG-46069 Change-Id: I4c03e8031e4337b5e711a3bd2cf405d15d6ce214 Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| | | * | Add debug operator for QTouchDevice.Friedemann Kleint2015-05-222-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Produces: QTouchDevice("", type=TouchScreen, capabilities=Position|Area|NormalizedPosition|MouseEmulation, maximumTouchPoints=10) Remove operator from manual test. Change-Id: I6b792665031902d5f822c80807a400a334c27526 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | | * | Make QTouchDevice a Q_GADGET and introduce Q_ENUM/Q_FLAG.Friedemann Kleint2015-05-221-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make it possible to stream the enumerations to a debug stream.# Change-Id: I0add2dcd835333a8d6cebf779252f22c1418faf3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | | * | D-Bus system tray icon: submenus can be created after context menuShawn Rutledge2015-05-212-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMenuPrivate::init() calls QPlatformTheme::createPlatformMenu() to create a platform menu, but on Linux, that returns null for now. QSystemTrayIcon::setContextMenu() results in recursive calls to QSystemTrayIconPrivate::addPlatformMenu() which then calls QDBusTrayIcon::createMenu() for the context menu and each submenu. However if a submenu is added afterwards, a corresponding platform menu is not immediately created. Now copyActionToPlatformItem() will detect and create the missing platform submenu, by calling a new method: DBusPlatformMenu::createSubMenu(). This is because there is no way of knowing that it's a tray-specific context menu (which is so far the only case in which we use DBusPlatformMenu). So, QPlatformMenu::createSubMenu() needs to exist as a new QPA interface for this use case. Task-number: QTBUG-45803 Change-Id: Ib319e873082196515ea0580d70d069099cf2c175 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| | | * | Introduce a version number to QPlatformInputContextFactoryInterface.Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Append a version number to QPlatformInputContextFactoryInterface_iid as is done for QPlatformIntegrationFactoryInterface. Start with 5.1 since c91c05b056c769c3df0d7634aed7d9bf2c0e550d changes the API in 5.4. Use macro in plugins. Task-number: QTBUG-46009 Change-Id: I1d1a89bde50d263354f33a6917efb1c084211842 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | | * | Increase version number of QPlatformIntegrationFactoryInterface.Friedemann Kleint2015-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase version 5.2->5.3 in macro QPlatformIntegrationFactoryInterface_iid and use that in the plugins. Task-number: QTBUG-46009 Change-Id: I491ab0ac169ede5c103b40e1bcbcbf511922a911 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| | | * | Cocoa integration - implement Qt::WindowModal file dialogsTimur Pocheptsov2015-05-132-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, for Qt::WindowModal dialogs we were creating modal sheet with beginSheetModalForWindow: and later (from exec) calling -runModal, essentially making a window modal dialog into (now) application modal sheet, which is not right- it's centered relative to desktop and the jump from window modal sheet's position (centered relative to a window) to application modal was quite visible. Now, instead of [panel runModal] (== [NSApp runModalForWindow:panel]) we call [NSApp runModalForWindow:theRequiredWindow]. Change-Id: I793dc72c7d1fe96497bb35754f4d0eac9a5e00e5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | | * | Create context with the correct screen in QOpenGLWindowLaszlo Agocs2015-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Targeting a non-primary screen with a QOpenGLWindow requires (at least with GLX) that the context is created with the same screen. Otherwise the context cannot be used with the window (BadMatch due to different X screens) Change-Id: I64f38ad7317d39a164bb69bb1430692319fc49d4 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | | * | QShapedPixmapWindow: ensure we set a valid geometryRichard Moe Gustavsen2015-05-063-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On touch platforms, QCursor::pos() will only be 'valid' when a touch event has (at least once) been translated to a mouse event. Currently this never happens in QtQuick since QtQuick always accepts all touch events and performs its own translations. So rather than setting the geometry of QShapedPixmapWindow from QCursor directly, we instead base it on mouse events. This will ensure that we never try to set the geometry of the window to an 'invalid' value, which can cause a crash on platforms like iOS. Note that we currenly miss an API in Qt to get the current touch points. When that is in place, we can also set a correct start position for the window before the first mouse move event arrives. Task-number: QTBUG-45877 Change-Id: I320598e87d43f6e9e087c204a69b95465128f468 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * | QShapedPixmapWindow: don't accept input focusRichard Moe Gustavsen2015-05-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inform the platform that it should not activate the window when shown by setting Qt::WindowDoesNotAcceptFocus. This compliments the already set Qt::WindowTransparentForInput, which specifies that mouse/touch events should also pass through the window. In other words, the window is just for showing output and should not respond to input. Change-Id: I3e90a28be2f2e27e2044effedf64f47c94a857a5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * | Revert change of NOTHROW to NOEXCEPTAllan Sandfeld Jensen2015-05-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change would remove the noexception hint on MSVC versions that doesn't support noexcept but supports their older 'throw()' hint. Change-Id: Ie5163f2413522f427279f59c8562c0ce4769bc82 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * | Add noexcept to move constructors and assignment operatorsAllan Sandfeld Jensen2015-05-042-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the noexcept attribute to all move constructors and assignment operators in QtGui that didn't already have it. Change-Id: Idcdf79ae8349b8793e7394b5ae7c08e6111fbc9a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| * | | | De-duplicate vtables, part II: exported public classesMarc Mutz2015-06-032-0/+7
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By making the destructor (usually the first non-inline, non-pure, virtual function, and therefore the trigger for most compilers to emit the vtable and type_info structures for the class in that TU) out-of-line, vtables and, more importantly, type_info structures for the class are pinned to a single TU. This prevents false negative dynamic_cast and catch evaluation. In this second and last batch, we de-inline destructors of exported public classes. Since they are already exported, users of these classes are unaffected by the change, but since it's public API, and the dtors may have been de-virtualized and inlined into application code, we need to avoid adding code to the out-of-line destructor until Qt 6. Change-Id: Ieda9553cb4b0dae7217c37cc7cde321dd7302122 Reported-by: Volker Krause <volker.krause@kdab.com> Task-number: QTBUG-45582 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | | Cleanup the mouse event handling in testlibLars Knoll2015-06-022-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling QCursor::setPos() to emulate mouse move events is a rather bad idea, as it creates round trips through the server, leading to timing issues etc. In addition, we should not call qapp->notify(), but rather route the events through the proper QPA interface. This is required to properly generate all other events such as enter/leave etc. As this breaks existing tests, put the new behavior behind an #ifdef for now. Like this, we can fix tests one by one, and then turn on the define by default for 5.6 (with a changelog message). We emulate timestamps to avoid creating double clicks by mistake. In addition, fix QGuiApplication::processMouseEvent to not push events back into the QPA event queue (as this is a bad hack and breaks the new testing system). Change-Id: I71774cb56674d7fb66b9a7cf1e1ada1629536408 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | | Add qHash(QKeySequence)Marc Mutz2015-05-262-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Key sequences can be compared for equality, so qHash should be overloaded, too. [ChangeLog][QtGui][QKeySequence] Added qHash(QKeySequence). Change-Id: I3cf896292459897d66198d96dfcdba1a39bdafce Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| * | | Make event delivery from testlib synchronousLars Knoll2015-05-231-27/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Directly process events delivered from testlib in QGuiApplication. The old code put these events into the QPA event queue leading to race conditions with plugins delivering native events from a secondary thread. Change-Id: I5646b1014f681593d487c9d1e65053ba06206411 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | | Add environment variable support for testability library use.Timo Jyrinki2015-05-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the option to load the testability library based on whether an environment variable QT_LOAD_TESTABILITY is set, in addition to the current "-testability" flag. This improves the use of testability library together with the autopilot functional testing tool. Task-number: QTBUG-32974 Change-Id: I6abf2c004cbff2ce0aff44e24a99bcc8188a52ae Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | | QMouseEvent: add constructor which takes the source as a parameterAlexander Volkov2015-05-123-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify the code by passing the source of a mouse event directly to the constructor instead of setting it by QGuiApplicationPrivate::setMouseEventSource(). Change-Id: I1774cf39a211d36d3adf0ff30f3bd2fb7c5fb429 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
| * | | Add a way to filter window system eventsGiulio Camuffo2015-05-122-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces the class QWindowSystemEventHandler which can be used to hook into QWindowSystemInterfacePrivate to filter and dispatch window system events. One use case is to intercept key events from the underlying system in QtCompositor and feed them into the xkbcommon state, and to modify the events based on the resulting state. Change-Id: I829eb7d960420135990fb0f6db54c14eea3e8e48 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com> Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | | | Don't make all sizes (0,0)Morten Johan Sørvig2015-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I1527261bad272114e805c6956f171865f3879c12 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | Make QCursor::pos() actually follow the cursor posPaul Olav Tvete2015-06-043-3/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to map based on the screen where the cursor actually is. Drag and drop works on xcb now. Note that this change means that QMouseEvent::globalPos() is no longer necessarily the same as QCursor::pos(). Change-Id: I0a4aa0806a3251881890ac6daa09ac7c6c2fd74c Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | Move min/max size constrain logic to QPlatformWindow.Morten Johan Sørvig2015-06-044-17/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This increases the uniformity of the to/fromNativePixels functions by removing a special case, and avoids pulling the qwindow_p.h details into qhihgdpiscaling.cpp. Keep the logic of constraining the device-independent size. Change-Id: Id0dae30a7c0170ff2e5d21b94d56719cc900c726 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | Print "deprecated" warning on QT_DEVICE_PIXEL_RATIO usage.Morten Johan Sørvig2015-06-031-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also clean up the env. variable definitions. Change-Id: If51ab515d7d7d6be9b984417ce7262a83ea48a66 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | Fix drag and drop for XcbPaul Olav Tvete2015-06-034-20/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the xcb plugin work in native coordinates, using platform windows as much as possible. As part of this, replace QMouseEvent in QBasicDrag with just a QPoint. This is private API, so we can change this without warning. In addition to xcb, QBasicDrag is used in QSimpleDrag and for Wayland. QSimpleDrag does not yet have a fix for highDpi, but it should continue working in the non-scaled case. Wayland (and any other module which uses QBasicDrag) will need a compile fix. Also fix bug in QWindowSystemInterface: handleDrag()/handleDrop() take positions in window local coordinates, not global. Change-Id: I86543e4f52a7b3ba1efeac815cf89bbd97c0a0a2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | Support QT_DEVICE_PIXEL_RATIOPaul Olav Tvete2015-06-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For compatibility with Qt 5.5 (and 5.4) Change-Id: I30fe0e493849f116983299f36061d443a522eec3 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | usePixelDensity and perScreenActive are different conceptsPaul Olav Tvete2015-06-012-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, setting a scale factor on a screen would also turn on pixel density scaling. Scaling everything twice is not twice as good... Change-Id: I617b76a717c8f83089d534604b3596754c42dad4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | Connect QPlatformScreen in the QScreen constructorPaul Olav Tvete2015-05-294-24/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make sure that we can use functions that depend on the platform screen from the QScreen constructor. Change-Id: I0f365994d0e63a942e6ba3c64e76438bbcb95fa9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | | Refactor QHighDpiScaling internals and usageMorten Johan Sørvig2015-05-295-42/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Overall goal is to simplify, separate concerns, and improve cross-platform-ness and testability. QT_SCALE_FACTOR is now a pure cross-platform global scale factor setter has no "auto". "auto" requires input from the platform plugin via QPlatformScreen:: pixelDensity() and gets a separate environment variable: QT_AUTO_SCREEN_SCALE_FACTOR The effective scale factor (aka devicePixelRatio) is now computed as the product of the global, screen, and window scale factors. This matches how devicePixelRatio is computed in general (the window system devicePixelRatio is also a factor), and makes QT_SCALE_FACTOR work consistently regardless if there is a window scale factor set or not. This also means we can remove the if/else casing from the nativePixels conversion functions. Add QHighDpiScaling initializer which reads the environment variables and sets the "active" variables. Call it during QGuiApplication construction, before the platform plugin is created Add per-screen scale factor setting capability to the manual test. This makes it possible to test this logic on all platforms. The command line argument is --screen-scale-factor. Change-Id: I054337cbae37a01cdd731d26d9cb628fcecdb652 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | | | QPlatformWindow::initialGeometry(): Add scaling.Friedemann Kleint2015-05-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To be squashed. Change-Id: Ib6983a65ab91a4d89a72d1d17a8bd672466e3ccb Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | | | Merge branch 'wip/highdpi' of git://code.qt.io/qt/qtbase into dev-highdpiPaul Olav Tvete2015-05-1315-20/+80
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/xcb/qxcbscreen.cpp src/plugins/platforms/xcb/qxcbwindow.cpp
| * | | Fix synchronousWindowsSystemEvents spelling.Morten Johan Sørvig2015-04-243-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "WindowsSystem" -> "WindowSystem". Strictly a QPA API break; there are no users of the function in QtBase. Change-Id: If2151b57587c68a7b5cbf261c54634aa930f2792 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * | | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-229-9/+68
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684