summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* Remove event type parameter from handleTouchEvent.Laszlo Agocs2011-12-092-8/+14
| | | | | | | | | | | Requiring platform and generic plug-ins to pass TouchBegin, TouchUpdate, or TouchEnd is unnecessary. The type can be easily deduced from the touch point states. In fact handleTouchEvent already collected the combined point states, it was just not utilized until now. Change-Id: Icf3c787fefdebc51609a763bc4286c18a0b6aac2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Extend touch events.Laszlo Agocs2011-12-0911-38/+575
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The capability flags indicate which information is valid in the touch points. Previously there was no way to tell if e.g. the value returned by pressure() is actually the value provided by the driver/device or it is just something bogus due to pressure not being supported. The points' flags return information about the individual touch points. One use case is to differentiate between touches made by finger and pen. Velocity, if available, is now also exposed. Each touch point can now contain an additional list of "raw" positions. These points are not reported individually but are taken into account in some way by the underlying device and drivers to generate the final, "accurate" touch point. In case the underlying drivers expose these additional positions, they are made available in the lists returned by the touch points' rawScreenPosition(). The raw positions are only available in screen coordinates to prevent wasting time with mapping from global positions in applications that do not use this data. Instead, apps can query the QWindow to which the touch event was sent via QTouchEvent::window() and can call mapFromGlobal() manually if they need local raw positions. The capability and device type information is now held in a new QTouchDevice class. Each touch event will contain only a pointer to one of the global QTouchDevice instances. On top of type and capability, the new class also contains a name which can be used to differentiate between multiple touch input devices (i.e. to tell from which one a given QTouchEvent originates from). The introduction of QTouchDevice has three implications: The QTouchEvent constructor and QWindowSystemInterface::handleTouchEvent need to be changed (to pass a QTouchDevice pointer instead of merely a device type value), and each platform or generic plug-in is now responsible for registering one or more devices using the new API QWindowSystemInterface::registerTouchDevice. Change-Id: Ic1468d3e43933d8b5691d75aa67c43e1bc7ffe3e Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Create a class to contain accessibilty enums.Frederik Gladhorn2011-12-086-39/+55
| | | | | | | | This is needed in order to expose the enums to qml. Do not inherit QAccessible. Change-Id: I220a0ea3add2d790e4fa6e93ce3deda762859e1a Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Better handling of GLX / EGL errors.Samuel Rødal2011-12-072-4/+9
| | | | | | | | | | If context creation fails, try again without a shared context. Added QPlatformOpenGLContext::isSharing() and QPlatformOpenGLContext::isValid() to propagate whether the platform context was successfully created with or without sharing. Change-Id: I37080b645f531fd207946441057be6d3f6be3f6e Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* Accessibility: Add Text::DebugDescriptionMorten Johan Sorvig2011-12-071-0/+1
| | | | | | | | Useful for debugging QML accessibility. Change-Id: I814c64bcc4c6b534666adca5865b1588e4d13f44 Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* qpixmap_win.cpp: Fix typo in format conversion (alpha).Friedemann Kleint2011-12-051-2/+2
| | | | | Change-Id: I8abdae5482e94a7f9af494e5d547352431285336 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Remove unused enum values.Frederik Gladhorn2011-12-041-3/+1
| | | | | | | | | These were used for foreground/background color. Since we have proper functions for these two now, the hack with invoke_method is no longer needed. Change-Id: I66eb645124caa838adb1ceb41383a2724a45f553 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Added minimal class docs for QWindow to make it visible.Gunnar Sletta2011-12-021-0/+20
| | | | | Change-Id: Ibed2279ba5454547fb4060005e805a11221b3732 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Accessibility: table2 -> tableFrederik Gladhorn2011-12-022-47/+10
| | | | | | | | Rename the new interface after the old one has been removed. This interface is very close to the IAccessible2 Table2 interface. Change-Id: I8659232189fe0e8307151c743727de425c30ac9a Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Remove action enum.Frederik Gladhorn2011-12-011-17/+0
| | | | | | | | This is a left over from the old way of handling accessibility actions. Change-Id: I1146f3dfec2b842f83a3cdd264e4ebb1013cc517 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Make cell a proper QAccessible2Interface.Frederik Gladhorn2011-12-012-7/+10
| | | | | Change-Id: I9b245037e8448f39ed2cb80d1ef5fb0714173518 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Improve Q_CONSTRUCTOR_FUNCTION and Q_DESTRUCTOR_FUNCTION macros.Jędrzej Nowacki2011-12-013-9/+5
| | | | | | | | | | | | | By adding anonymous namespace and static linkage we are reducing visibility of implementation of these macros. This patch also fixes warning about a declared but unused variable which was issued by gcc 4.6 for Q_CONSTRUCTOR_FUNCTION. Change-Id: I2cb70ad4c93f6f77e5518420abcce6fd4cadccfa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* opengl: Do not crash when programGuard is a nullptrHolger Hans Peter Freyther2011-12-011-1/+1
| | | | | | | | The rest of the code is checking programGuard for nullptr, do it here as well to prevent a segmentation fault. Change-Id: I38a03f74d493b8f731157be1739707b39904f7ba Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Added QPA window system interface handler for logical DPI changes.Samuel Rødal2011-12-015-3/+37
| | | | | | | | Logical DPI is independent from geometry and physical DPI. Change-Id: Ice487f61e1bda9e6791e2adf6998ebf61cdbaef2 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jørgen Lind <jorgen.lind@nokia.com>
* engineData should be cached solely based on QFontDefJiang Jiang2011-12-014-11/+11
| | | | | | | | | | | | | | | | | | | | Each QFontPrivate points to a QFontEngineData instance, which is essentially a mapping from different scripts to QFontEngines. Let's say we have QFont("Waree") and trying to use that for one text in Thai and another text in English, there should be only one QFontEngineData: [ QUnicodeTables::Common -> QFontEngineMulti(1), QUnicodeTables::Thai -> QFontEngineMulti(2) ]. If we cache QFontEngineData using QFontCache::Key (which includes QFontDef, script and screen) as the key, then we will create two QFontEngineData: [ QUnicodeTables::Common -> QFontEngineMulti(1) ] and [ QUnicodeTables::Thai -> QFontEngineMulti(2) ], so it will be pointless to have QFontEngineData at all. This bug was introduced in a 2005 refactoring (512f0e8c in history repo). Change-Id: I14677507e97682472cde9a0e1b594e903ec9e718 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Made more QScreen properties NOTIFY and added average DPI properties.Samuel Rødal2011-11-303-14/+90
| | | | | | | | | The physicalDotsPerInch() is the average of the horizontal and vertical physical dots per inch, and likewise logicalDotsPerInch() is the average of the horizontal and vertical logical dots per inch. Change-Id: I18aa610dc9a63efe062f78c823ba29f90b2712f4 Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* Fix casting. Casting is now done through the virtual interface_cast.Jan-Arve Saether2011-11-304-87/+28
| | | | | | | | | Change interface_cast to return void* to avoid using virtual inheritance. Get rid of the magic Q_ACCESSIBLE_OBJECT macro. Change-Id: I94b824aef53f2ba657d39d406b387c8681d47ee4 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Accessible debug stream: don't print details for invalid objectsFrederik Gladhorn2011-11-291-11/+15
| | | | | | | Print "invalid" instead of the details. Change-Id: I785a896b680fad9e9bb81769d9e3361542fbaafe Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Install CMake config files from Qt.Stephen Kelly2011-11-291-0/+4
| | | | | | | | | This includes a BSD licenced file Qt5CoreMacros.cmake which is adapted from Qt4Macros.cmake in the CMake source tree. Change-Id: I54326b808795535490a0489659b351a8da72cdbb Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Added screenChanged() signal and handle screen destruction in QWindow.Samuel Rødal2011-11-292-2/+28
| | | | | | | | It can be useful to get a signal when the QScreen changes, for example when having bindings to QScreen properties in QML. Change-Id: I919dd12c656485b28b393aec5eedac4c01593afc Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
* QtGui: Fix a crash in OpenGL on Windows.Friedemann Kleint2011-11-291-0/+4
| | | | | | | Add missing WINAPI calling convention for QOpenGLFunctions. Change-Id: I43827d801c5ecc3859d8d4ba0bb9bccc108880e7 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* QtGui: Bring back HBITMAP/HICON conversion functions.Friedemann Kleint2011-11-282-0/+320
| | | | | | | | | | - Move the conversion functions from the Lighthouse plugin to QtGui as qt_pixmap/From/To/HBITMAP/HICON(). - Re-enable them in Widgets (QFileIconProvider, QWindowsStyle). - Use them in QtPrintSupport. Change-Id: I1436bc604160d94c78ef270ad2b31bf3b20b5c90 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Add comment to the obscure initialization of QOpenGLFunctions.Friedemann Kleint2011-11-281-0/+4
| | | | | Change-Id: I9386c0e3b158a675e2dcbce34eecb57edf0ac27b Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Introduce QWindowSystemInterface::handleSynchronousCloseEventGunnar Sletta2011-11-252-0/+9
| | | | | | | | | | | | And use it from the Cocoa backend. In general, for threaded GL rendering to work, any function that affect the surface must be synchronous, so the implementor (such as QQuickCanvas) can pick it up and block until the GL context has released the surface. Otherwise, we will crash. Change-Id: Id8484dac7452fe96fa80ade4ea321145f32124b4 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed memory leak in windowing system event handlingGunnar Sletta2011-11-251-4/+4
| | | | | | | | processWindowSystemEvent does not delete the event, so allocate it on the stack instead. Change-Id: Iffda940ffc86ef1fabfbf101e08956fa07c49689 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Change default implementation of window() to just return 0Jan-Arve Saether2011-11-251-6/+6
| | | | | | | | Instead move the traversal up to the ancestors to the bridge. This simplifies the default implementation to just return 0 Change-Id: Ic3ec60851f378587f4a23363aec2039d0e8a08a1 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com>
* Add a note in the QScreen documentation about logical vs physical DPI.Samuel Rødal2011-11-241-0/+11
| | | | | Change-Id: I1d536711cbbc0ea8a21c6917e5e0066c1ad4ccae Reviewed-by: Alan Alpert <alan.alpert@nokia.com>
* emit width/height changes for the new rectGunnar Sletta2011-11-241-4/+4
| | | | | Change-Id: I789a45bc60aaa949d18e9fb72a186a259548ec1d Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Fixed regression in tst_qscreen.Samuel Rødal2011-11-231-1/+18
| | | | | | | | | The ScreenOrientation enum was changed so that the values are power of twos, angleBetween() needed to be fixed in order to reflect this. Task-number: QTBUG-22554 Change-Id: Ia45dd6643b40b14204abf967b00c0d04834736a3 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Improve docs for Accessibility.Frederik Gladhorn2011-11-231-30/+16
| | | | | | | While still lacking, at least try to reflect reality a bit. Change-Id: I8fcd0bd540806f3d1e314c60d854d2a90f66c14e Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Remove virtual child integers.Frederik Gladhorn2011-11-235-46/+34
| | | | | | | | | | | | | | This makes the accessibility apis much simpler and less error prone. Disable the itemviews implementation that is in complex widgets. The itemviews will use the new code from itemviews.h/cpp everywhere now. QToolBox was broken before, now at least it simply exposes all its children. The children are the buttons (tabs of the toolbox) and their contents. Change-Id: I45e218f49f02aebbd678ddfe29f94c2a112a2125 Reviewed-by: Jan-Arve Sæther <jan-arve.saether@nokia.com>
* Code cleanup in QVariant and QMetaType.Jędrzej Nowacki2011-11-221-148/+7
| | | | | | | | | QMetaTypeGuiHelper was generalized and renamed to QMetaTypeInterface. From now all types will have common interface which can be used for basic operations. Change-Id: I50d67f4a8081fa0f75c9d530a8211593ec37bc55 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove explict debug messageJiang Jiang2011-11-221-1/+1
| | | | | Change-Id: I8159651d4894bb828416cddb402c946bbd1a535e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
* Add some properties to QWindowAlan Alpert2011-11-223-1/+72
| | | | | | | | x,y,width,height,visible and orientation Includes slot setters and notify signals for maximal QML compatibility. Change-Id: I124399093c00f8ad1485d4fbae816dfbe3027eff Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
* Remove handlesInputPanelVisibility() deprecation mechanismJoona Petrell2011-11-214-25/+4
| | | | | | | Task-number: QTBUG-21964 Change-Id: I508ba690c90369d31ca33390d3001064857fb62e Reviewed-by: Pekka Vuorela <pekka.ta.vuorela@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Support better committing preedit in QLineControllerPekka Vuorela2011-11-212-0/+29
| | | | | | | | Similar as 7851568c65e0560056c6fa541039543d43a63e20 for QWidgetLineController Change-Id: I7c1a1dc22e9b73515a5a72093866ac747a80896f Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Support input method tentative commit string in QLineControlPekka Vuorela2011-11-212-9/+49
| | | | | | | | | Implements similar behavior as 8bd40fef0733a4796a308b3bc137a05296e142c4 did for QLineEdit. Change-Id: I55de1f9a6703aca629f2e84398e481636c96eeca Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Fix QLineControl work properly with input method selection eventPekka Vuorela2011-11-211-4/+9
| | | | | | | | | Same as what 1189ebff320b8dd03637947c92df6e3ef84a3c06 did for QWidgetLineControl. Change-Id: I0991c2a2af126cfd7203829adc33bb4e6d45a7f2 Reviewed-by: Joona Petrell <joona.t.petrell@nokia.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>