summaryrefslogtreecommitdiffstats
path: root/src/gui
Commit message (Collapse)AuthorAgeFilesLines
* Fix QGraphicsView::mapToScene(QRect) to avoid extra adjustments.Andreas Aardal Hanssen2009-04-171-7/+8
| | | | | | | | | | | | | | | The QGraphicsView::mapToScene(QRect) function assumes that QRect and QRectF share semantics for ::bottomRight(). However, since QRect follows Qt 3 semantics (the rect is based on viewport pixels and (0,0,1,1) is equivalent to one pixel, topleft = bottomright), this function gives unexpected behavior: map(0,0,1,1) gives you an empty polygon! To work around this, users of the function need to adjust their rectangles with (0,0,1,1) to get the correct behavior, matching what QRectF does. QRectF(0,0,1,1).bottomRight() == QPointF(1,1) QRect(0,0,1,1).bottomRight() == QPoint(0,0) Reviewed-by: TrustMe
* Merge branch '4.5' of git@scm.dev.nokia.troll.no:qt/qtSimon Hausmann2009-04-1710-131/+196
|\ | | | | | | | | Conflicts: tests/auto/qpainterpath/tst_qpainterpath.cpp
| * Line edit displays garbage when pressing up or down arrow keys (Cocoa).Prasanth Ullattil2009-04-171-1/+4
| | | | | | | | | | | | | | | | | | The unicode characters between 0xF700 & 0xF8FF are special function-key code characters used by the NSEvent. These characters have to be ignored when converting to a QString. Task-number:244486 Reviewed-by:nrc
| * CompileOlivier Goffart2009-04-161-1/+1
| | | | | | | | Reviewed-by: TrustMe
| * QSortFilterProxyModel: In dynamic filter model, childs of temporarlyOlivier Goffart2009-04-161-1/+13
| | | | | | | | | | | | | | | | | | | | filtered items are not correctly updated. when filtering away a row, we should remove all the mapping of the children Task-number: 251296 Reviewed-by: Marius Bugge Monsen
| * BT:Stop widgets disappearing in unified when clicking the toolbar buttonNorwegian Rock Cat2009-04-161-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The comment in the code pretty much says it all, so I'll repeat it: This is a workaround for NSToolbar. When a widget is hidden by clicking the toolbar button, Cocoa reparents the widgets to another window (but Qt doesn't know about it). When we start showing them, it reparents back, but at this point it's window is nil, but the window it's being brought into (the Qt one) is for sure created. This stops the hierarchy moving under our feet. Task-number: 251294 Reviewed-by: Prasanth Ullattil
| * Remove some warningsNorwegian Rock Cat2009-04-161-2/+2
| | | | | | | | These aren't used in Carbon, so don't reference them.
| * Doc - Some minor cleanups in the documentation of QInputDialog. AlsoKavindra Devi Palaraja2009-04-161-85/+96
| | | | | | | | | | | | | | | | | | | | marked getInt() as since Qt 4.5 and finally modified the StandardDialogs example to reflect the fact that getInteger() is deprecated. Task-number: 251288 Reviewed-by: nrc <qt-info@nokia.com> BT: Yes
| * Fix QPrinter::setPrinterName()/QPrinter::printerName() on the Mac.Trond Kjernåsen2009-04-162-28/+39
| | | | | | | | | | | | | | | | | | | | | | | | QPrinter::printerName() used to return the CUPS printer queue name instead of the user-set printer name, which was wrong. In addition, if trying to set the printer name to a non-valid printer, the default printer was still used internally, which is not correct. As sonn as an invalid name is set, the printer now enters an invalid state, which it can only get out of by setting a valid printer name. Task-number: 199271 Reviewed-by: Gunnar
| * Fix crash in the SQLQueryModel testsOlivier Goffart2009-04-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Amend fd5f83e612729cebc5395c992bd98628bb9ea25f calling fetchMore in create_mapping was a bad idea bacause it may lead to infinite recurtion Make a special case for hasChildren instead Task-number: 250023 Reviewed-by: Marius Bugge Monsen BT: yes
| * Fix a bug that made it hard to click the top items in a list widgetNorwegian Rock Cat2009-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | Our "view under tranparent view" function was sound, but it didn't take into consideration that fact that views in the hierarchy could be hidden. This is most prominent when you have a QFocusFrame over a QAbstractScrollArea. Task-number: 251008 Reviewed-by: Morten Sørvig
| * Fixed titlebar on X11 for fixed size windows with Qt::CustomizeWindowHintDenis Dzyubenko2009-04-161-1/+3
| | | | | | | | | | Task-number: 250326 Reviewed-by: Brad
| * QFileDialog: When passing an invalid path in static functions the nativeAlexis Menard2009-04-161-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dialog don't appear on Windows. The problem is with the directory that you can specify when calling the static functions. It can include a file in that path which means that the file will be selected by default when the dialog appears. But if you give an invalid file as a selection to the Windows API, then it simply don't display the dialog. The patch is basically checking the dir we get when we are called. workingDirectory tested it already and fallback to the current directory if the argument is invalid. I just check now if workingDirectory changed the path (that means the parameter value was incorrect) and select nothing in that case. Using this trick avoid stating again the complete path to check if the selection exist. (i.e. path() on QFileInfo don't call stat()). Task-number: 250120 Reviewed-by: jan-arve Reviewed-by: jasplin
| * QX11Embed crashes on 64-bit SolarisBradley T. Hughes2009-04-161-4/+3
| | | | | | | | | | | | | | | | The data passed to XChangeProperty should be long arrays, as this is what Xlib expects. Task-number: 244062 Reviewed-by: Rhys Weatherley
| * GTK: Fix line edit background color with custom brushJens Bache-Wiig2009-04-151-1/+1
| | | | | | | | | | | | | | We should allways use the brush and not the color if possible. Task-number: 240842 Reviewed-by: nrc
| * QFileDialog : Fix filters that doesn't work if whitespaces at the endAlexis Menard2009-04-151-6/+10
| | | | | | | | | | | | | | | | The fix is basically remove the whitespaces at the end otherwise the reg exp will be wrong. Task-number: 240789 Reviewed-by: jasplin
| * Fixed painting issues with draggable tabsJens Bache-Wiig2009-04-153-75/+57
| | | | | | | | | | | | | | | | | | | | | | This fixes a few of the remaining glitches tabbar animations have: * We no longer grab tabs but paint them through QStyle. This makes tabs work and animate correctly when they are outside the visible region. * Buttons now correctly follow tabs when dropped * Gtkstyle recieved some polish to make it look more native. Task-number: 247694, 251166 Reviewed-by: nrc
| * Prevent crash in qt_scrollRectInImage.Samuel Rødal2009-04-151-2/+5
| | | | | | | | | | | | | | | | Clip both against the source and target device rectangles. Task-number: 247937 Reviewed-by: Trond BT: yes
| * Update the item if the text has changed but the boundingRect is theAlexis Menard2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | same. updateBoudingRect update the item only if the boundingRect change but if we have 123 as an initial text and then we set 321 as the new text, then nothing happen because the rect is the same. In case the boundingRect change then we call update 2 times but the item is already dirty so the second call will just return. BT:yes Reviewed-by: Andreas
| * BT: Namespace compile fixes for Cocoa.Norwegian Rock Cat2009-04-153-6/+15
| | | | | | | | It worked in 4.5.0, so it should work in 4.5.1 too.
| * BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.Norwegian Rock Cat2009-04-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
| * BT: Fix a crash on certain theme changes in GNOMEJens Bache-Wiig2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | We did not update initGtkWidgets on theme changes which could lead to crashes as the contents of the widget hash depend on certain properties in the style. A simple way to reproduce this would be to change between the redmond gtk theme and cleanlooks. Task-number: 251115 Reviewed-by: paul
| * The submenu of a multicolumn menu have an incorrect positionThierry Bastian2009-04-151-2/+2
| | | | | | | | | | | | | | | | The submenu would always appear to the side of the menu instead of its right. Task-number: 250673 Reviewed-by: ogoffart
* | Fix two bugs in Graphics View's mouse grab logics + add autotests.Andreas Aardal Hanssen2009-04-172-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change fd4d94df4eb16e9e54f61dd8ee45914e24832ae9 introduced mouse grab and keyboard grab support to Graphics View (this was as part of 4.4). The change was missing a large set of autotests that I wrote to test the behavior of these features. As part of task 245317, which involves investigating modality in Graphics View, I figured it would be a good idea to start off but reconstructing these autotests. So this change is mainly about adding autotests for mouse grabbing. And of course, as it always is, I found two bugs while writing these tests. 1) Calling QGraphicsItem::grabMouse() while the item is holding the implicit mouse grab will now upgrade the implicit grab to an explicit grab. 2) Adding a popup to the scene will automatically grab the mouse. Before, the popup would get the grab on show(), but if it was already visible when added to the scene it would not gain the grab. Task-number: 245317 Reviewed-by: jasplin
* | QTreeView automatic resize can be brokenThierry Bastian2009-04-162-20/+19
| | | | | | | | | | | | | | QTreeView sometimes autoresizes the wrong column Task-number: 210390 Reviewed-by: janarve
* | Make subpixel antialiasing of text work on Mac OS X under carbonGunnar Sletta2009-04-164-41/+92
| | | | | | | | | | | | | | | | | | | | Implement the alphaRGBMapForGlyph function and make use of it in the raster engine. The gamma correction is currently hardcoded to 2.0 which looks very good on two separate displays (iMac and MacBook Pro). Ideally this would be picked from the system settings or computed dynamically, but as long as 2.0 works, we'll stick to that. Reviewed-by: Samuel
* | Optimize vector normalize for vectors of length 1Rhys Weatherley2009-04-155-39/+63
| | | | | | | | | | | | If the square of the length is very close to 1, then avoid the qSqrt(). Reviewed-by: trustme
* | Add the QQuaternion::nlerp() function as a counterpart to slerp()Rhys Weatherley2009-04-152-0/+41
| | | | | | | | | | | | | | | | nlerp() implements "normalized linear interpolation", which is faster than slerp() and gives approximate results that are good enough for some applications. Reviewed-by: trustme
* | Rename QQuaternion::interpolate() to slerp()Rhys Weatherley2009-04-152-2/+2
| | | | | | | | | | | | slerp() is the more common-place name in the 3D community. Reviewed-by: trustme
* | Remove the int constructors from the vector classesRhys Weatherley2009-04-158-37/+0
| | | | | | | | | | | | | | | | The int constructors existed to make fixed-point conversions faster in certain circumstances. With the removal of fixed-point support, they are no longer required. Reviewed-by: trustme
* | GTK: Fix line edit background color with custom brushJens Bache-Wiig2009-04-151-1/+1
| | | | | | | | | | | | | | We should allways use the brush and not the color if possible. Task-number: 240842 Reviewed-by: nrc
* | QFileDialog : Fix filters that doesn't work if whitespaces at the endAlexis Menard2009-04-151-6/+10
| | | | | | | | | | | | | | | | The fix is basically remove the whitespaces at the end otherwise the reg exp will be wrong. Task-number: 240789 Reviewed-by: jasplin
* | Fixed painting issues with draggable tabsJens Bache-Wiig2009-04-153-75/+57
| | | | | | | | | | | | | | | | | | | | | | This fixes a few of the remaining glitches tabbar animations have: * We no longer grab tabs but paint them through QStyle. This makes tabs work and animate correctly when they are outside the visible region. * Buttons now correctly follow tabs when dropped * Gtkstyle recieved some polish to make it look more native. Task-number: 247694, 251166 Reviewed-by: nrc
* | Prevent crash in qt_scrollRectInImage.Samuel Rødal2009-04-151-2/+5
| | | | | | | | | | | | | | | | Clip both against the source and target device rectangles. Task-number: 247937 Reviewed-by: Trond BT: yes
* | Update the item if the text has changed but the boundingRect is theAlexis Menard2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | same. updateBoudingRect update the item only if the boundingRect change but if we have 123 as an initial text and then we set 321 as the new text, then nothing happen because the rect is the same. In case the boundingRect change then we call update 2 times but the item is already dirty so the second call will just return. BT:yes Reviewed-by: Andreas
* | BT: Namespace compile fixes for Cocoa.Norwegian Rock Cat2009-04-153-6/+15
| | | | | | | | It worked in 4.5.0, so it should work in 4.5.1 too.
* | BT: Fix Cocoa bug w/OpenGL widgets in dock widgets would disappear.Norwegian Rock Cat2009-04-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | The NSOpenGLContext seems to be tied to the window. So if the view changes from one window to another, the OpenGL context needs to be cleared. We can do this by hooking into the viewWillChangeWindow and viewDidChangeWindow events and clear and reset the drawable respectively. We also found out that QCocoaOpenGLView was not being used at all, so just remove it to get rid of any confusion. Task-number: 250066 Reviewed-by: Trond
* | BT: Fix a crash on certain theme changes in GNOMEJens Bache-Wiig2009-04-151-0/+1
| | | | | | | | | | | | | | | | | | | | We did not update initGtkWidgets on theme changes which could lead to crashes as the contents of the widget hash depend on certain properties in the style. A simple way to reproduce this would be to change between the redmond gtk theme and cleanlooks. Task-number: 251115 Reviewed-by: paul
* | The submenu of a multicolumn menu have an incorrect positionThierry Bastian2009-04-151-2/+2
| | | | | | | | | | | | | | | | The submenu would always appear to the side of the menu instead of its right. Task-number: 250673 Reviewed-by: ogoffart
* | Make QIcon update after palette changesJens Bache-Wiig2009-04-151-0/+2
| | | | | | | | | | | | | | | | We have to add the palette cacheKey to ensure that the icon is properly regenerated after a system palette change. Task-number: 250542 Reviewed-by: nrc
* | Tiny optimization to QImage::setColorTable()Gunnar Sletta2009-04-151-2/+6
| | | | | | | | Task: 250730
* | Clean up and fix bug in merge conflict for 21099dac.Andreas Aardal Hanssen2009-04-151-10/+12
| | | | | | | | | | | | | | | | Make use of QPolygonF::translated and QPainterPath::translated to ensure all mapToParent functions follow the exact same pattern. This makes it clear that the functions do the same and do it the same way. Reviewed-by: bnilsen
* | Merge commit 'origin/4.5'Olivier Goffart2009-04-1539-294/+339
|\ \ | |/ | | | | | | Conflicts: src/gui/graphicsview/qgraphicsitem.cpp
| * Fixes QSortFilterProxyModel not reporting child if the model need to fetchMoreOlivier Goffart2009-04-151-0/+3
| | | | | | | | | | | | | | | | QSortFilterProxyModel::hasChildren need to construct the mapping. And when it tries to construct the mapping, it needs to fetch the childs, so there is none. Task-number: 250023 Reviewed-by: Marius Bugge Monsen
| * Fixes warning about potential use of uninitialized valueOlivier Goffart2009-04-151-14/+12
| | | | | | | | Reviewed-by: bnilsen
| * BT: Fix a regression to 4.4 in Graphics View's handling of child clippersAndreas Aardal Hanssen2009-04-151-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regression caused by optimizations in QGraphicsItem and QGraphicsScene. The changes in QGraphicsItem fix bugs in QGraphicsItem::mapToParent functions, which did the translation before applying the transformation, instead of the other way (transform, then translate). This bug caused almost all mapToParent and mapRectToParent functions to behave wrongly. Unfortunately the new helper functions in QGraphicsScene for discovering items made use of these functions, which introduced a regression. Fixing these functions also fixes item discovery. The other part of this change fixes a regression caused by c1909321, which luckily happened after 4.5.0 and never saw the light of day. The fix is to also invalidate the cached clip path even if there is no scene, which is necessary if you build your scene graph outside the scene, and finish off by adding the root item to the scene. Task-number: 250680 Reviewed-by: Alexis
| * Don't crash or loop infinitely when we retrieving the accessible accel.Jan-Arve Sæther2009-04-151-3/+10
| | | | | | | | | | | | | | | | qt_accHotKey() was pretty buggy; it could both crash or spin forever in some cases. Task-number: 221731 Reviewed-by: alexis
| * Fix typo in documentation.Jason McDonald2009-04-151-1/+1
| | | | | | | | | | | | Error was introduced in change 52f87de53328c661049acf09d5fedc1850aa9bfa. Reviewed-by: Trust Me
| * QGraphicsItem: When an item is deleted and eventfilters installedAlexis Menard2009-04-141-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | The problem here is that we are filling the sceneEventFilters map when we install evenfilter but we never remove the references of an item if it has been removed from the scene or deleted. The deletion can keep stale pointers into the map and a crash can happen. BT:yes Task-number:250272 Reviewed-by: bnilsen Reviewed-by: andreas
| * QGraphicsView: Rubber Band drag mode not updated correctly when scrolling ↵Alexis Menard2009-04-141-20/+20
| | | | | | | | | | | | | | | | | | | | | | [regression] The problem was that we didn't update the new region when we paint the rubber band and we scroll at the same time BT:yes Task-number: 245766 Reviewed-by: bnilsen Reviewed-by: andreas