summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Merge dev into 5.6Oswald Buddenhagen2015-08-1714-289/+203
|\ | | | | | | Change-Id: I061f2513ef58f696e75b11928d89aaaf059659a3
| * OSX FreeType: Add support for sub pixel font rendering.Sérgio Martins2015-08-141-0/+1
| | | | | | | | | | | | Task-number: QTBUG-42839 Change-Id: Iea4552d766936a55fd177e4287591d2715202d9c Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| * Move setter for QFont::HintingPreference to QFontEngineFT.Andreas Hartmetz2015-08-142-6/+27
| | | | | | | | | | | | | | Preparation for also using it from QCoreTextFontDatabase. Change-Id: I9cbef59c21f343a88a5cb3fdbee1ed4791d7a36e Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| * Call sendWindowSystemEvents() on deferred flushMorten Johan Sørvig2015-08-131-1/+1
| | | | | | | | | | | | | | | | | | Calling it directly is less confusing than calling it indirectly via the "else" branch in flushWindowSystemEvents. Change-Id: I085deff09162137606922a5af7ead23e21497b11 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Propagate keyboard event accept statusMorten Johan Sørvig2015-08-133-7/+8
| | | | | | | | | | | | | | | | Set the accepted bit on the QWindowsystemInterface keyboard event after processing the key event. Change-Id: I2d8c9382f14840e464153870dff909000e64ddcd Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Propagate event accepted state to platform pluginsMorten Johan Sørvig2015-08-132-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add en "eventAccepted" field to WindowSystemEvent, where the event subclasses can record the event acceptance status. Make handleWindowSystemEvent() return the accepted status. This works for synchronous event processing only. If the event is placed on the QPA event queue then there is no way to return the accepted state immediately. In the latter case handleWindowSystemEvent() always returns "true". Change-Id: I081aecc54f43588d42d3aaeec7f8458f06937601 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
| * Add QPlatformWindow::windowFrameGeometry()Morten Johan Sørvig2015-08-132-0/+9
| | | | | | | | | | | | | | | | Convenience accessor for use by the Wayland platform plugin. Change-Id: I420209138cfc285f8396913548b9e158a35ee9c1 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Make QT_SCALE_FACTOR work on WaylandMorten Johan Sørvig2015-08-131-1/+2
| | | | | | | | | | | | | | | | Propagate the line stride when creating the high-dpi backing store image. Change-Id: I15f41965d8eaf1d01ddac0a1a012b71148f757e3 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Remove type punning from QRgba64.Erik Verbruggen2015-08-111-49/+68
| | | | | | | | | | | | | | | | | | | | | | | | In C++, type punning with a union is not allowed. It will result in compiler defined behavior at best, and undefined behavior at worst. Specifically, if QRgba64 is passed to a function by value, the different members of a struct might be passed in separate registers. This means that any write to the quint64 might not blank out the values of the struct whenever the compiler looses track with TBAA. Change-Id: I991b5492fe4bb13a14bb670fef5bf13dacbe6c0a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
| * Move Q_ALWAYS_INLINE next to Q_NEVER_INLINE in qglobal.h.Erik Verbruggen2015-08-111-3/+0
| | | | | | | | | | Change-Id: I7e3b7ecca6b5f142fa6cb5db2e9521ed3212afe8 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * OSX: Add initial FreeType supportMathias Hasselmann2015-08-111-1/+18
| | | | | | | | | | | | | | | | | | This permits text rendering consistent with other FreeType enabled platforms, like Windows and Linux. Task-number: QTBUG-42839 Change-Id: I8c99bcaa3fb07c16e935a0c3705af467bc3da584 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
| * Fix repremultiply from RGB64 to RGB30Allan Sandfeld Jensen2015-08-113-218/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Just like from RGB32 to RGB30 we must also repremultiply when converting from RGB64 because the alpha channel loses more precision than the other color channels. Since this is not approximated accurately in the simple blending functions and the functions are no longer needed now the main render engine supports higher accuracy, the simple blending routines for RGB30 have been removed. Change-Id: I2b7b8eb015e330a487848fc4370ad3a1e966be91 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* | Fix -Wcast-qual warningsThiago Macieira2015-08-132-2/+2
| | | | | | | | | | | | | | qwidget.cpp:12864:70: error: cast from type ‘const QWidget*’ to type ‘void*’ casts away qualifiers [-Werror=cast-qual] Change-Id: I7de033f80b0e4431b7f1ffff13f956cb26108af7 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Fix warning about unused local variablesThiago Macieira2015-08-121-2/+1
|/ | | | | | | | | qopenglengineshadermanager.cpp(430): warning #177: variable "none" was declared but never referenced qopenglengineshadermanager.cpp(431): warning #177: variable "br" was declared but never referenced Change-Id: I7de033f80b0e4431b7f1ffff13f958e4a4cca16e Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devTimur Pocheptsov2015-08-0925-64/+363
|\
| * Merge remote-tracking branch 'origin/5.5' into devFrederik Gladhorn2015-08-0625-64/+363
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/global/qt-cpp-defines.qdocconf src/3rdparty/forkfd/forkfd.c src/corelib/codecs/qtextcodec.cpp src/corelib/kernel/qmetatype.cpp src/corelib/tools/qset.qdoc src/gui/accessible/qaccessible.cpp src/gui/image/qpixmapcache.cpp src/opengl/qgl.cpp src/tools/qdoc/generator.cpp src/widgets/kernel/qwidget.cpp tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I4fbe1fa756a54c6843aa75f4ef70a1069ba7b085
| | * Fix shortcut handling with modifiersFrederik Gladhorn2015-08-053-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since d7ca800a87a2291c94c6580f0cfe068bb2280caf the shortcut events were only sent once. The one sent by QGuiApplication did not create a QKeyEvent with the full native modifier state - basically the extended key event expected everywhere. That means that shortcuts on some keyboard layouts - like ctrl-shift-7 on the German keyboard (resulting in ctrl+/) - would not work when the shortcut override was tested from QGuiApplication, but then the same shortcut was sent from QApplication with the full information, so it worked the second time. Shortcuts of this type in Qt Quick were broken before. Task-number: QTBUG-47062 Change-Id: I8390b9a96d0d998a2a538ac65503702e0d299cc7 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@digia.com>
| | * Allow sharing contexts in QOpenGLTexture::destroy()Laszlo Agocs2015-08-041-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Checking for the exact same context is too strict. The texture is valid in sharing contexts too. Task-number: QTBUG-47521 Change-Id: Ifdf329ef5361b48abcb7c69e08acd7e35d624a08 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
| | * fix build with no built-in image handlersOswald Buddenhagen2015-08-034-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the handlers' .pri files added $$PWD to INCLUDEPATH to make the files self-contained when used externally, but this polluted the include path of the gui module itself, thus hiding incorrect use of QPA includes. Task-number: QTBUG-47400 Change-Id: I576469a71e8ded0b409d62687999c0fa884613f9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | * Don't expose qt_setQtEnableTestFont(bool) by defaultKonstantin Ritt2015-07-311-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | Build it only in -developer-build mode for tests that might depend on exact-matching font behavior. Return earlier to avoid doing any useless job. Change-Id: I966ee5689f03403e45f4c957b63e3113f0467803 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | * Default implementation for QPlatformFontDatabase::fallbacksForFamily()Konstantin Ritt2015-07-312-8/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | ...mainly for platforms that do not provide a native/unified way to obtain system-defined font fallbacks list (ie !CoreText && !FontConfig). Change-Id: I23c5589d79ddecb6311ccc52ec8b29977f06d408 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | * [QFontDatabase] Defer the fallback families list initializationKonstantin Ritt2015-07-312-20/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the same trick the WebKit related path has used for years: if there is no explicit list that takes a precedence over the default one (i.e. QFont("Arial,SimHei")), then defer the fallback families list initialization until it gets requested. Change-Id: If5a74294bdebb24865c619bc0d7328b3e706de76 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
| | * Doc: Add a \target for license information within QImage documentationTopi Reinio2015-07-311-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows us to link to it from the Qt licensing information page. Also, replace the \legalese command with \badcode in order to keep the license text formatting intact. Task-number: QTBUG-46478 Change-Id: I1b5100ca0373a533bd56852ab2a8f18e72404334 Reviewed-by: Sami Makkonen <sami.makkonen@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
| | * Doc: Amended the \inmodule statement for QSessionManagerVenugopal Shivashankar2015-07-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | The sources for QSessionManager live under Qt Gui so it doesn't make sense to include the class under the Qt Widgets doc module. Task-number: QTBUG-47274 Change-Id: I18b58c2a274bff323c7364cebbb0429a5a3a97d6 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| | * QPdfEnginePrivate - fix for '-qreal float' build.Timur Pocheptsov2015-07-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Literals 1. or 0. have type double, but QGradientStop.first is qreal and thus can be float depending on platform/configuration, making qBound call invalid (qBound(0., qreal_value, 1.) for example). Change-Id: Idab668d417a148bffe2495009ae700de980b73cc Task-number: QTBUG-47319 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * Doc:added doc to undocumented functionsNico Vertriest2015-07-2212-15/+245
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: Ic358682b276d67ef804f727bcf14191718613469 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* | | Make compressed textures work with mutable storageLaszlo Agocs2015-08-083-58/+263
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. glTexImage*D does not accept compressed formats. 2. Replacing it with glCompressedTexImage*D is not an option as per GLES 2.0 spec since passing null data is not allowed. 3. glCompressedTexSubImage*D must always be preceded by a glCompressedTexImage*d (or glTexStorage*D) call. 4. Therefore the only way is to do nothing in allocateStorage() and switch to glCompressedTexImage*D in setCompressedData() whenever mutable storage is in use. This makes ETC1 textures working on the Beaglebone (and presumably others). Change-Id: I21a040f6ed4aecaa494b6e5a6c6cd75b7389c15c Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | | Compile-time option for disabling high-DPI scalingPaul Olav Tvete2015-08-062-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even if QHighDpiScaling::isActive() returns false, there is a small overhead from calling functions and multiplying with 1.0. This change adds a QT_NO_HIGHDPISCALING #ifdef that replaces all conversion functions with empty inline functions. Task-number: QTBUG-46615 Change-Id: Idf85e1700e3adf7f7174c6fa3f5e1d006d74c826 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | | Add support for drawing a hyperlink in QPdfEngineAntonin Stefanutti2015-08-062-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the drawHyperlink method so that clients can draw a hyperlink pointing to the specified URL at the specified rectangle. That new method is to be used by GraphicContext::setURLForRect implementations that want to render anchors as clickable links in PDF documents. Task-number: QTBUG-44563 Change-Id: I7b0c602da37ee157d18115c531ab1b11fe304c13 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Add ETC1 to QOpenGLTexture formatsLaszlo Agocs2015-08-062-0/+8
|/ / | | | | | | | | | | | | | | | | | | | | | | | | On mobile and embedded ETC1 (via GL_OES_compressed_ETC1_RGB8_texture) is still the most common (and sometimes the only) option for compressed textures, at least until GLES3 (with ETC2) becomes widely available. Note that we treat this format as unsized to prevent going on the immutable storage path as there is no word on glTexStorage and friends in the extension so that may just fail as well. Change-Id: Icbc3c6f62f314d63c4df289ef456f047c5e84cf3 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Fix for build with -qreal floatTimur Pocheptsov2015-08-041-2/+2
| | | | | | | | | | | | | | | | | | Resolve ambiguity with function calls (due to double->float conversion), use qreal where needed intead of explicit 'double'. Change-Id: I28f1fb4a2b424b1399fb082a36ba9cff666f7c62 Task-number: QTBUG-47433 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QtGui/QtOpenGL: Fix compiler warnings by MSVC2015 (64bit).Friedemann Kleint2015-08-032-3/+3
| | | | | | | | | | | | | | | | | | | | opengl\qtriangulatingstroker.cpp(130): warning C4305: '=': truncation from 'double' to 'float' opengl\qtriangulatingstroker.cpp(546): warning C4305: '=': truncation from 'double' to 'float' opengl\qopenglshaderprogram.cpp(1779): warning C4312: 'reinterpret_cast': conversion from 'int' to 'const void *' of greater size qglshaderprogram.cpp(1709): warning C4312: 'reinterpret_cast': conversion from 'int' to 'const void *' of greater size Change-Id: If1de629aada308d18c3641b504d74d3294b1e8bf Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Do not access screens before initialize()Laszlo Agocs2015-08-021-2/+4
| | | | | | | | | | | | Change-Id: I1d6eaa5a1525ae060f8a9f37ae4295bee2f4bb38 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | Fix highdpi drag-n-drop for X11Paul Olav Tvete2015-07-302-19/+38
| | | | | | | | | | | | Task-number: QTBUG-46615 Change-Id: Iad548e62a580d6fbd15b7a826116a53ce23b4b8b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Introduce cross platform high-dpi scalingMorten Johan Sørvig2015-07-3018-85/+1164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a coordinate scaling layer to QtGui, which supports 'devicePixelRatio' type high-dpi on all platforms, in production and also for development and testing purposes. High-DPI scaling is opt-in, by setting environment variables: QT_SCALE_FACTOR - sets a global scale factor QT_AUTO_SCREEN_SCALE_FACTOR - sets per-screen scale factors, where the scale factors are provided by the platform plugin. This QtGui scaling can be used instead of or in addition to scaling done by the window system. This distinction is not visible to applications [when they use Qt API], which will see a change in the value returned by the devicePixelRatio() accessors as usual. Introduce a new (private to Qt) coordinate system: native pixels. The coordinate system stack now looks like: device-independent pixels (app, upper parts of Qt) native pixels (lower parts of Qt Gui, platform plugins) device pixels (backing stores and OpenGL) Add private QHighDpi namespace with scaling functions that convert between device-independent pixels and native pixels: T toNativePixels(T, QWindow *); T fromNativePixels(T, QWindow *); Add scaling calls the QWindow (and friends) cross-platform implementation, around the calls to QPlatformWindow functions. QPlatformWindow now uses native coordinates - platform code remains largely unchanged since native coordinates are window system coordinates. QWindow now uses (possibly) scaled coordinates. This means that platform plugins no longer can rely on QWindow::geometry() and related functions. QPlatformWindow::windowGeometry() and other convenience functions have been added for use when the platform plugin needs to convert scaled geometry to native geometry. Add Qt::AA_NoHighDpiScaling, which can be use to disable any scaling in QtGui, effectively ignoring the environment variables. (Note that this does not disable any scaling done by the window system.) Contributions from Friedemann and Paul. Task-number: QTBUG-46615 Change-Id: I673bbd69c130e73b13cce83be11bfb28f580bf60 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Enable non-integer device pixel ratioMorten Johan Sørvig2015-07-3016-19/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Work around QPaintDevice::metric's int return type by adding a new metric that returns a scaled devicePixelRatio. Choose a scale factor that gives us more than enough range. The QPaintDevice::devicePixelRatio() convenience accessor is public API and can unfortunately not be changed to return a qreal. Add devicePixelRatioF() which returns the (unscaled) devicePixelRatio. Change all call sites of QPaintDevice::devicePixelRatio() to use QPainDevice::devicePixelRatioF(). Task-number: QTBUG-46615 Change-Id: I97ec4000fe379b7ff5e1624a871ae2512790aad9 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Add power state to QPlatformScreenPier Luigi Fiorini2015-07-292-0/+28
| | | | | | | | | | | | | | Allows platform plugins to set the power state for each screen. Change-Id: I4164ca63cbae9fa2ab186dc84c8f704c33fd7c69 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Support MRT in QOpenGLFramebufferObjectLaszlo Agocs2015-07-295-164/+395
| | | | | | | | | | | | | | | | | | | | | | | | Introduce overloads in the API to allow specifying multiple color attachment sizes and formats. When these are in use and MRT is supported, a texture or renderbuffer is created for each of GL_COLOR_ATTACHMENT0, 1, 2, ... [ChangeLog] Added support for multiple render targets in QOpenGLFramebufferObject Task-number: QTBUG-39235 Change-Id: Ie7cfd81d1b796a9166b80dff7513aafe0120d53d Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Fix qHash(QFontEngine::FaceId)Marc Mutz2015-07-231-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were two problems: 1. qHash() hashed FaceId::uuid, but op== didn't use it for determining equality. Thus, x == y => qHash(x) == qHash(y) might be broken if fileName and uuid have an orthogonal component, if you excuse my vector analogy. 2. To hash fileName and uuid, it concatenated the two, causing a temporary QByteArray to be created just for hashing its contents. That prevented marking qHash() as nothrow. Fix by using new QtPrivate::QHashCombine and adding uuid to the list of fields compared in op==. Change-Id: I49f2379d514d6d3669929e737562cf6de823127e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* | Expose GLES 3.0 and 3.1 functionsLaszlo Agocs2015-07-237-209/+6327
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using the approach we already do for some GLES 3.0 functions we can provide a cross-platform, cross-GL-GLES wrapper for ES 3.0 and 3.1 functions too. Applications only have to take extra care about the version requests (context version and version directives in shader code), the rest of their code can stay the same across desktop/mobile/embedded, even when ES 3 functions are used. The new functions are placed to a new subclass which is placed between QOpenGLFunctions and the internal QOpenGLExtensions. This is necessary because, unlike with QOpenGLFunctions, there is no guarantee that these functions are always available in all configurations. When running on desktop OpenGL, we resolve as usual. If the OpenGL version contains the function in question, either in core or as an extension, it will all just work. This is handy because it does not rely on 4.x extensions like GL_ARB_ESx_compatibility, and so ES 3.0 functions will be functional on OpenGL 3.x systems too by just setting a 3.x version number in the QSurfaceFormat. We will no longer qFatal on broken systems where the driver returns a 3.0 or 3.1 context without the corresponding functions present. Instead, we show a warning and gracefully fall back to resolving as usual, via eglGetProcAddress or similar. For functions that are available in ES2 as an extension this may just work fine. Added also an example that runs identically both with OpenGL and OpenGL ES 3 and utilizes some ES 3.0 features like instanced drawing. [ChangeLog] Added QOpenGLExtraFunctions providing OpenGL ES 3.0 and 3.1 function wrappers in a cross-platform manner. Task-number: QTBUG-46161 Change-Id: I9f929eb61946c35c415b178c4d6ab2c1c958684e Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* | QColor: make nothrow move-assignable and -constructibleMarc Mutz2015-07-222-4/+18
| | | | | | | | | | | | | | | | | | The move special members were inhibited by the presence of user-defined copy ctor and assignment operator, which we cannot remove since the class is exported. Change-Id: I54fe6c28351fe69ca4b75066adb76ea07c959dfe Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Clarified the documentation for QTextDocument::find.Kavindra Palaraja2015-07-221-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | QTextDocument::find has a behavior that is different from the typical QRegExp/QRegularExpression behavior where finding a given expression is always constrained by the paragraph (block), regardless of newline characters in the expression. Task-number: QTBUG-21785 Change-Id: Ia6a061c6feb5a19e6b8caa3d8009da5ca31ec422 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* | QVectorND: mark as primitive, not just movableMarc Mutz2015-07-203-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Every bit combination is a valid object, so the correct type classification is primitive, not just movable. This is BC, because it just changes whether the default ctor and dtor are run or not, and these types don't care. Change-Id: Ifbfa83128778744f15a086a65c8be1ce01a58820 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | QIconLoader: don't make QIconDirInfo::type a bit-fieldMarc Mutz2015-07-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't save any space, is not required for ABI compat (because it's private API), generates more code to extract the field, and triggers a bug in older GCCs when synthesizing a move constructor for this type: src/gui/image/qiconloader_p.h:64:8: error: invalid conversion from 'unsigned char:4' to 'QIconDirInfo::Type' [-fpermissive] src/corelib/tools/qvector.h:641:13: note: synthesized method 'QIconDirInfo& QIconDirInfo::operator=(QIconDirInfo&&)' first required here Change-Id: I61e886566b67c7a18a318a3d026dc762600f8ab4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QtGui: Pass types with copy-ctor or dtor by const-refSérgio Martins2015-07-198-13/+13
| | | | | | | | | | | | | | | | | | ... except if the function is a ctor, callers pass rvalues, and the type has a fast move ctor. In that case, keep passing by-value and qMove() into place. Change-Id: I2c0be7d4436327834ddee0531c51c5af352ac74c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QZip*: return FileInfo by valueMarc Mutz2015-07-191-11/+10
| | | | | | | | | | | | | | | | | | Makes for much more readable callers, and, d/t NRVO, isn't less efficient than the old code, either. Transparently enables moves when QVector should get them, at some point, too. Change-Id: I77327cf665272b80277deaaa6dd2ee9c00806464 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QZip*: don't hold QZipReader::FileInfo in QListMarc Mutz2015-07-192-5/+5
| | | | | | | | | | | | | | | | | | | | | | FileInfo is larger than a void*, so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Change-Id: I772177c5ac544a5fecce2368f628148308ef260f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Clean up QZipReader::FileInfoMarc Mutz2015-07-192-39/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | - don't define special member functions if the compiler-generated ones are just fine (inhibits move semantics) - implement all remaining methods inline - unexport - remove unused (and, to add insult to injury, never init'ed) d-pointer. This is private API. No need for a d-pointer, much less an unused one. Change-Id: I6979cb5103a361c0313c252d3bf7073a3c47addd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Fix nullptr literal 0s which would look odd as nullptrMarc Mutz2015-07-194-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | These all invoke the QFlags<>(Zero *) ctor, which is designed to accept a 0, but no other int. But in doing so, it requires passing a nullptr literal, and 0 is not a nullptr literal accepted under -Wzero-as-null-pointer-constant or similar warnings. Fix by using the QFlags::QFlags() ctor instead. Task-number: QTBUG-45291 Change-Id: I73f9c9f4de11eeb1ba04ace6c7121d17510ea29f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QtGui: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-1940-119/+119
| | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>