summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qgridlayoutengine_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Use QList instead of QVector in guiJarek Kobus2020-06-291-19/+20
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-2/+2
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QGridLayoutEngine: remove now-unused enumMarc Mutz2020-05-061-7/+0
| | | | | | | This enum has since been replaced by Qt::Orientation by way of QHVContainer. Change-Id: I177409652c5de0c5f7b6117f94e26a05c3d609d4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QGridLayoutEngine: port to QHVContainerMarc Mutz2020-05-051-8/+15
| | | | | | Change-Id: Iadb069ecdf67d72fa1b3be9198e90eeda8e98d54 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Long live QHVContainer!Marc Mutz2020-05-051-7/+38
| | | | | | | | | | | | | | | | | | Various places in Qt use arrays indexed by some function of Qt::Orientation input. None document their dependence on the numerical values of the Qt::Orientation enum, some waste space, none is type-safe. QHVContainer is a private container of two values, one for Qt::Horizontal and one for Qt::Vertical. Its salient API is the indexing operator, taking Qt::Orientation, thus making the class type-safe. Use it to port QGridLayoutItem and QAbstractScrollAreaPrivate. Change-Id: I0d9f17431a5eb141bfb0763c83155710bb82a537 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Introduce QGraphicsLayoutItem::isEmpty()Jan Arve Sæther2020-02-251-1/+1
| | | | | | | | | | | | | This change does basically two things: * Renames QGraphicsGridLayoutEngineItem::isIgnored() to QGraphicsGridLayoutEngineItem::isEmpty() to be consistent with QLayoutItem::isEmpty() * Creates a new public API function QGraphicsLayoutItem::isEmpty() so that there is a public method of overriding the behavior. Change-Id: I771a8fb429f9764a75e220f0ff9d07f578f981d3 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Deprecate constructing QFlags from a pointerAllan Sandfeld Jensen2019-11-201-2/+2
| | | | | | | | | This was used to support QFlags f = 0 initialization, but with 0 used as a pointer literal now considered bad form, it had been changed many places to QFlags f = nullptr, which is meaningless and confusing. Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* More nullptr usage in headersKevin Funk2019-03-141-4/+4
| | | | | | | | | | | Diff generated by running clang-tidy's modernize-use-nullptr checker on the CMake-based Qt version. Skipping src/3rdparty, examples/, tests/ Change-Id: Ib182074e2e2fd52f63093f73b3e2e4c0cb7af188 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add qtguiglobal.h and qtguiglobal_p.hLars Knoll2016-07-031-0/+1
| | | | | | | | | | | | | | | | | | | | The new modular configuration system requires one global header per module, that is included by all other files in this module. A similar scheme and naming convention is already being used for many other modules (e.g. printsupport, qml, quick). That header will later on #include the configuration file for Qt Gui. For now it defines the Q_GUI_EXPORT macro for this library. In addition, add a private global header, qtguiglobal_p.h, that can later on include the private config header for Qt Gui for things we don't want to export to the world. Change-Id: Id9ce2a4f3d2962c3592c35e3d080574789195f24 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QtGui: mark more types as primitive/movableMarc Mutz2016-04-251-0/+1
| | | | | | | | | | | | These types are held in QVarLengthArrays, so benefit from being trivially relocatable. They are also part of the private API, so there's no BC issues with potential uses of these types in QList, except for QPainter::PixmapFragment, which consequently has been marked as relocatable only. Change-Id: I90fb9a19231c6f5c71c593602fc997ffafe8f047 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Adjust sizes when snapping layout items to pixel gridJan Arve Sæther2016-03-021-2/+2
| | | | | | | | | 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>
* 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-3/+6
| | | | | | | | | | | | | | | | | | | | | 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>
* Adjust the layout if a QGraphicsWidget is explicitly hiddenJan Arve Saether2014-10-231-0/+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-3/+9
| | | | | Change-Id: Iea71c11b88df84b9c0949b1020a6bcc5395d62de Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Improve caching in ensureColumnAndRowData()Jan Arve Saether2014-01-181-0/+1
| | | | | Change-Id: I02d9f818f8e1d6fcb8c25d1b73c08171cfc1f74d 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 deleteItems(), needed by QtQuick.LayoutsJan Arve Saether2013-12-211-0/+12
| | | | | | | (Picked from QGridLayoutEngine in qtquickcontrols) Change-Id: Ieb00f7fb0166669e6831f3d3dbe3a9ef78b57453 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Move QGridLayoutEngine to QtGui moduleJan Arve Saether2013-12-091-0/+460
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>