summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QGAL: Add AnchorData::minPrefSize and maxPrefSizeEduardo M. Fleury2009-11-273-46/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the addition of out-of-order sequential simplification, the calculation of preferred sizes became more complicated. In the past, when parallel anchors or the simplex solver had to decide between conflicting preferred sizes, they could assume that increasing the size of an anchor was better than decreasing it. That assumption comes from early discussions with Jan-Arve regarding the preferred size calculation algorithm. However, when ooo-sequential anchors exist, we can have a situation where increasing the size of an anchor can actually reduce the size of a simplified anchor inside it. To solve that, we need to expose some information regarding the internal anchors to the decision makers outside, ie. the simplex solver and parallel anchors. This information is now being provided in terms of two additional values present in each anchor, as follows: - minPrefSize: Always in the interval [minSize, prefSize]. Denotes the minimum size an anchor can assume as to avoid shrinking anchors below their preferred sizes. - maxPrefSize: Always in the interval [prefSize, maxSize]. Similar to the value above, but refering to the maximum size the anchor should assume. Some examples: 1) Standard anchor: 10 / 50 / 500 o----------------------------> Becomes: 10 / 50 / 50 / 500 / 500 o----------------------------> We'd rather grow than shrink, so we say that our preferred size is 50, but if we need to grow up to 500, that's OK. Note that we are still able to shrink all the way to 10, but it will hurt us more. 2) Two anchors: 100 / 200 / 500 10 / 20 / 40 o--------------------> <-------------------o Resulting sequential anchor: 60 / 160 / 180 / 480 / 490 o------------------------------------------> The resulting anchor have a preferred size of 180 but it can "easily" grow to 480 (only the first half grows). If it had to go all the way to 490 the second half would have to shrink below its preferred size. OTOH, if it had to shrink, it could go to 160 if the second half grew. However, shrinking even more, towards 60, would require the first half to shrink below its preferred size. With this information parallel and simplex are now able to choose the best solutions when solving conflicts. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: parallel anchors sometimes have to fix constraintsCaio Marcelo de Oliveira Filho2009-11-271-16/+35
| | | | | | | | | | | | | | | | For an out-of-order parallel anchor, i.e. when the second child is backwards in relation to the parallel anchor, we need to fix the constraints that used to have the second child. The parallel anchor will replace its child, but we must change the multiplier signal, so the constraint remain valid. This commit also changes the order of restoration steps, since now we depend on correct vertex information to fix back the constraints, we do it before the restoring of pair vertices. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
* QGAL: move second child direction check to a functionCaio Marcelo de Oliveira Filho2009-11-272-12/+24
| | | | | | | | | In a parallel anchor, the second child anchor may be forward or backwards in relation to the parallel itself. Moves the directionality check to a function. It'll be useful in the next commit. Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
* QGAL: Use single arrow in "dumpGraph"Eduardo M. Fleury2009-11-271-1/+1
| | | | | | | | | | | Modify the "dot" format graph to use a single arrow between each pair of vertices. Previously we would use two anchors (a black forward one and a gray backwards). With a single arrow the graph loooks cleaner. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Enable out-of-order sequential simplificationEduardo M. Fleury2009-11-272-47/+23
| | | | | | | | | | | | | | Modify the simplification code to allow the creation of out-of-order sequential anchors. Basically the "changedDirection" end-of-sequence condition was removed, also note that createSequence no longer bothers to revert the direction of anchors if the order it receives is not standard. Removing expect-fail clause from test since now we pass :-) Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Support for out-of-order sequential anchorsEduardo M. Fleury2009-11-271-6/+34
| | | | | | | | | | | Now sequential anchors account for the fact they may be composed of anchors with different directions. Both refreshSizeHints and updateChildrenSizes have been updated to support this situation. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Do not revert negative anchorsJesus Sanchez-Palencia2009-11-272-23/+4
| | | | | | | | Since we now support anchors with size less then zero, we no longer need to revert anchors with negative spacing. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Limit absolute size of anchors and add offset to calculationEduardo M. Fleury2009-11-272-12/+57
| | | | | | | | | | | | | | | | | | | | | This commit is groundwork for the support of negative-sized anchors by the simplex solver. The idea is to add to all variables an offset large enough to ensure they are never negative. The implementation limits all variable sizes in the range [-limit, limit] and feed them into the simplex with an offset of "limit". Subtracting this offset later to find out the real values. "limit" is defined as QWIDGETSIZE_MAX for platforms where qreal is double and as QWIDGETSIZE_MAX / 32 when it is float. This is to avoid numerical errors in the simplex solver. This commit also modifies the ASSERT clause inside QSimplex so it becomes less prone to false positives due to numerical errors. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL: Rename internalSizeHints to applySizePolicyEduardo M. Fleury2009-11-271-10/+15
| | | | | | | Former name did not reflect actual work done by the function. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
* QGAL (Test): Fix memory leaks in example and testsEduardo M. Fleury2009-11-273-20/+34
| | | | | | | | | | | Some tests and the example were leaking memory what made it harder to investigate leaks on the layout itself. Those were simple errors like not deleting the layout at the end of the test and were corrected. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
* QGAL: Fix memory management issues (leak + invalid read)Eduardo M. Fleury2009-11-272-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing QGraphicsAnchor memory leak and access to free'd region. -- Leak: User-created anchors have two representations in QGAL, one visible externally (QGraphicsAnchor) and other internal (AnchorData). When such anchors are removed externally (QGraphicsAnchor is deleted), the former implementation ensured that the internal representation would be deleted too. However the opposite was not true. In cases where the anchors are deleted internally (in the layout destructor, for instance, or when an item is removed through the removeAt API), the public QGraphicsAnchor object would leak. This commit ensures the deletion will happen in both directions and adds protection to avoid a deletion loop. -- Invalid read: In QGAL::removeAnchor(vertex1, vertex2), we read vertex information after calling removeAnchor_helper(vertex1, vertex2). The problem is that in cases where the removed anchor is the last anchor to connect to a center vertex, its removal will cause also the removal of such vertex. Thus, accessing the vertices after the removeAnchor_helper() call is unsafe. To solve that we cache the information we need and then clear the vertex pointers to avoid errors in the future. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
* QGAL: Prevent internal anchors from being exposed by QGAL::anchor()Eduardo M. Fleury2009-11-271-2/+14
| | | | | | | | | | | Adding check to prevent the structural layout anchors as well as those internal to items, from being exposed through the public API. These checks also ensure no QGraphicsAnchor instances will be created for those anchors. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
* QGAL (Test): Add QGraphicsAnchor handling testEduardo M. Fleury2009-11-271-0/+37
| | | | | | | | | This test ensures that internal anchors are not exposed through the QGAL::anchor() API and also that the QGraphicsAnchors are deleted when the associated anchors are deleted internally. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Artur Duque de Souza <artur.souza@openbossa.org>
* QGAL: default spacing can be unset using a negative valueEduardo M. Fleury2009-11-272-21/+43
| | | | | | | | | | | After a default spacing is set through QGAL::setSpacing() family of methods, the user must be able to unset it. To avoid adding another public method, we enabled this feature by allowing a negative value to be passed to those methods. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Anselmo Lacerda S. de Melo <anselmo.melo@openbossa.org>
* Background in landscape mode on S60 5.0 is brokenSami Merilä2009-11-261-0/+1
| | | | | | | | | | | | | After initial fix, 99% of widgets draw temselves properly after orientation switch. However, QScrollAreas lose their palette hash, which causes scrollarea background to re-start from theme background top-left. As a correction, we re-set the theme palette hash after calling QApplication::setPalette, since that clears palette hash. Task-number: QTBUG-6125 Reviewed-by: Alessandro Portale
* Fixing background painting after orientation switch.Alessandro Portale2009-11-262-1/+2
| | | | | | | | | | | | | | | | Fixing previous fixes of QS60StylePrivate::setBackgroundTexture with commit SHAs a80e58335e69c8ce96d1596e0ed2d14e424a0d5e and d4089399a3ab7548a864d5a399e08df85c444783 Now, the palette gets the updated background brush and the palette is actually set as application palette. Also making sure that QS60StylePrivate::handleDynamicLayoutVariantSwitch does the right things in the right order. So that Table headers are not broken after orientaion switch. Task-number: QTBUG-6125 Task-number: QT-1478 Reviewed-by: Shane Kearns
* Fix crash of QtWebKit on any page with Flash when compiled witn MinGW.Jocelyn Turcotte2009-11-251-2/+2
| | | | | | | | Early push of this fix which should be overwritten by the fix upstreamed in WebKit trunk later. Reviewed-by: Simon Hausmann (cherry picked from commit dddd3e5fc9658ebbb5f94b343e7c7c0cd27eb7f2)
* Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6David Boddie2009-11-2534-107/+487
|\
| * On Windows Flash is played only while moving mouse inside the plugin.Prasanth Ullattil2009-11-251-1/+1
| | | | | | | | | | | | | | | | Qt is using the same window message as Flash plugin. We need to check the window handle before we treat this as Qt internal message. Reviewed-by: Bradley T. Hughes (cherry picked from commit 48e56643f1b7daf7c255a1e58f0e213b06e15f65)
| * Merge commit 'oslo-staging-2/4.6' into upstream/4.6Olivier Goffart2009-11-2531-99/+476
| |\
| | * Fix QTreeWidgetItem::setChildIndicatorPolicy not updating.Olivier Goffart2009-11-242-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is that the ChildIndicatorPolicy change the hasChildren in the model. But this is cached in the QTreeView layout. We must do a relayout to clear the cache. Reviewed-by: Thierry Task-number: QTBUG-3071
| | * Fixes rendering issues when rendering a QWidget to PDF with WindowsXP Style.Yoann Lopes2009-11-241-1/+1
| | | | | | | | | | | | | | | | | | | | | The problem was that the images added to the PDF were not clipped to the expected area. Task-number: QTBUG-3412 Reviewed-by: Trond Kjernaasen
| | * Make paste + undo behave in QLineEdit as it does in QTextEditThierry Bastian2009-11-242-1/+44
| | | | | | | | | | | | | | | | | | | | | On the undo/redo stack, it needs to be treated as a separate command Task-number: QTBUG-5786 Reviewed-by: ogoffart
| | * Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into ↵axis2009-11-241-1/+1
| | |\ | | | | | | | | | | | | 4.6-staging2
| | | * Small doc fix.axis2009-11-241-1/+1
| | | | | | | | | | | | | | | | RevBy: Trust me
| | * | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6-staging2axis2009-11-2415-13/+127
| | |\ \
| | * | | Mac: Fixes painting artifacts in Graphics ViewBjørn Erik Nilsen2009-11-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that pending updates were not dispatched properly on the Mac, which is strongly required in order to get correct behavior wrt QGraphicsItem::update(). Task-number: QTBUG-4160 Reviewed-by: bnilsen
| | * | | Mac: Fixes broken window decorations for QGraphicsProxyWidget.Bjørn Erik Nilsen2009-11-242-2/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was the QMacStyle didn't handle the pixel metric for PM_TitleBarHeight correctly when passing a style option containing an unitialized rect (empty rect). It already had special logic for invalid rects, so the fix is simply to extend the check to also handle empty rects. Auto-test included. Task-number: QTBUG-4160 Reviewed-by: msorvig
| | * | | Itemview: Fixes statustip not clearedOlivier Goffart2009-11-242-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-1717 Reviewed-by: Thierry
| | * | | Fix QFile::map in Linux 64bitOlivier Goffart2009-11-241-1/+1
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | On 64bit, qint64(size_t(-1)) = -1 Reviewed-by: Joao Reviewed-by: Thiago
| | * | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into ↵axis2009-11-242-19/+6
| | |\ \ | | | | | | | | | | | | | | | 4.6-staging2
| | | * | Removed window activation hack, unified and fixed title&icon setting.Janne Anttila2009-11-232-19/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The window activation hack is not needed anynmore since AppUi()->RemoveFromStack() ensures the next visible window will get the keyboard focus. Hack removal also required change to window title setting logic. Since window title (and icon) are associated to top-level windows, the logical place to set them is the same place where active window is changed i.e. QApplication::setActiveWindow is called. At the same time also window icon setting from show_sys was move to focusChanged to make icon/title setting more consistent. When changing orientation or switching to different statuspane mode we receive KInternalStatusPaneChange events for each window in QSymbianControl::HandleResourceChange. When receiving such event we only need to reset the icon for focused/visible window. If we don't handle it like this, it might happen that invisible widget added to control stack resets the global icon/title. Task-number: QTBUG-5780 Reviewed-by: Axis
| | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Eskil Abrahamsen Blomfeldt2009-11-2347-248/+837
| | |\ \ \
| | | * | | Fixed endless loop when printing a QTextDocument.Trond Kjernåsen2009-11-231-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the user enters a valid page range, which lies outside of the actual number of printable pages, we can't detect that until the document has been paginated. Task-number: QTBUG-6051 Reviewed-by: Kim
| | | * | | Make the menubar filter out EScape only if there is a current actionThierry Bastian2009-11-232-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-4965 Reviewed-by: gabi
| | | * | | Compile fix for win32-icc.Jan-Arve Sæther2009-11-231-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Intel Compiler inlined the destructor of QObjectPrivate too agressively, causing it to generate a call to ~QObjectData for QtGui. ~QObjectData is not exported from QtCore, so it failed linking. Task-number: QTBUG-5145 Reviewed-by: Alexis Menard
| | | * | | Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6Jan-Arve Sæther2009-11-2335-229/+636
| | | |\ \ \
| | | | * | | Fixes qlistview failing autotest: QTBUG_5877_skippingItemInPageDownUpLeonardo Sobral Cunha2009-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: ogoffart
| | | | * | | Make the buttons react on mouse release only if it was pressedThierry Bastian2009-11-232-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-3521 Reviewed-by: prasanth
| | | | * | | Merge 'upstream/4.6' into oslo-staging-2/4.6Olivier Goffart2009-11-2330-220/+564
| | | | |\ \ \
| | | | * | | | Fix QHeaderView when the model is reset and section have moved.Olivier Goffart2009-11-232-6/+65
| | | | | |/ / | | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The logicalIndices and visualIndices array where not clean of the old sections, resulting in corrupted header. Task-number: QTBUG-6058 Reviewed-by: Thierry
| | | * | | | Merge branch 'fixes' of ↵Jan-Arve Sæther2009-11-233-12/+102
| | | |\ \ \ \ | | | | |/ / / | | | |/| | | | | | | | | | git://gitorious.org/~fleury/qt/fleury-openbossa-clone into fleury-fixes2
| | | | * | | QGAL: sizeHint constraints needed by anchors parallel with the layoutEduardo M. Fleury2009-11-202-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method "constraintsFromSizeHints" does not create constraints for anchors between the layout vertices _only if_ these anchors have infinite maximum sizes. However, this test was not being done for half-anchors, ie. those created when the layout center anchorage point is used. That was OK when there was no chance that the center anchors had been simplified by a parallel anchor. Nowadays there's a chance that happens, so the test was extended. Commit also adds a test to avoid regressions. Signed-off-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>
| | | | * | | QGAL: deal correctly with anchors in parallel with the layoutCaio Marcelo de Oliveira Filho2009-11-203-6/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the preferred size calculation, we should not add 'layout anchors' (either one or the two halves) into the objective function, since the layout doesn't impose or prefer any size at all. This already worked for cases when the layout anchor is one, but not when we have two halves. The mechanism was a 'skipInPreferred' flag that were not being set. The flag is pretty much redundant right now, since we can get this information from the 'isLayoutAnchor' flag. So, the flag was removed and a test was added for both a parallel case with the entire layout and other with half of the layout (which wasn't passing before). Signed-off-by: Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org> Reviewed-by: Eduardo M. Fleury <eduardo.fleury@openbossa.org>
| | | * | | | Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt-s60-public into ↵axis2009-11-235-6/+57
| | | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | 4.6-staging2
| | | | * | | | Add support for opening Real Media RAM files.Frans Englich2009-11-202-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by Nokia Dallas/Helix team. Patch supplied by Fu Liz EXT-DextraTech/Dallas, minor changes by me. Task-number: QTBUG-4882 Reviewed-by: Gareth Stockwell
| | | | * | | | Docs: Symbian: correct capabilities wrt. Helix Phonon plugin.Frans Englich2009-11-201-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed-by: Gareth Stockwell
| | | | * | | | Symbian: Add capability NetworkServices.Frans Englich2009-11-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From discussions with Helix team. Reviewed-by: Gareth Stockwell
| | | | * | | | Fix ICON keyword to work with absolute paths also in SBSv2.Janne Anttila2009-11-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-4745 Reviewed-by: Miikka Heikkinen
| | * | | | | | Fix positioning of diacritics in .otf fonts on WindowsEskil Abrahamsen Blomfeldt2009-11-232-44/+63
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since .otf fonts are not considered truetype fonts, they take the code paths intended for non-outline fonts. When calculating the bounding box of a glyph, this would mean we'd find the largest possible bounding rect of any glyph in the font, while the other metrics, such as the GPOS tables used to position diacritics in relation to base glyphs, are positioning the actual outline of the glyph. The result was that certain diacritics that depended on the opentype positioning would not be shown on Windows at all, as they would be positioned based on the wrong left bearing and height when drawn into the glyph cache. The fix is to find the tight bounding rect of the outline whenever possible and fall back to the old code when this fails. I've also added the left bearing of the glyph to the bounding box in the fallback case, as we did not respect this before and would misplace glyphs that has a bearing. Task-number: QTBUG-5860 Reviewed-by: Trond