summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Fix clipping of QTextList decorators.Leonard Lee2013-05-231-1/+14
| | | | | | | | | | | | | | | | List decorators may be clipped if you set a large font size and/or small indent for a QTextList. This fix is to prevent clipping by moving list decorators and items to left (or to right in case of right to left layouts) so that the list decorator is always painted inside the layout. This commit fixes painting related issue, so auto test is not needed. The manual test program can be used for verification purposes. Task-number: QTBUG-5111 Change-Id: I7fdd92399445d33fe9eaf525a05fe5cd860b57c6 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Clear QWindowPrivate::positionAutomatic in setFramePosition().Friedemann Kleint2013-05-231-0/+1
| | | | | | | Task-number: QTBUG-31166 Change-Id: Ic0fa26e93db5a035539850ece819b1df2c58e95a Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Make QWindow update its screen when moved to a different oneGabriel de Dietrich2013-05-237-15/+56
| | | | | | | | Also implements the Cocoa backend for that. Change-Id: I32977e12a04e1cf48b12333442482746c69ce133 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* QFusionStyle: fix highlight colorsJ-P Nurmi2013-05-231-1/+1
| | | | | | | | | Respect the current color group of the palette, and fix the inactive highlight color. Task-number: QTBUG-30034 Change-Id: Iddfc15a2dd98d4588c6c587b7aaf64d88538fa28 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
* Fusion palette: add missing disabled rolesJ-P Nurmi2013-05-221-0/+2
| | | | | | Task-number: QTBUG-30034 Change-Id: I98358cfe43963ef27a8aa527d6100095be753305 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Make CMake not fail if EGL is not found.Stephen Kelly2013-05-201-2/+6
| | | | | | | | | As EGL is not a 'public dependency' of Qt, it is ok for it not to be available where Qt is deployed. Change-Id: I02dcc5f72ca4437210cff10e8b557e216f3e0419 Reviewed-by: Johannes Lochmann <johannes.lochmann@gmail.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Check that files we expect to find actually exist when using a cmake package.Stephen Kelly2013-05-201-5/+18
| | | | | | Change-Id: If7c724daa85df5e29e410b8deb4e69beb43ee8ea Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make QRgb-related functions constexprGiuseppe D'Angelo2013-05-201-9/+9
| | | | | Change-Id: I44b2b60e89a3312889101d7e5c305f4f7c18f7ae Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: remove references to toWinHBitmap and fromWinHBitmapNico Vertriest2013-05-131-11/+4
| | | | | | | | | Task-number: QTBUG-30738 Change-Id: I5a33493b37488b3ac4f5a499e5c5aa22e4e277f4 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* Fix transformed raster fonts on WindowsEskil Abrahamsen Blomfeldt2013-05-132-8/+12
| | | | | | | | | | | | | | | | | | We removed all Q_WS_WIN code when going to Qt 5. One of the things removed was the condition that we do painter path text rendering for transformed, non-ttf fonts, since the GDI engine does not support transforming those. This has now been reintroduced and adapted to the QPA way of doing things, by checking for it in the font engine subclass. Then there was the problem that QStaticText only supports cases where the font engine can transform the glyphs. Thus we need to fall back to regular text drawing in drawStaticText() for unsupported cases, and we need to skip the optimized path in the raster engine (which goes to drawStaticTextItem) Task-number: QTBUG-30932 Change-Id: I17ba7355ee127811b0e77bb3a9b9db092e99893b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Clean up old PostScript printing codeSze Howe Koh2013-05-125-7/+2
| | | | | | | | | | | | | PostScript support was removed back in 2011: 34f712e79e97b757b4426e1ffa09e065c9e379a1 - The QPSPrint* classes are gone - The QPrinter::OutputFormat enum only has NativeFormat and PdfFormat constants - QPaintEngine::PostScript is unused now Change-Id: I27d595b92341f41e14bd1e4fd860eac6826d7890 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Doc: Updated the addtional information about elide marksVenu2013-05-101-7/+12
| | | | | | | | | Added the same information for QFontMetricsF::elidedText. Task-number: QTBUG-30865 Change-Id: I57791de21f5721d7a505c3d13f450e5ec6cd2730 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Fix warning about unused variable when not using any SIMD drawhelpersTor Arne Vestbø2013-05-101-0/+1
| | | | | Change-Id: Ic87be3b6c7afbde869bd011a3a585b0fe7dbf15d Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Rename Numpad to Num, ensure Numpad is translated in all cases on Mac.Mitch Curtis2013-05-101-5/+5
| | | | | | | | Numpad is unnecessarily long. Change-Id: I19a6ce129e26a4f6f8344f514317214c48abde6e Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: David Faure (KDE) <faure@kde.org>
* Utilize the new Q_OS_MACX define.Jake Petroules2013-05-091-11/+11
| | | | | | | | | | All occurrences of `#if defined(Q_OS_MAC) && !defined(Q_OS_IOS)` have been replaced with `#if defined(Q_OS_MACX)`. Change-Id: I5055d9bd1845136beb8ed1c79a8f0f2c0897751a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Suppress warning about unsupported frame strut events.Friedemann Kleint2013-05-081-2/+1
| | | | | | | | | | | The warning causes a test failure since it occurs with XCB. Introduced by enabling frame strut events for all widgets by f2fcf75381b08f9bac247fde66604fed685dabb1 . Task-number: QTBUG-30530 Task-number: QTBUG-29012 Change-Id: I025b55f5198a270072b33cae033221709db256aa Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Only expect EGL libraries in the cmake files if Qt is configured to use it.Stephen Kelly2013-05-071-3/+5
| | | | | | Change-Id: Ida382a80dba882bbeb920756adc0c16321efe37e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Create a proper variable name in the cmake macro.Stephen Kelly2013-05-071-1/+1
| | | | | | Change-Id: I98145fb3149dd8f7aba60d305da98c148aa9c705 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* qtgui: Fix missing imagesSergio Ahumada2013-05-071-1/+2
| | | | | | Change-Id: I52bae22829bd464d368452573321cda02e97611b Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: The \wrapper command is addedMartin Smith2013-05-0722-0/+22
| | | | | | | | | | | | | | | | | | If \wrapper appears in a \class comment or a \qmltype comment, qdoc will not print warnings when it finds public members of the class or the QML type that are not documented. The \wrapper command is added to several opengl classes. This reduces the number of qdoc warnings by several thousands. Task-number: QTBUG-30755 Change-Id: Iba1eebc1590ccf54100e40fe91423240c1b3d09d Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Don't destroy the window if the QCloseEvent wasn't acceptedShawn Rutledge2013-05-072-3/+6
| | | | | | | | | | It's possible to override event() to receive the QCloseEvent and do event->ignore() to prevent the window from closing. Task-number: QTBUG-31019 Change-Id: I9abed47fca02a002b78727f98d678a824854adfc Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Don't use GL_REPEAT for image-brush drawing on OpenGL ES2Tor Arne Vestbø2013-05-071-1/+9
| | | | | | | | | | | | | | | | | OpenGL ES2 doesn't support NPOT textures in combination with GL_REPEAT, so for OpenGL ES2 we use a custom program that emulates repeat by taking the fractional part of the texture coordinates. This is not enough though, as merely setting GL_TEXTURE_WRAP_x to GL_REPEAT with a NPOT texture is an error in some implementations, so we have to guard the call to updateTextureFilter() in updateBrushTexture() with a check for OpenGL ES2 and use GL_CLAMP_TO_EDGE instead. This fixes missing/black backgrounds in the diagramscene example on iOS. Change-Id: I5020090b5f17faeb06dcab9dc0292459e021af30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Remove the crash pending warningJan Arve Saether2013-05-071-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Even though the intentions of this warning were good, the warning was a bit harsh. In addition, in certain circumstances (like the autotest demonstrates) we could end up calling object() on an interface where the object was in the destructor. This could happen because: *after* we got the destroyed() signal, the widget would still notify the accessibility framework of a FocusOut event. Since the code even called object() from isValid(), we could not even (as a defensive measure to circumvent this issue) check the isValid() of an interface without getting this warning (duh). So - for isValid(), the warning is not needed at all, since the caller will of course check the result of isValid() and act accordingly. As for the result of object(), it should always be a pointer, but it might point to a partially destroyed object. To detect this, you simply check isValid() first: if (iface->isValid()) doStuff(iface->object()); Change-Id: I206307fe618806133d8c6bc338c412d0009d7181 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Reintroduce QIcon doc image (from Qt 4 docs)Giuseppe D'Angelo2013-05-011-0/+0
| | | | | | | | | | | This fixes the [Missing image icon.png] warning on QIcon docs. Change-Id: I16aafb51c146fb675f657a7d8210033a17abf642 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Enable bundling Qt in Android package in build systemEskil Abrahamsen Blomfeldt2013-05-011-0/+4
| | | | | | | | | | | | | | | | | | | | | For bundling Qt, we need two things: 1. We need to build a regular .jar file out of the Java files, so that they can be built into the app package. Dexing the classes first (i.e. compiling the JVM bytecode to Dalvik bytecode) is required for loading the .jar file at run-time, but cannot be used for building it into the app, so we need two different paths. 2. We need to specify which extra files have to be bundled for each module (this is primarily for plugins and imports). This is because there is no static dependency on these files, so it cannot be detected during deployment. Task-number: QTBUG-30751 Change-Id: I733603ee5d1c64bd7c5b9357eb5d993b9d0298f7 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* QAccessible::State is no longer an enumOlivier Goffart2013-04-301-1/+1
| | | | | | | | | | | Since 39a052c66479c6d7bd13c4f583fecf6a895b2948, QAccessible::State is no logner an enum that moc understand. moc currently silently ignores it the Q_ENUMS Change-Id: Iecc30ad57055fc9ccaa33e9e9c400d96997d0902 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Clarify documentation for QKeyEvent::textFrederik Gladhorn2013-04-301-5/+8
| | | | | | Change-Id: I4b455a512b2e678b6127ea488b456c68eb80cdbc Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fix QKeySequence matchingGatis Paeglis2013-04-291-3/+5
| | | | | | | | | | | QKeySequence failed to find a match in the shortcut table when QKeyEvent contained Qt::GroupSwitchModifier modifier. It's not a part of the shortcut, it simply shifts character group in a keyboard mapping table. Task-number: QTBUG-26302 Change-Id: Id91cd4999777f7085068e9dba5cb22b40653e23d Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Get rid of this hack where QAccessible inherits from QObject.Jan Arve Saether2013-04-261-4/+1
| | | | | | | | | | | | | This was added just so that moc could pick up the enums and so that we could use the enums in Q_PROPERTY declarations, which was needed for accessibility in QML. It turns out that Q_GADGET is enough for us. This is a strictly a binary compatible change. However, QAccessible was marked internal in 5.0, so we are free to change it. In addition, this class is static and cannot be instantiated. Change-Id: I27e2e97c5f4b45c38678264c6b593a4383db8d3e Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix ignoring close events on OSXJosh Faust2013-04-264-5/+10
| | | | | | | | | | | | | QNSWindowDelegate was not handling windowShouldClose, which is how you can tell Cocoa that your window should not close if the close button is pressed. This change moves the close handling from windowWillClose to windowShouldClose, and adds an optional "accepted" pointer to QWindowSystemInterface::handleCloseEvent so that QNSWindowDelegate can return a true/false value for whether the window should actually close Task-number: QTBUG-28965 Change-Id: I67c6296ad42cbeeb71413e05411467d4e558adb4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fixed crashes relating to SVG icons.Samuel Rødal2013-04-242-4/+10
| | | | | | | | | | | | | | Creating a second QFactoryLoader for the same plugins seems to trigger an unload of the plugins loaded by the first factory loader. The QIconEngine created by the SVG icon plugin thus gets an invalid virtual table pointer, which causes a crash when attempting to call any virtual function in the QIconEngine (pixmap(), the virtual destructor, etc). Reusing a single QFactoryLoader instead fixes the crash. Task-number: QTBUG-30496 Change-Id: I80c5fa8b52ab9b0db68499f8c37fad14a1ac4f3c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Enable OpenGL library detection for mac.Stephen Kelly2013-04-241-4/+3
| | | | | Change-Id: If99d3faf2b08ac5109d619ff69efdaa3857c007f Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fixed QGLWidget not being able to be made current with a context.Samuel Rødal2013-04-231-1/+1
| | | | | | | | | | | If the QGLWidget's creation is triggered by a sibling or similar being created it would end up without the surface type OpenGLSurface. We need to make sure the QWindow has the correct surface type to prevent QOpenGLContext::makeCurrent() from failing. Task-number: QTBUG-30811 Change-Id: Ifc85f9120d89bd0bed4a3911233799830cb3a0f3 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix header check: you must #include qconfig.h before QT_NO_OPENGLThiago Macieira2013-04-232-0/+4
| | | | | Change-Id: I50518bd1b721d19e4712a6c11afb0a93afeaa7ea Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* QWindow: expose active as propertyLiang Qi2013-04-233-0/+14
| | | | | | | And add activeChanged signal for it. Change-Id: I9ebe9263e99863267c3a81b9286eaa5b29222085 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Make requestActivate() as a slot in QWindowLiang Qi2013-04-231-2/+2
| | | | | | | | Then it could be used in QML world. Task-number: QTBUG-28667 Change-Id: Ib65ad3b271a07ba50d3ca50d61f486f829f69119 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Fix QKeySequence::toString() returning gibberish for Qt::KeypadModifierMitch Curtis2013-04-231-4/+9
| | | | | | | | | | | | | This is the patch from the bug report with a few alterations to get it to compile, and also with the GroupSwitchModifier code removed, as this patch just focuses on Qt::KeypadModifier. The problem was determined to be in QKeySequencePrivate::encodeString, which doesn't handle the Qt::KeypadModifier flag. Task-number: QTBUG-4022 Change-Id: Ic981eb8b5cd88c7b36892d3019b8175db4b7b6f2 Reviewed-by: David Faure (KDE) <faure@kde.org>
* Add IMPORTED targets for the GL libraries used by Qt.Stephen Kelly2013-04-222-5/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | There may be multiple libraries specified in the mkspec, such as EGL and Mali, as used in devices/linux-sh4-stmicro-ST7108-g++, so create an imported target for each one. Also populate the Qt5Gui_EGL_LIBS variable with all created imported targets. Similar variables are created for the used OPENGL implementation. In the case of using the packaged ANGLE library, we already know the exact locations of the binaries. This makes it possible for third parties to use the same GL implementation as used by the Qt build itself. As these are used only privately by QtGui, they are also added to the DEPENDENT_LIBRARIES of that target so that they are found for rpath-link usage. On some platforms (eg Raspberry Pi), multiple include directories must be set to include egl.h, as the headers it includes for vcos are a bit scattered. Task-number: QTBUG-29132 Change-Id: I1126da3d37cd51c88d3670347c8b6405b285efb5 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Implement alertion state for windows.Friedemann Kleint2013-04-196-0/+68
| | | | | | | | | | | | | | Add QWindow::alert() and QPlatformWindow::setAlertState(). Add logic to clear alertion state when the window becomes active. The platform plugins then only need to implement a setter and a cheap getter and need not handle activation. Prototypically implement X11 and Windows. Task-number: QTBUG-30416 Change-Id: Ia70c4722d812462a21f4034b7d52735c9f2bc49c Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
* Let platform plugin decide if accessibility is activeFrederik Gladhorn2013-04-193-8/+19
| | | | | Change-Id: I881a8ff3fedf3db73ee37046a4363c70960a92a6 Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* Add the GL headers to cmake variables.Stephen Kelly2013-04-192-0/+36
| | | | | | | | | | | | | | If building angle ourselves, that's just the basic Qt include dir, and if using an external gl, look for it in the places specified in the mkspec. As the qopengl.h header includes the gl header, this is a 'public include dependency' of QtGui, so it is added to the relevant variable and the INTERFACE_INCLUDE_DIRECTORIES of Qt5::Gui. Change-Id: I8c2c1782e0a2600032771175444b087da28433fc Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make password mask characters themeable.Mitch Curtis2013-04-196-2/+18
| | | | | | | | Task-number: QTBUG-29871 Change-Id: I3cf739a321d7917f8f8431992e29bba0871b1934 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Actually set devicePixelRatio on copy.Morten Johan Sørvig2013-04-191-0/+1
| | | | | | | | | Followup to 7b9d4531 - the second part refactors to call setDevicePixelRatio but the call itself was left out. Change-Id: I3e36452603fe1d7d53fa1a74d87169efea1c2e78 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix memory leak.Sérgio Martins2013-04-181-0/+2
| | | | | | Change-Id: I7d308a869fdc729bd46ace336b71c7e30556d65d Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Android: Don't crash when displaying multiple top-levelsEskil Abrahamsen Blomfeldt2013-04-182-3/+8
| | | | | | | | | | | | | | | | | | | | | | While the raster platform plugin supports multiple top level windows, this is not supported on the GL plugin, so if you use GL or QtQuick2 in your app and use several top levels, the app would crash with an error message. A problem is that the top-level SurfaceView is a special overlay View and does not support being stacked in a layout. So instead, we let all windows share the same GL surface and draw on top of each other. This works fine for simple use cases. We implement a new platform capability to make sure no top level windows (even combobox popups and dialogs) get non-fullscreen geometries. That has never worked properly with the eglfs plugin. Task-number: QTBUG-30473 Change-Id: Ia1438019638fc739cc93ffe79b46b81631254df2 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* QOpenGLPaintDevice: correct painting on retina.Morten Johan Sørvig2013-04-181-1/+1
| | | | | | | | Make QOpenGLPaintDevice::metric(PdmDevicePixelRatio) return d->devicePixelRatio instead of 1. Change-Id: I4cf9dd552a700b958212edc8efb990a45e77fd66 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Move Fusion styles palette into QtGuiJørgen Lind2013-04-176-2/+156
| | | | | | | | So that it can be used as the standard palette for QtGui applications instead of the absolutely useless black palette. Change-Id: Ie001439fcd8840a66275009c9f42cbf8bab4864a Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Add default value for qHash's 'seed' argument for QOpenGLVersionProfile/StatusTor Arne Vestbø2013-04-152-2/+2
| | | | | | | | | | | | | | | | Although template<typename T> inline uint qHash(const T &t, uint seed) from qhash.h is never instantiated because we have the two-argument version of qHash() for both QOpenGLVersionProfile and QOpenGLVersionStatus, we need the default argument, as the template in qhash.h uses noexcept, which is evaluated regardless of instantiation, and uses qHash(t) without a seed. This behavior seems to not be the case with Apple clang 4.2, but has been observed with Apple clang 4.1, Clang 3.2, and GCC 4.8. Change-Id: If70e93f64eb9675a7c3ef7897ced2c6aebbec2d6 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make qtbase compile with QT_NO_IMAGEFORMATPLUGINTasuku Suzuki2013-04-152-4/+4
| | | | | | | | qfeatures.h re-generated from qfeatures.txt because QT_NO_IMAGEFORMATPLUGIN was missing Change-Id: I1c9291529ec07f83f99c9cd08340cbfebda609b6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Add devicePixelRatio metric to QPaintDevice.Morten Johan Sørvig2013-04-1511-23/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously QPainter computed the devicePixelRatio based on the physical and logical dpi, and expected that the ratio between them would be either 1x or 2x. This was problematic for paint devices like printers where the physical dpi can be much higher than the logical dpi, and also for QScreen where the physical dpi would have to be defined as a multiple of the logical dpi. Add QPaintDevice::PdmDevicePixelRatio and QPaintDevice:: devicePixelRatio() getter and implement it for the QPaintDevice subclasses. Use it when calculating the highdpi scale transform in qpainter.cpp and when scaling the clip rect in qwidget.cpp. Remove physical dpi scaling for QImage, QPixmap and QOpenGLPaintDevice, reverting to the old behavior. Change-Id: I6c97510613196d4536ff39d08e9750b8782283d4 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>