summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qgridlayoutengine.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Adjust sizes when snapping layout items to pixel gridJan Arve Sæther2016-03-021-12/+31
| | | | | | | | | When "importing" the size hints into the cells, make sure that the cells minimum sizes are ceiled up to the closest integer. Change-Id: Id00177468e8b1e12bc1231c7351b2136f94f7300 Task-number: QTBUG-41216 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix undefined symbols in grid layout engine with -no-widgets optionJoni Poikelin2015-03-161-4/+0
| | | | | | Task-number: QTBUG-44980 Change-Id: I2bf7a3f8814e10daafb703ed365caac1e13d3704 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Use C++ <cmath> instead of <math.h>Allan Sandfeld Jensen2015-02-161-2/+2
| | | | | | | | | | | | | | Including math.h can pollute the default namespace, and break some compilers if cmath versions of the method are declared as using. Switching to C++ math functions also greatly simplifies handling of float qreal as C++ automatically chooses the right method. [ChangeLog][QtCore][QtMath] qmath.h no longer includes math.h, so any sources depending on that indirect inclusion may fail to build. Change-Id: I4d0e331dafba354ec05dc5052e61ef4ff8d387fe Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Add support for snapping to pixel gridJan Arve Saether2015-02-091-18/+41
| | | | | | | | | | | | | | | | | | | | | This enables us to do more intelligent distribution than simply doing the rounding on each individual items geometry (which often leads to larger spacings than specified). Instead of doing the rounding on the output geometries, we now do the snapping inside the layout engine. This allows us to do more intelligent distribution of items, and spacings should always be respected. There are some cases where items with fractional size hints might overlap with less than a pixel. This was also the case before this patch. Those cases are impossible to fix properly, since fractional size hints conflicts with the snapping in some cases. (Fractional size hints is normal for Text items.) Task-number: QTBUG-41216 Change-Id: I01a8bc3529f0b8b028d6eb0a530c751b67ac6f4e Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Remove unnecessary math.h and limits.h includesAllan Sandfeld Jensen2015-02-041-2/+0
| | | | | Change-Id: I28c898f869ed3f03b08ff55f2972a38667c755ad Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Fixed a bug where spans did not always work in layouts.Jan Arve Saether2014-12-091-1/+1
| | | | | | | | | | | | | | | | The problem was that the span we stored in the multiCellMap was the "effective" span (i.e. the given span subtracted with the number of ignored rows it would span). Later we used that span to distribute its size across all its cells. However, since the span now could be smaller that the given span, we could sometimes fail to distribute to the last span(s). [ChangeLog][QtWidgets][layouts] Fixed a bug where spans sometimes didn't distribute themselves to the last cells they covered. Change-Id: I31db3d850484dc8b70d62c5f02f680740578c661 Task-number: QTBUG-43099 Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
* Don't rely on hasChanged() in ensureGeometriesJan Arve Saether2014-12-011-1/+1
| | | | | | | | | | | | It can be removed now because we now have a better caching mechanism than before. It should therefore not be needed anymore. Since nothing else calls hasChanged, we can finally get rid of it. This simplifies the code and enables us to further improvements to the code. Change-Id: I51afe5a97311e3e361ae8b491ecbcd21bbedacd1 Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
* Adjust the layout if a QGraphicsWidget is explicitly hiddenJan Arve Saether2014-10-231-1/+1
| | | | | | | | | Since layout items can now be hidden, this also makes sure we respect the QSizePolicy::retainSizeWhenHidden Task-number: QTBUG-20132 Change-Id: Iab59fc9b61d4ca1bb2208c479a027da6eb0283a9 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Also cache totalBoxes if we have HFW/WFHJan Arve Saether2014-03-021-11/+15
| | | | | Change-Id: Iea71c11b88df84b9c0949b1020a6bcc5395d62de Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Don't ignore horizontal alignment for items with baseline alignmentsJan Arve Saether2014-02-141-43/+43
| | | | | | | | | Horizontal alignment were ignored when an item had baseline alignment specified. Change-Id: I2df526dc830952cdc26e1973d4787e9457c94edd Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* Support negative layout spacings (do not assert)Jan Arve Saether2014-01-221-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | This tests * default spacing * explicit positive spacing * negative spacings Negative spacings that causes the layout to shrink down to 0 or a negative spacing are not supported. (But make sure they don't crash the whole engine) This is a partial cherry picked from qtquickcontrols.git/bc973dcf2163b25f2db74d974b252384bbee8d80) Only the Q_ASSERT had to be cherry-picked. This is because of that the qgridlayoutengine* is moved to qtbase. Therefore, any changes to qgridlayoutengine* won't be merged properly to dev (they will be lost). Task-number: QTBUG-35741 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> Change-Id: I834f1efc11aca59a93c8d870f1a776f2f8810485 Reviewed-by: Caroline Chao <caroline.chao@digia.com>
* Improve caching in ensureColumnAndRowData()Jan Arve Saether2014-01-181-1/+13
| | | | | Change-Id: I02d9f818f8e1d6fcb8c25d1b73c08171cfc1f74d Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Improve code in sizeHint()Jan Arve Saether2014-01-171-30/+9
| | | | | | | | The plan is to do better caching in ensureColumnAndRowData(), and this patch will benefit for any such changes later Change-Id: Id1662e3fe7f70079e29ddb6e3d64e6e580ad9e0f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* constify some functions to improve readabilityJan Arve Saether2014-01-151-2/+2
| | | | | Change-Id: I4a5e68367f281f743a631272f57a848dc2833d12 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Add baseline support to QGridLayoutEngineJan Arve Saether2013-12-201-6/+10
| | | | | | | (Picked from QGridLayoutEngine in qtquickcontrols) Change-Id: Ifc912c3c90127edfeae2f874e0a061227371d01f Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Move QGridLayoutEngine to QtGui moduleJan Arve Saether2013-12-091-0/+1641
For MacOS 10.6 the exported symbols must be the same regardless of debug/release configuration, because for debug builds it will by default link to a release library. We therefore cannot let some exported symbols depend on if QT_DEBUG is defined or not. We therefore introduce QGRIDLAYOUTENGINE_DEBUG, which is independent of debug/release configuration. The whole dump() function concept should probably be revisited, but I don't want to clutter this commit too much with such unrelated things. Change-Id: I7086f31e2c36fe22ce9c9a3eda37ea25302459a9 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>