6#include <QtWidgets/qwidget.h>
7#include <QtWidgets/qapplication.h>
8#include <QtCore/qstack.h>
11#include <QtCore/qfile.h>
40 data->graphicsAnchor =
nullptr;
57 qWarning(
"QGraphicsAnchor::setSpacing: The anchor does not exist.");
74 qWarning(
"QGraphicsAnchor::setSpacing: The anchor does not exist.");
87 qWarning(
"QGraphicsAnchor::setSpacing: The anchor does not exist.");
114 *minSize = minSizeHint;
116 *minSize = prefSizeHint;
119 *maxSize = maxSizeHint;
121 *maxSize = prefSizeHint;
125 *prefSize = *minSize;
127 *prefSize = prefSizeHint;
194 }
else if (styleInfo) {
338 const qreal lowerBoundary =
340 const qreal upperBoundary =
342 const qreal prefMean =
345 if (lowerBoundary < upperBoundary) {
389 if (
value < minPref) {
393 }
else if (
value < pref) {
397 }
else if (
value < maxPref) {
408 if (upper == lower) {
411 progress = (
value - lower) / (upper - lower);
423 switch (factor.first) {
442 return lower + factor.second * (upper - lower);
465 const bool edgeIsForward = (
e->from == prev);
467 e->sizeAtMinimum =
interpolate(minFactor,
e->minSize,
e->minPrefSize,
468 e->prefSize,
e->maxPrefSize,
e->maxSize);
469 e->sizeAtPreferred =
interpolate(prefFactor,
e->minSize,
e->minPrefSize,
470 e->prefSize,
e->maxPrefSize,
e->maxSize);
471 e->sizeAtMaximum =
interpolate(maxFactor,
e->minSize,
e->minPrefSize,
472 e->prefSize,
e->maxPrefSize,
e->maxSize);
476 e->sizeAtMinimum =
interpolate(minFactor,
e->maxSize,
e->maxPrefSize,
477 e->prefSize,
e->minPrefSize,
e->minSize);
478 e->sizeAtPreferred =
interpolate(prefFactor,
e->maxSize,
e->maxPrefSize,
479 e->prefSize,
e->minPrefSize,
e->minSize);
480 e->sizeAtMaximum =
interpolate(maxFactor,
e->maxSize,
e->maxPrefSize,
481 e->prefSize,
e->minPrefSize,
e->minSize);
485 e->updateChildrenSizes();
502 const bool edgeIsForward = (edge->
from == prev);
528void AnchorData::dump(
int indent) {
530 qDebug(
"%*s type: parallel:", indent,
"");
533 p->secondEdge->dump(indent+2);
537 qDebug(
"%*s type: sequential(%d):", indent,
"", kids);
538 for (
int i = 0;
i < kids; ++
i) {
539 s->m_edges.at(
i)->dump(indent+2);
542 qDebug(
"%*s type: Normal:", indent,
"");
558 intersection = cPositives & cNegatives;
560 cPositives -= intersection;
561 cNegatives -= intersection;
566 for (
i = cPositives.
begin();
i != cPositives.
end(); ++
i)
567 c->variables.insert(*
i, 1.0);
569 for (
i = cNegatives.
begin();
i != cNegatives.
end(); ++
i)
570 c->variables.insert(*
i, -1.0);
576QString GraphPath::toString()
const
579 string +=
"Path: "_L1;
592 : calculateGraphCacheDirty(true), styleInfoDirty(true)
649 AnchorData *children[2] = { oldAnchor, newAnchor };
653 for (
int i = 0;
i < 2; ++
i) {
664 if (!
child->isCenterAnchor)
671 if (
c->variables.contains(
child)) {
676 c->variables.insert(parallel,
v);
684 newAnchor = parallel;
687 g.createEdge(newAnchor->
from, newAnchor->
to, newAnchor);
704#if defined(QT_DEBUG) && 0
706 for (
int i = 0;
i < vertices.
count(); ++
i) {
717 const int numVertices = vertices.
size();
718 edges.
reserve(numVertices + 1);
720 for (
int i = 0;
i < numVertices; ++
i) {
735 sequence->
from = before;
736 sequence->
to = after;
785#if defined(QT_DEBUG) && 0
786 qDebug(
"Simplifying Graph for %s",
787 orientation ==
Horizontal ?
"Horizontal" :
"Vertical");
789 static int count = 0;
804 bool feasible =
true;
807 }
while (dirty && feasible);
816#if defined(QT_DEBUG) && 0
827 if (
data->from == oldV) {
841 bool feasible =
true;
843 for (
int i = 0;
i < edges.
size(); ++
i) {
853 feasible &= newFeasible;
855 if (newAnchor != ad) {
862 g.takeEdge(oldV, otherV);
896 const bool bothLayoutVertices =
v->m_item ==
q &&
next->m_item ==
q;
897 const bool zeroSized = !
data->minSize && !
data->maxSize;
899 if (!bothLayoutVertices && zeroSized) {
911 for (
int i = 0;
i < vAdjacents.
size(); ++
i) {
913 if (adjacent !=
next) {
919 for (
int i = 0;
i < nextAdjacents.
size(); ++
i) {
928 adjacents.
append(adjacent);
941 else if (
next->m_item ==
q)
1013 const bool isLayoutVertex =
v->m_item ==
q;
1015 bool endOfSequence =
false;
1022 endOfSequence = isLayoutVertex || adjacents.
size() != 2;
1024 if (!endOfSequence) {
1036 after = (beforeSequence == adjacents.
last() ? adjacents.
first() : adjacents.
last());
1046 const bool cycleFound = visited.
contains(after);
1049 endOfSequence = cycleFound ||
data->isCenterAnchor;
1051 if (!endOfSequence) {
1055 }
else if (cycleFound && (beforeSequence != after)) {
1056 afterSequence = after;
1064 for (
int i = 0;
i < adjacents.
size(); ++
i) {
1081 if (!endOfSequence || candidates.
isEmpty())
1129 if (newAnchor != sequence)
1144 static const char *anchortypes[] = {
"Normal",
1147 qDebug(
"Restoring %s edge.", anchortypes[
int(edge->
type)]);
1153 g.createEdge(edge->
from, edge->
to, edge);
1196 c->variables.
remove(parallel);
1209 c->variables.
remove(parallel);
1217 qDebug(
"Restoring Simplified Graph for %s",
1218 orientation ==
Horizontal ?
"Horizontal" :
"Vertical");
1224 for (
int i = 0;
i < connections.
size(); ++
i) {
1260 for (
int i = parallelAnchors.
size() - 1;
i >= 0; --
i) {
1267 for (
int i = toRestore.
size() - 1;
i >= 0; --
i) {
1283 g.createEdge(ad->
from, ad->
to, ad);
1292 g.createEdge(ad->
from, ad->
to, ad);
1295 for (
int j = 0;
j < adjacents.
size(); ++
j) {
1296 g.takeEdge(pair, adjacents.
at(
j));
1310 parallelAnchors.
clear();
1378 data->refreshSizeHints();
1382 data->refreshSizeHints();
1402 switch (centerEdge) {
1438 c->variables.insert(
data, 1.0);
1440 data->isCenterAnchor =
true;
1442 data->refreshSizeHints();
1445 c->variables.insert(
data, -1.0);
1447 data->isCenterAnchor =
true;
1449 data->refreshSizeHints();
1468 switch (centerEdge) {
1516 data->refreshSizeHints();
1526 for (
int i = 0;
i < adjacents.
size(); ++
i) {
1528 if (
v->m_item !=
item) {
1594 if ((firstItem ==
nullptr) || (secondItem ==
nullptr)) {
1595 qWarning(
"QGraphicsAnchorLayout::addAnchor(): "
1596 "Cannot anchor NULL items");
1600 if (firstItem == secondItem) {
1601 qWarning(
"QGraphicsAnchorLayout::addAnchor(): "
1602 "Cannot anchor the item to itself");
1607 qWarning(
"QGraphicsAnchorLayout::addAnchor(): "
1608 "Cannot anchor edges of different orientations");
1613 if (firstItem == parentWidget || secondItem == parentWidget) {
1614 qWarning(
"QGraphicsAnchorLayout::addAnchor(): "
1615 "You cannot add the parent of the layout to the layout.");
1669 return graphicsAnchor;
1696 if (
graph[orientation].edgeData(
v1,
v2)) {
1701 if (firstItem == secondItem)
1702 data->item = firstItem;
1716 data->isLayoutAnchor = (
data->item ==
q);
1727 if (firstItem == secondItem)
1745 graphicsAnchor =
data->graphicsAnchor;
1747 return graphicsAnchor;
1769 firstVertex = secondVertex =
nullptr;
1772 bool keepFirstItem =
false;
1773 bool keepSecondItem =
false;
1778 if (firstItem !=
q) {
1787 if (
v.second > refcount) {
1788 keepFirstItem =
true;
1794 keepFirstItem =
true;
1796 if (secondItem !=
q) {
1805 if (
v.second > refcount) {
1806 keepSecondItem =
true;
1812 keepSecondItem =
true;
1817 if (!keepSecondItem)
1871 qWarning(
"This item with this edge is not in the graph");
1876 if (
v.second == 0) {
1884 if ((
v.second == 2) &&
1896 const auto allVertices =
g.adjacentVertices(
v);
1897 for (
auto *
v2 : allVertices) {
1898 g.removeEdge(
v,
v2);
1948 if ((firstItem !=
q) && (secondItem !=
q)) {
1951 if (firstEdge < secondEdge) {
1952 qSwap(firstItem, secondItem);
1953 qSwap(firstEdge, secondEdge);
1955 }
else if (firstItem ==
q) {
1959 qSwap(firstItem, secondItem);
1960 qSwap(firstEdge, secondEdge);
1965 qSwap(firstItem, secondItem);
1966 qSwap(firstEdge, secondEdge);
2019 for (
int i = 0;
i < constraints.
size(); ++
i) {
2024 return variableSet.
values();
2052#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL)
2053 lastCalculationUsedSimplex[orientation] =
false;
2063 qWarning(
"QGraphicsAnchorLayout: anchor setup is not feasible.");
2097 bool feasible =
calculateTrunk(orientation, trunkPath, parts.trunkConstraints, trunkVariables);
2103 if (feasible && !parts.nonTrunkConstraints.isEmpty()) {
2121 if (simplificationEnabled)
2134 for (
int i = 0;
i < constraints.
size(); ++
i) {
2136 const qreal multiplier = std::accumulate(
c->variables.cbegin(),
c->variables.cend(),
qreal(0));
2137 c->constant += multiplier * amount;
2151 bool feasible =
true;
2155 qDebug(
"Simplex %s for trunk of %s", needsSimplex ?
"used" :
"NOT used",
2177 pref += ad->sizeAtPreferred;
2179 pref -= ad->sizeAtPreferred;
2205#if defined(QT_DEBUG) || defined(QT_BUILD_INTERNAL)
2206 lastCalculationUsedSimplex[orientation] = needsSimplex;
2224 for (
int j = 0;
j < variables.
size(); ++
j) {
2248 for (
int i = 0;
i < vertices.
size(); ++
i) {
2274 const auto adjacentVertices =
graph[orientation].adjacentVertices(root);
2278 while(!
queue.isEmpty()) {
2280 AnchorData *edge =
graph[orientation].edgeData(pair.first, pair.second);
2288 if (edge->
from == pair.first)
2293 graphPaths[orientation].insert(pair.second, current);
2295 const auto adjacentVertices =
graph[orientation].adjacentVertices(pair.second);
2318 const auto vertices =
graphPaths[orientation].uniqueKeys();
2320 int valueCount =
graphPaths[orientation].count(vertex);
2321 if (valueCount == 1)
2325 for (
int i = 1;
i < valueCount; ++
i) {
2327 pathsToVertex[0].constraint(pathsToVertex.
at(
i));
2340 for (
int i = 0;
i < vertices.
size(); ++
i) {
2375 actualMax = layoutEdge->
maxSize;
2377 actualMax = -layoutEdge->
minSize;
2379 if (actualMax != expectedMax) {
2380 layoutEdge =
nullptr;
2385 bool unboundedProblem =
true;
2401 if ((boundedMin == boundedMax) ||
qFuzzyCompare(boundedMin, boundedMax)) {
2404 c->constant = boundedMin;
2406 anchorConstraints +=
c;
2407 unboundedProblem =
false;
2411 c->constant = boundedMin;
2413 anchorConstraints +=
c;
2418 if (ad == layoutEdge)
2423 c->constant = boundedMax;
2425 anchorConstraints +=
c;
2426 unboundedProblem =
false;
2431 if (unboundedProblem) {
2437 anchorConstraints +=
c;
2440 return anchorConstraints;
2469 trunkVariables += edgeL1;
2471 trunkVariables += edgeL2;
2474 auto end =
result.nonTrunkConstraints.end();
2484 if (
c->variables.contains(ad)) {
2494 for (
auto jt =
c->variables.cbegin(),
end =
c->variables.cend(); jt !=
end; ++jt)
2495 trunkVariables.
insert(jt.key());
2509 const auto newEnd = std::remove_if(
result.nonTrunkConstraints.begin(),
end, isMatch);
2510 dirty = newEnd !=
end;
2514 result.nonTrunkConstraints.erase(
end,
result.nonTrunkConstraints.end());
2554 nonFloatingItemsIdentifiedSoFar->
insert(ad->
item);
2621 item->setGeometry(newGeom);
2643 const auto adjacentVertices =
graph[orientation].adjacentVertices(root);
2651 while (!
queue.isEmpty()) {
2653 AnchorData *edge =
graph[orientation].edgeData(pair.first, pair.second);
2658 visited.
insert(pair.second);
2662 for (
int i = 0;
i < adjacents.
size(); ++
i) {
2682 current = (orientation ==
Qt::Horizontal) ?
q->contentsRect().width() :
q->contentsRect().height();
2750 *min = simplex.
solveMin() - objectiveOffset;
2754 for (
int i = 0;
i < variables.
size(); ++
i) {
2760 *max = simplex.
solveMax() - objectiveOffset;
2763 for (
int i = 0;
i < variables.
size(); ++
i) {
2781 limit->constant = interval;
2811 for (
int i = 0;
i < variables.
size(); ++
i) {
2821 preferredConstraints += sizeConstraint;
2828 if (softShrinkInterval) {
2830 preferredVariables += slack.
first;
2831 preferredConstraints += slack.second;
2839 if (softGrowInterval) {
2841 preferredVariables += slack.
first;
2842 preferredConstraints += slack.second;
2850 if (hardShrinkInterval) {
2852 preferredVariables += slack.
first;
2853 preferredConstraints += slack.second;
2861 if (hardGrowInterval) {
2863 preferredVariables += slack.
first;
2864 preferredConstraints += slack.second;
2880 for (
int i = 0;
i < variables.
size(); ++
i) {
2915void QGraphicsAnchorLayoutPrivate::dumpGraph(
const QString &
name)
EdgeData * takeEdge(Vertex *first, Vertex *second)
static QStyle * style()
Returns the application's style object.
void close() override
Calls QFileDevice::flush() and closes the file.
bool open(OpenMode flags) override
Opens the file using OpenMode mode, returning true if successful; otherwise false.
QString fileName() const override
Returns the name set by setFileName() or to the QFile constructors.
bool solvePreferred(const QList< QSimplexConstraint * > &constraints, const QList< AnchorData * > &variables)
QHVContainer< AnchorVertex * > layoutLastVertex
void removeAnchor_helper(AnchorVertex *v1, AnchorVertex *v2)
QList< QSimplexConstraint * > constraintsFromSizeHints(const QList< AnchorData * > &anchors)
bool hasConflicts() const
uint calculateGraphCacheDirty
QHVContainer< Interval > interpolationInterval
QGraphicsAnchor * addAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, qreal *spacing=nullptr)
QHVContainer< Graph< AnchorVertex, AnchorData > > graph
QGraphicsAnchorLayoutPrivate()
QHVContainer< QList< QSimplexConstraint * > > constraints
void setupEdgesInterpolation(Qt::Orientation orientation)
QHVContainer< AnchorVertex * > layoutFirstVertex
QHash< QPair< QGraphicsLayoutItem *, Qt::AnchorPoint >, QPair< AnchorVertex *, int > > m_vertexList
bool replaceVertex(Qt::Orientation orientation, AnchorVertex *oldV, AnchorVertex *newV, const QList< AnchorData * > &edges)
void updateAnchorSizes(Qt::Orientation orientation)
bool calculateNonTrunk(const QList< QSimplexConstraint * > &constraints, const QList< AnchorData * > &variables)
static Qt::AnchorPoint oppositeEdge(Qt::AnchorPoint edge)
bool calculateTrunk(Qt::Orientation orientation, const GraphPath &trunkPath, const QList< QSimplexConstraint * > &constraints, const QList< AnchorData * > &variables)
QHVContainer< QList< AnchorData * > > anchorsFromSimplifiedVertices
bool solveMinMax(const QList< QSimplexConstraint * > &constraints, const GraphPath &path, qreal *min, qreal *max)
QHVContainer< QList< AnchorVertexPair * > > simplifiedVertices
AnchorData * addAnchorMaybeParallel(AnchorData *newAnchor, bool *feasible)
void removeCenterConstraints(QGraphicsLayoutItem *item, Qt::Orientation orientation)
static Qt::AnchorPoint pickEdge(Qt::AnchorPoint edge, Qt::Orientation orientation)
QHVContainer< qreal > spacings
void removeInternalVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
bool simplifyGraph(Qt::Orientation orientation)
void refreshAllSizeHints(Qt::Orientation orientation)
QHVContainer< QMultiHash< AnchorVertex *, GraphPath > > graphPaths
QHVContainer< bool > graphHasConflicts
static Qt::Orientation edgeOrientation(Qt::AnchorPoint edge) noexcept
void findPaths(Qt::Orientation orientation)
AnchorVertex * addInternalVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
void createCenterAnchors(QGraphicsLayoutItem *item, Qt::AnchorPoint centerEdge)
QGraphicsAnchor * acquireGraphicsAnchor(AnchorData *data)
QHVContainer< qreal > interpolationProgress
void restoreSimplifiedGraph(Qt::Orientation orientation)
bool simplifyGraphIteration(Qt::Orientation orientation, bool *feasible)
void restoreSimplifiedConstraints(ParallelAnchorData *parallel)
void removeCenterAnchors(QGraphicsLayoutItem *item, Qt::AnchorPoint centerEdge, bool substitute=true)
void calculateVertexPositions(Qt::Orientation orientation)
void changeLayoutVertex(Qt::Orientation orientation, AnchorVertex *oldV, AnchorVertex *newV)
QLayoutStyleInfo cachedStyleInfo
void removeAnchors(QGraphicsLayoutItem *item)
QHVContainer< QList< QSimplexConstraint * > > itemCenterConstraints
static constexpr Qt::Orientation Horizontal
void setItemsGeometries(const QRectF &geom)
@ PreferredToMaxPreferred
@ MinPreferredToPreferred
QHVContainer< QSet< QGraphicsLayoutItem * > > m_floatItems
void removeAnchor(AnchorVertex *firstVertex, AnchorVertex *secondVertex)
QHVContainer< AnchorVertex * > layoutCentralVertex
void restoreVertices(Qt::Orientation orientation)
GraphParts getGraphParts(Qt::Orientation orientation)
QList< QGraphicsLayoutItem * > items
void interpolateEdge(AnchorVertex *base, AnchorData *edge)
void identifyNonFloatItems_helper(const AnchorData *ad, QSet< QGraphicsLayoutItem * > *nonFloatingItemsIdentifiedSoFar)
QGraphicsAnchor * getAnchor(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge)
bool simplifyVertices(Qt::Orientation orientation)
void restoreSimplifiedAnchor(AnchorData *edge)
void identifyFloatItems(const QSet< AnchorData * > &visited, Qt::Orientation orientation)
AnchorVertex * internalVertex(const QPair< QGraphicsLayoutItem *, Qt::AnchorPoint > &itemEdge) const
void constraintsFromPaths(Qt::Orientation orientation)
QHVContainer< std::array< qreal, 3 > > sizeHints
void correctEdgeDirection(QGraphicsLayoutItem *&firstItem, Qt::AnchorPoint &firstEdge, QGraphicsLayoutItem *&secondItem, Qt::AnchorPoint &secondEdge)
void addAnchor_helper(QGraphicsLayoutItem *firstItem, Qt::AnchorPoint firstEdge, QGraphicsLayoutItem *secondItem, Qt::AnchorPoint secondEdge, AnchorData *data)
QLayoutStyleInfo & styleInfo() const
void removeVertex(QGraphicsLayoutItem *item, Qt::AnchorPoint edge)
void createItemEdges(QGraphicsLayoutItem *item)
The QGraphicsAnchorLayout class provides a layout where one can anchor widgets together in Graphics V...
void setSizePolicy(QSizePolicy::Policy policy)
~QGraphicsAnchorPrivate()
QSizePolicy::Policy sizePolicy
QGraphicsAnchorPrivate(int version=QObjectPrivateVersion)
static QGraphicsAnchorPrivate * get(QGraphicsAnchor *q)
QGraphicsAnchorLayoutPrivate * layoutPrivate
void setSpacing(qreal value)
The QGraphicsAnchor class represents an anchor between two items in a QGraphicsAnchorLayout.
void setSpacing(qreal spacing)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
QGraphicsLayoutItem * parent
QGraphicsItem * parentItem() const
The QGraphicsLayoutItem class can be inherited to allow your custom items to be managed by layouts.
QGraphicsItem * graphicsItem() const
Returns the QGraphicsItem that this layout item represents.
QSizeF effectiveSizeHint(Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const
Returns the effective size hint for this QGraphicsLayoutItem.
bool isLayout() const
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges o...
QGraphicsLayoutItem * parentLayoutItem() const
Returns the parent of this QGraphicsLayoutItem, or \nullptr if there is no parent,...
QSizePolicy sizePolicy() const
Returns the current size policy.
void addChildLayoutItem(QGraphicsLayoutItem *item)
Qt::LayoutDirection visualDirection() const
bool remove(const Key &key)
Removes the item that has the key from the hash.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
void setDefaultSpacing(Qt::Orientation o, qreal spacing)
qreal perItemSpacing(QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation) const
qreal defaultSpacing(Qt::Orientation o) const
qsizetype size() const noexcept
bool isEmpty() const noexcept
const T & constLast() const noexcept
const_reference at(qsizetype i) const noexcept
void remove(qsizetype i, qsizetype n=1)
qsizetype count() const noexcept
const T & constFirst() const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
\inmodule QtCore\reentrant
constexpr void setBottom(qreal pos) noexcept
Sets the bottom edge of the rectangle to the given finite y coordinate.
constexpr void setRight(qreal pos) noexcept
Sets the right edge of the rectangle to the given finite x coordinate.
constexpr void setLeft(qreal pos) noexcept
Sets the left edge of the rectangle to the given finite x coordinate.
constexpr void setTop(qreal pos) noexcept
Sets the top edge of the rectangle to the given finite y coordinate.
constexpr qreal left() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr qreal top() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal right() const noexcept
Returns the x-coordinate of the rectangle's right edge.
QList< T > values() const
bool contains(const T &value) const
const_iterator cbegin() const noexcept
iterator insert(const T &value)
bool setConstraints(const QList< QSimplexConstraint * > &constraints)
void setObjective(QSimplexConstraint *objective)
constexpr qreal width() const noexcept
Returns the width.
constexpr qreal height() const noexcept
Returns the height.
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
constexpr Policy verticalPolicy() const noexcept
Returns the vertical component of the size policy.
ControlType controlType() const noexcept
constexpr Policy horizontalPolicy() const noexcept
Returns the horizontal component of the size policy.
Policy
This enum describes the various per-dimension sizing types used when constructing a QSizePolicy.
T pop()
Removes the top item from the stack and returns it.
void push(const T &t)
Adds element t to the top of the stack.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
QByteArray toLocal8Bit() const &
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.
QSet< AnchorData * > negatives
QSet< AnchorData * > positives
QSimplexConstraint * constraint(const GraphPath &path) const
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
std::pair< T1, T2 > QPair
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
static QPair< QGraphicsAnchorLayoutPrivate::Interval, qreal > getFactor(qreal value, qreal min, qreal minPref, qreal pref, qreal maxPref, qreal max)
static QPair< QSimplexVariable *, QSimplexConstraint * > createSlack(QSimplexConstraint *sizeConstraint, qreal interval, slackType type)
static AnchorData * createSequence(Graph< AnchorVertex, AnchorData > *graph, AnchorVertex *before, const QList< AnchorVertex * > &vertices, AnchorVertex *after)
static qreal interpolate(const QPair< QGraphicsAnchorLayoutPrivate::Interval, qreal > &factor, qreal min, qreal minPref, qreal pref, qreal maxPref, qreal max)
static void applySizePolicy(QSizePolicy::Policy policy, qreal minSizeHint, qreal prefSizeHint, qreal maxSizeHint, qreal *minSize, qreal *prefSize, qreal *maxSize)
static AnchorVertex * replaceVertex_helper(AnchorData *data, AnchorVertex *oldV, AnchorVertex *newV)
static void shiftConstraints(const QList< QSimplexConstraint * > &constraints, qreal amount)
QList< AnchorData * > getVariables(const QList< QSimplexConstraint * > &constraints)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
static bool contains(const QJsonArray &haystack, unsigned needle)
GLint GLfloat GLfloat GLfloat v2
GLsizei const GLfloat * v
[13]
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
GLsizei const GLchar *const * string
[0]
constexpr decltype(auto) qMakePair(T1 &&value1, T2 &&value2) noexcept(noexcept(std::make_pair(std::forward< T1 >(value1), std::forward< T2 >(value2))))
QQuickAnchors * anchors(QQuickItem *item)
#define qPrintable(string)
#define qUtf16Printable(string)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen)
char * toString(const MyType &t)
[31]
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept
bool contains(const AT &t) const noexcept
QHash< QSimplexVariable *, qreal > variables
virtual void updateChildrenSizes()
void refreshSizeHints(const QLayoutStyleInfo *styleInfo=nullptr)
QGraphicsLayoutItem * item
QGraphicsAnchor * graphicsAnchor
AnchorData * m_removedAnchor
QList< AnchorData * > m_secondAnchors
QList< AnchorData * > m_firstAnchors
QGraphicsLayoutItem * m_item
virtual void updateChildrenSizes() override
QList< QSimplexConstraint * > m_secondConstraints
bool calculateSizeHints()
QList< QSimplexConstraint * > m_firstConstraints
bool secondForward() const
QList< AnchorData * > m_edges
virtual void updateChildrenSizes() override
void calculateSizeHints()