summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright year in license headers.Jason McDonald2012-01-05419-419/+419
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Registered QUuid in the metatype system as a builtin type.Denis Dzyubenko2012-01-051-0/+1
| | | | | | | Change-Id: I6be6129d9f6bf468ba8a5805cfa0f6f79199afb3 Reviewed-by: João Abecasis <joao.abecasis@nokia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com> Reviewed-by: Prasanth Ullattil <prasanth.ullattil@nokia.com>
* QTextLayout::lineAt() to return invalid line if index is out of boundsPekka Vuorela2012-01-051-1/+1
| | | | | Change-Id: I1f93789c96f3b2335b02897ff5fc8385964d1641 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Support RTL text with merge font enginesJiang Jiang2012-01-051-6/+10
| | | | | | | | | | | Text like Urdu use mixed RTL scripts from Persian, Arabic and so on. In RTL, sub glyph runs for individual font engines must be added from end to start, so that the positions can still be calculated in a left to right manner. Task-number: QTBUG-23404 Change-Id: I7e55e4b7b858b3abbe94e352c93d36de6226ff58 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Introduced QOpenGLContext::aboutToBeDestroyed() signal.Samuel Rødal2012-01-052-0/+16
| | | | | | | | | This signal can be used to clean up OpenGL resources in a safe way before the context is destroyed. Task-number: QTBUG-20083 Change-Id: I45a4be01b06af4ee7196fa502116f099d50afeab Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix QPainter::drawText with complex brushesSimon Hausmann2012-01-041-1/+1
| | | | | | | | | | | | Commit d52fd497f60a3c4456994f4f10e9451d611c9ea4 introduced a call path to QPaintEngineEx::drawStaticTextItem, which has a bug in using the pen's color instead of the entire brush. This patch replaces the use of the color with the pen's brush(). Task-number: QTBUG-23450 Change-Id: Ieb3bf352c840ff0d3fb4ac678caf7b13f4f9a8f1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Refactor QVariant handlers.Jędrzej Nowacki2012-01-041-49/+23
| | | | | | | | | | | | | | | | | | | | | | | | | QVariant implementation is based on delegation to a handler. The handler has rather simple construction, it is a set of function that implements a switch statement over known types and redirects calls to a right method of an encapsulated types instance. Unfortunately after qt modularization project, it is not easy to use types directly from different modules, as they can be undefined or completely unaccessible. Which means that each module has to implement own handler to cooperate correctly with QVariant. We can suspect that list of modules known to QVariant will grow and it is not limited to GUI, Widgets and Core, therefore it would be nice to have an unified, from performance and source code point of view, way of working with handlers. This patch is an attempt to cleanup handlers. Keynotes: - Each handler is working only on types defined in the same module - Core handler implements handling of primitive types too - Custom types have an own handler - Each handler is independent which means that dispatch between handlers is done on QVariant level - Handlers might be registered / unregistered using same interface Change-Id: Ib096df65e2c4ce464bc7a684aade5af7d1264c24 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Export QOpenGLTextureCacheJørgen2012-01-041-1/+1
| | | | | | | | | | because it can be useful outside QtGui. The function QOpenGLTextureCache::bindTexture gives a very convenient way to get a texture from an image. Change-Id: I2e22c0a3a8f1f307d0b558280043f726e3d8093a Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add virtual destructors to accessible interfaces.Frederik Gladhorn2012-01-041-0/+5
| | | | | | Change-Id: I60a6033911757f86c70f06c2d8d4240d2332b4cf Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com> Reviewed-by: Alban Crequy <alban.crequy@collabora.co.uk>
* Use meta object to get string rep of QAccessible::Role.Frederik Gladhorn2012-01-032-5/+22
| | | | | Change-Id: I69320b69ea13ebc594575277e39d30a066df61fd Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Fix crash in positionInLigatureJiang Jiang2012-01-021-1/+1
| | | | | | | | | Check boundary of pos before accessing attributes. Task-number: QTBUG-23104 Change-Id: I0bc93dbe320badc65acc75bb59b27f481e69b93e Reviewed-by: Eskil Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
* Send ApplicationActivate and ApplicationDeactivate from QtGui.Samuel Rødal2012-01-021-5/+10
| | | | | | | | | | Instead of only from QApplication in QtWidgets, as we need these events for example in QDeclarativeApplication. Task-number: QTBUG-21573 Task-number: QTBUG-23331 Change-Id: I0c960bd1c7911d306d274a6e9a1838f158235ed0 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@nokia.com>
* Inline some methods in qgrayraster.Robin Burchell2012-01-021-53/+7
| | | | | | | | | | | | gray_conic_to, gray_cubic_to and gray_line_to were all single line wrappers around their equivilent gray_render counterparts, with an additional lie of error handling that never actually happened. Since this doesn't really do anything except confuse the reader, let's ... not do it :) Change-Id: Id5d86c49174acb92514b628a70bd32d6c6640a5d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove env var to enable accessibility on linux.Frederik Gladhorn2012-01-021-4/+1
| | | | | | | | | | | Usually we don't have a plugin for this on linux anyway. But if we do, we should actually allow it to interface with the system. When using AT-SPI the plugin can detect if it should be active. Other plugins can fall back to using an env var if really needed. Change-Id: Ic9dcfa305e7cdafbf4a93bcc2dc9a0fcd9b9a7a2 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* blitter: Base QBlitterPaintEngine on QRasterPaintEngineHolger Hans Peter Freyther2012-01-023-117/+151
| | | | | | | | | | | | | | The original intention was to identify a clipping bug, it turns out that during a ::begin() (and systemChanged) we should forward the QPaintEnginePrivate state to our proxy engine. Instead of using the proxy-pattern subclass rasterengine and specialize the paths we are able to accelerate using the blitter interface. This will avoid similiar problems in the future. I have no performance measurement to show which of the two approaches is faster/slower. Change-Id: I39bff11b32b1fe20284c7e8df60050de5991bb6e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Group code by functionality in header and cpp fileHolger Hans Peter Freyther2012-01-022-120/+118
| | | | | | | | | | * Group code responsible for tracking the render pipeline state to check if we can easily accelerate it * Code that will call into the QBlittable * Code that will lock the QBlittable before calling into raster Change-Id: I862e242d59805de5094ed363b486afcdbc23ff78 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Fix the 'solid' detection for the brush in case of fillRectHolger Hans Peter Freyther2012-01-021-2/+2
| | | | | | | | | | | A default QPainter will set a QBrush with Qt::NoBrush BrushStyle, the current code detects this as a non solid fill and all calls with fillRect and a color will not go through QBlittable. Check for Solid or NoBrush style. Manually verified that a p.fillRect(rect, Qt::red) goes through the accelerated path now. Change-Id: Ic0d98030e94f5d11abbe61628fbf71d1e08219c2 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Move state updates into new methodsHolger Hans Peter Freyther2012-01-021-45/+86
| | | | | | | | | Create updateCompleteState(QPainterState*) so we don't need to call into the paintengine, move all state methods into the QBlitterPaintEnginePrivate class. Change-Id: If30fdcc3f63755e0443bced7d9d9fb993d4ec2b7 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Move the definition out of the classHolger Hans Peter Freyther2012-01-021-59/+72
| | | | | | | | Cosmetic change to remove four spaces of indention from some of the deeply nested methods. Change-Id: I67fdd0ab722b7c7c67c4da7a0a0bd86459751700 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Kill the isBlitterLocked variable of the QBlitterPaintEngineHolger Hans Peter Freyther2012-01-023-10/+11
| | | | | | | | | | It starts with being initialized wrongly, the call to buffer() will lock the data while we think it is not locked, it can also get out of sync by someone calling buffer() again. Remove the variable and check with the QBlittable if we need to lock the resource into memory. Change-Id: I350375011138d1b4c2c48c100b7b30b8ea2ae460 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Use CapabilitiesToStateMask as a class memberHolger Hans Peter Freyther2012-01-021-31/+29
| | | | | | | | | Move the bit helper functions into CapabilitiesToStateMask as they are only used in this class, allocate the class as part of the QBlitterPaintEnginePrivate, shorten the name as well. Change-Id: If22ddd117a9789cd98edb08f23fd0ffabb17d5a5 Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* blitter: Style changes to the codeHolger Hans Peter Freyther2012-01-021-78/+65
| | | | | | | | Spend some bytes for spaces after comma and keywords. This should now mostly follow the Qt style guidelines. Change-Id: I3298c8d41d40ab5b0153a33d44b1b607a2edca8e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* raster: Fix typo in a function argumentHolger Hans Peter Freyther2012-01-021-1/+1
| | | | | | | Change-Id: I903e1245667680f43414414bb0b4bfaa6240ea04 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Handle -1 (Invalid Key) and Qt::Key_unknown gracefully in encodeString.David Faure2012-01-021-0/+5
| | | | | | | | Previously they would fall into the unicode handling and return very strange values. Change-Id: I62a53894c0983bf53fd79f924b40a6fd3ba02993 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Make qDecodeDataUrl return bool.Jonas M. Gastal2011-12-291-2/+6
| | | | | Change-Id: I23b9fed39af7bea6c171b35e10bd72c424bd903e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove non-const getters marked for elimination.Robin Burchell2011-12-272-35/+0
| | | | | | | These all have consted overloads, so there's no need for them. Change-Id: I3d4f63b8eb8f1b7df7fa772d6172e0a954184d24 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Merge QTextDocumentFragment::toHtml() overload per Qt 5 comment.Robin Burchell2011-12-272-12/+1
| | | | | Change-Id: Ic8850684c2298b996354e27cc96ad6486d7a3679 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Finish removing Qt3 supportBradley T. Hughes2011-12-233-15/+0
| | | | | | | | | | | | | | | | Remove the (-no)-qt3support options from configure, and remove the last remaining references to Qt3Support, QT3_SUPPORT, and QEvent::ChildInserted. The compatibilityChildInsertEvents() tests in tst_QObject and tst_QWidget have been renamed to childEvents(), which is a more appropriate name. Change-Id: Id0b45e9b177efcc8dceee8c9ed8afafedeeace2f Reviewed-by: Kai Koehne <kai.koehne@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix for -Werror -WshadowDavid Faure2011-12-221-1/+1
| | | | | | | | qevent.h:792:49: error: declaration of 'device' shadows a member of 'this' [-Werror=shadow] Change-Id: Iccb7e79dd97d55b17fbd4dfaf3503b9e251adcfc Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of invalid modifiers in QKeySequence.David Faure2011-12-221-0/+7
| | | | | | | | | | When decoding a string don't assume valid modifier strings. If a modifier string is unknown return Qt::Key_unknown instead of skipping the modifier. Currently 'Win+a' is decoded to 'A' but should be Qt::Key_unknown. Change-Id: I1c82031159a8b3c19924a7c9e991bc6b1f90d617 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Mac: Add temporary solution to fix app deployment.Morten Johan Sorvig2011-12-221-0/+10
| | | | | | | | | | Look for the the platform plugin in "../Plugins" first. When deployed inside an app bundle this path will point to the plugin directory inside the app bundle. Change-Id: I362981a9e0ca9a3e69396b033a571d0b4e2bf78a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove unused QPicture::detach_helper() private method.Robin Burchell2011-12-202-12/+0
| | | | | | | QPicture doesn't need this for quite a long time now, so get rid of it. Change-Id: Ie575f32555deb130f7b27e11a7617fb2b3dc4e43 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove non-const QMovie::cacheMode().Robin Burchell2011-12-202-11/+0
| | | | | | | There's a const QMovie::cacheMode(), so having this makes no sense. Change-Id: I0b6f20055fcbb28f3a21a8bc303f82543592c9c6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove qt_image_id() and qt_image_colortable().Robin Burchell2011-12-203-15/+0
| | | | | | | | Both of these have been unused at least as far back as Qt 4.5 according to git log -p. Change-Id: I381024cb1621fbfdb806a62e1cc55ce13219ef17 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Add destructor to QPlatformFontDatabase.Frederik Gladhorn2011-12-202-0/+8
| | | | | | | Virtual functions deserve a virtual dtor. Change-Id: I71b7ae3b7fb0aa1553a37a90dce6270740d49e32 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Accessibility: childAt returns interfaceFrederik Gladhorn2011-12-194-22/+27
| | | | | | | | | | | | | | | | | | childAt used to return an integer. Return an interface instead. Not requiring a direct child to be returned allows optimizing by bypassing iterating through the hierarchy of accessibles. For QtQuick this is the only sensible way of implementing this. The bridges are still responsible for finding the top-most element. The default implementation in QAccessibleObject is sufficient to return direct children. The implementation in QAccessibleApplication is therfore no longer needed. Change-Id: Id7100dd5bcc3a98de516a7f4a12eaaa41cb46d26 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Remove plugin related variables from the CMake files.Stephen Kelly2011-12-191-4/+0
| | | | | | | | | It doesn't currently have any effect and needs to be re-thought anyway. Change-Id: I6e620ca5b341264bbf5279a19e8f25af8fa7d396 Reviewed-by: Alexander Neundorf <neundorf@kde.org> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Make QMetaTypeInterface POD.Jędrzej Nowacki2011-12-191-1/+1
| | | | | | | | | QMetaTypeInterface has to be POD because it is constructed in a static array. Constructors in POD types are not allowed so we will use a macro instead. Change-Id: Iab9ae776dfe4dcd7148558f02d6181c5917aa5c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Improved path filling performance in the raster paint engine.Kim Motoyoshi Kalland2011-12-164-55/+93
| | | | | | | | Convert bezier curves to polylines before rasterizing with gray raster. Change-Id: I353debd4338f2a3ce2fa1cfa1bff9dd2e36f05ab Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Remove redundant touch processing in QtGui and widgets.Laszlo Agocs2011-12-142-13/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The duplicated hash tables in QGuiApplicationPrivate and QApplicationPrivate are now unified into one single hash table in QGuiApplicationPrivate. This also reduced the number of lookups. The extra processing needed to keep the touch points' first/lastPos values in sync is now done only once, in QGuiApplication. This eliminates the performance penalty (for widget-based apps) that was introduced during the QPA migration. As an added bonus the patch adds support for touch events arriving simultaenously from multiple devices. This was broken before: As there is no guarantee that two devices/drivers will not send touch points with the same ID, using structures with only the ID as key is wrong. The proper key is composed of the device ID (that is, a QTouchDevice pointer) and the touch point ID. The exported internal function qt_translateRawTouchEvent() has been removed. This function cannot work properly in the QPA world: It injected touches into the widget subsystem (QApplication) only which is wrong, and would result in half-filled touch events due to not routing the injected data through QGuiApplication. Autotests using this function are migrated to QWindowSystemInterface::handleTouchEvent(). Change-Id: I7632781d77f9e0ac4626fd7c9933511c94492156 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Improved performance of large text when parts are outside view.Kim Motoyoshi Kalland2011-12-131-6/+81
| | | | | | | | | Avoid generating paths for the parts of the text that are outside the viewport in the raster paint engine. Task-number: QTBUG-22687 Change-Id: I06159bc4c1aa82a07606f4b2f0336cb25dfd56d2 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Make QApplication::type() set by QGuiApplication.Frederik Gladhorn2011-12-121-0/+1
| | | | | | | | | | | | | | | QApplication::type used to be static and set by the QApplicationPrivate constructors. In QCoreApplication we have the new application_type that should take its place. QApplication::GuiServer is deprecated (since it doesn't have any functionallity any more with QWS being removed). This change prepares QStyle to be called from a QQuickCanvase based application that does not inherit the QWidget version of QApplication. Change-Id: Ifbe992e25f1e5821fa047b6eb915f75fa675ab97 Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* Add touchEvent() virtual to QWindow.Laszlo Agocs2011-12-122-0/+11
| | | | | | | | | | | Unlike keyPressEvent(), mousePressEvent(), etc. the touch events had no equivalent so one had to fall back to reimplementing event() or using an event filter. This is now corrected by introducing touchEvent(). Touch events are finally becoming a first-class citizen in Qt 5. Change-Id: Ia2044030154fd5b1b5384f08a3cb1749b798435f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove template <class T> class QRingBufferJoão Abecasis2011-12-121-72/+0
| | | | | | | .. as it is declared and defined in .cpp file but never used. Change-Id: I7b72daf62712b4ec25717afbe2b7f0792ffa2a85 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Silence -Woverloaded-virtual warnings in QRasterPaintEngineBradley T. Hughes2011-12-122-13/+13
| | | | | | | | | | | | | | | | | | | | | | The QRasterPaintEngine::updateState() is not a reimplementation of QPaintEngineEx::updateState(const QPaintEngineState &state). Rename the updateState() function to updateRasterState(), and ensureState() to ensureRasterState(). These names were chosen to match the class name QRasterPaintEngineState on which these functions operate. ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_raster_p.h:271:10: warning: 'QRasterPaintEngine::updateState' hides overloaded virtual function [-Woverloaded-virtual] void updateState(); ^ ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:202:18: note: hidden overloaded virtual function 'QPaintEngineEx::updateState' declared here virtual void updateState(const QPaintEngineState &state); ^ Change-Id: Ie9ff0230019b383d53757029c6b2194dfc6a2664 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Silence -Woverloaded-virtual warnings in QBlitterPaintEngineBradley T. Hughes2011-12-122-5/+5
| | | | | | | | | | | | | | | | | | | | QPaintEngineEx declares several virtual clip() overloads, but clip() with no argument does not reimplement any of these. Rename it to clipData() (to make the name of the return value more closely). ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengine_blitter_p.h:104:29: warning: 'QBlitterPaintEngine::clip' hides overloaded virtual function [-Woverloaded-virtual] inline const QClipData *clip(){return raster()->d_func()->clip();} ^ ../../include/QtGui/5.0.0/QtGui/private/../../../../../src/gui/painting/qpaintengineex_p.h:157:18: note: hidden overloaded virtual function 'QPaintEngineEx::clip' declared here virtual void clip(const QPainterPath &path, Qt::ClipOperation op); ^ Change-Id: Ifd7c494e2c999d743216cfb4c27a9c3ccf66f2a9 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Store the primary status in the touch point flags.Laszlo Agocs2011-12-125-16/+7
| | | | | | | | | | | | | | | | | For some reason the primary bit has previously been encoded in the touch point state, even though it has nothing to do with the regular states like Pressed, Released, etc. The value is now stored in the recently introduced flags member of the touch points. This also reduces the need for error-prone internal masking of the state value. The structure used by QWindowSystemInterface::handleTouchEvent also becomes cleaner because the primary status can now be set in the flags member and the isPrimary bool can be dropped. Change-Id: I1da2cb99154afd97e1e3a5943ab115cae3a8232f Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fix typo in APIDocsThomas Zander2011-12-101-1/+1
| | | | | | | | | | The name of an enum was slightly misspelled in the API docs, so lets make sure its now copy-paste friendly. Change-Id: I5da5230ab29743b63bf238a379891c98ac9d5039 Reviewed-by: Robin Burchell <robin+qt@viroteck.net> Reviewed-by: Thomas Zander <zander@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Make headers safe with QT_NO_CAST_FROM_BYTEARRAY.Stephen Kelly2011-12-091-2/+2
| | | | | Change-Id: I0f9dfee505ebc48d9c586c010ad75877a7387836 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Remove QWidget dependency from QTouchEvent.Laszlo Agocs2011-12-092-13/+15
| | | | | | | QWidget *widget() is replaced with QObject *target(). Change-Id: Ib2c860480764410cf1527662e89f352ff688b32a Reviewed-by: Lars Knoll <lars.knoll@nokia.com>