Properly calculate a lot of things related to these layouts. (#5817)

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2025-04-09 18:09:04 +02:00 committed by GitHub
parent 6661a5d946
commit 80b6d6a31f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 118 additions and 99 deletions

View file

@ -3,8 +3,11 @@
#include <QLayout>
#include <QList>
#include <QLoggingCategory>
#include <QWidget>
inline Q_LOGGING_CATEGORY(OverlapLayoutLog, "overlap_layout");
class OverlapLayout : public QLayout
{
public:
@ -12,7 +15,8 @@ public:
int overlapPercentage = 10,
int maxColumns = 2,
int maxRows = 2,
Qt::Orientation direction = Qt::Horizontal);
Qt::Orientation overlapDirection = Qt::Vertical,
Qt::Orientation flowDirection = Qt::Horizontal);
~OverlapLayout();
void addItem(QLayoutItem *item) override;
@ -35,7 +39,8 @@ private:
int overlapPercentage;
int maxColumns;
int maxRows;
Qt::Orientation direction;
Qt::Orientation overlapDirection;
Qt::Orientation flowDirection;
// Calculate the preferred size of the layout
QSize calculatePreferredSize() const;