8#include <QtCore/qdebug.h>
9#include <QtCore/qloggingcategory.h>
10#include <QtCore/qcborarray.h>
11#include <QtCore/qcbormap.h>
12#include <QtCore/qcborvalue.h>
13#include <QtQml/QQmlInfo>
233 const int count = contentModel->count();
234 const bool horizontal = isHorizontal();
236 qCDebug(qlcQQuickSplitView) <<
"looking for fillWidth/Height item amongst" <<
count <<
"items";
239 int lastVisibleIndex = -1;
245 lastVisibleIndex =
i;
248 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
254 qCDebug(qlcQQuickSplitView) <<
"found fillWidth/Height item at index" << fillIndex;
259 if (fillIndex == -1) {
263 fillIndex = lastVisibleIndex != -1 ? lastVisibleIndex :
count - 1;
264 qCDebug(qlcQQuickSplitView) <<
"found no fillWidth/Height item; using last item at index" << fillIndex;
267 m_fillIndex = fillIndex;
286 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": split item " <<
item
287 <<
" at index " <<
index <<
" is not visible; skipping it and its handles (if any)";
293 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
302 if (isBeingResized) {
303 indexBeingResizedDueToDrag =
index;
304 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": dragging handle for item";
308 qreal requestedSize = 0;
309 if (isBeingResized) {
311 const qreal clampedMousePos = horizontal
321 const qreal mousePosRelativeToLeftHandleEdge = horizontal
326 const qreal pressedHandleSize = horizontal ? pressedHandleItem->
width() : pressedHandleItem->height();
328 if (resizeLeftItem) {
334 if (nextHandleToTheLeft->isVisible()) {
335 leftEdge = horizontal
336 ? nextHandleToTheLeft->
x() + nextHandleToTheLeft->width()
337 : nextHandleToTheLeft->y() + nextHandleToTheLeft->height();
344 const qreal pressedHandlePos = clampedMousePos - mousePosRelativeToLeftHandleEdge;
346 const qreal rightStop =
size - accumulated - pressedHandleSize;
347 qreal leftStop =
qMax(leftEdge, pressedHandlePos);
349 if (leftStop > rightStop)
350 leftStop = rightStop;
351 const qreal newHandlePos =
qBound(leftStop, pressedHandlePos, rightStop);
352 const qreal newItemSize = newHandlePos - leftEdge;
357 requestedSize = newItemSize;
359 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": resized (dragged) " <<
item
360 <<
" (clampedMousePos=" << clampedMousePos
361 <<
" pressedHandlePos=" << pressedHandlePos
362 <<
" accumulated=" << accumulated
363 <<
" leftEdge=" << leftEdge
364 <<
" leftStop=" << leftStop
365 <<
" rightStop=" << rightStop
366 <<
" newHandlePos=" << newHandlePos
367 <<
" newItemSize=" << newItemSize <<
")";
374 rightEdge = horizontal ? rightHandle->
x() : rightHandle->y();
379 const qreal pressedHandlePos = clampedMousePos - mousePosRelativeToLeftHandleEdge;
381 const qreal leftStop = accumulated - pressedHandleSize;
382 qreal rightStop =
qMin(rightEdge - pressedHandleSize, pressedHandlePos);
384 if (rightStop < leftStop)
385 rightStop = leftStop;
386 const qreal newHandlePos =
qBound(leftStop, pressedHandlePos, rightStop);
387 const qreal newItemSize = rightEdge - (newHandlePos + pressedHandleSize);
392 requestedSize = newItemSize;
394 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": resized (dragged) " <<
item
395 <<
" (clampedMousePos=" << clampedMousePos
396 <<
" pressedHandlePos=" << pressedHandlePos
397 <<
" accumulated=" << accumulated
398 <<
" leftEdge=" << rightEdge
399 <<
" leftStop=" << leftStop
400 <<
" rightStop=" << rightStop
401 <<
" newHandlePos=" << newHandlePos
402 <<
" newItemSize=" << newItemSize <<
")";
407 requestedSize = horizontal
408 ? sizeData.effectivePreferredWidth : sizeData.effectivePreferredHeight;
415 sizeData.effectiveMinimumWidth,
417 sizeData.effectiveMaximumWidth);
422 sizeData.effectiveMinimumHeight,
424 sizeData.effectiveMaximumHeight);
434 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": calculated the following size data for split item " <<
item
435 <<
": eminW=" << sizeData.effectiveMinimumWidth
436 <<
", eminH=" << sizeData.effectiveMinimumHeight
437 <<
", eprfW=" << sizeData.effectivePreferredWidth
438 <<
", eprfH=" << sizeData.effectivePreferredHeight
439 <<
", emaxW=" << sizeData.effectiveMaximumWidth
440 <<
", emaxH=" << sizeData.effectiveMaximumHeight
441 <<
", w=" << layoutData.
width
442 <<
", h=" << layoutData.
height <<
"";
446 usedWidth += layoutData.
width;
448 usedHeight += layoutData.
height;
449 }
else if (indexBeingResizedDueToDrag !=
m_fillIndex) {
451 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": skipping fill item as we resize it last";
465 if (handleItem->isVisible()) {
468 <<
": handle takes up " << handleItem->width() <<
" width";
469 usedWidth += handleItem->width();
472 <<
": handle takes up " << handleItem->height() <<
" height";
473 usedHeight += handleItem->height();
476 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": handle is not visible; skipping it";
489 qreal &usedWidth,
qreal &usedHeight,
int indexBeingResizedDueToDrag)
493 if (!fillItem->isVisible() || indexBeingResizedDueToDrag ==
m_fillIndex) {
495 <<
" is not visible or was already resized due to a drag;"
496 <<
" skipping it and its handles (if any)";
502 qmlAttachedPropertiesObject<QQuickSplitView>(fillItem,
false));
508 fillSizeData.effectiveMinimumWidth,
510 fillSizeData.effectiveMaximumWidth);
512 usedWidth += layoutData.
width;
516 fillSizeData.effectiveMinimumHeight,
518 fillSizeData.effectiveMaximumHeight);
519 usedHeight += layoutData.
height;
525 <<
": resized split fill item " << fillItem <<
" (effective"
526 <<
" minW=" << fillSizeData.effectiveMinimumWidth
527 <<
", minH=" << fillSizeData.effectiveMinimumHeight
528 <<
", maxW=" << fillSizeData.effectiveMaximumWidth
529 <<
", maxH=" << fillSizeData.effectiveMaximumHeight <<
")";
541 const qreal usedSize = horizontal ? usedWidth : usedHeight;
542 if (usedSize > maxSize) {
543 qCDebug(qlcQQuickSplitView).nospace() <<
"usedSize " << usedSize <<
" is greater than maxSize "
544 << maxSize <<
"; reducing size of non-filled items from right to left / bottom to top";
549 qreal delta = usedSize - maxSize;
559 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
561 const qreal maxReduce = horizontal ?
565 const qreal reduce = std::min(maxReduce, delta);
579 qCDebug(qlcQQuickSplitView).nospace() <<
" applying new sizes to " <<
count <<
" items (excluding hidden items)";
588 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
595 attached = qobject_cast<QQuickSplitViewAttached*>(
596 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
true));
617 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
index <<
": resized item " <<
item <<
" from "
618 <<
item->width() <<
"x" <<
item->height() <<
" to "
636 qreal usedHeight = 0;
641 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
i <<
": split item " <<
item
642 <<
" is not visible; skipping it and its handles (if any)";
657 usedWidth +=
item->width();
659 usedHeight +=
item->height();
661 if (
Q_UNLIKELY(qlcQQuickSplitView().isDebugEnabled())) {
664 qmlAttachedPropertiesObject<QQuickSplitView>(fillItem,
false));
666 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
i <<
": positioned "
668 <<
" minW=" << sizeData.effectiveMinimumWidth
669 <<
", minH=" << sizeData.effectiveMinimumHeight
670 <<
", prfW=" << sizeData.effectivePreferredWidth
671 <<
", prfH=" << sizeData.effectivePreferredHeight
672 <<
", maxW=" << sizeData.effectiveMaximumWidth
673 <<
", maxH=" << sizeData.effectiveMaximumHeight <<
")";
680 handleItem->
setX(horizontal ? usedWidth : 0);
681 handleItem->setY(horizontal ? 0 : usedHeight);
684 usedWidth += handleItem->width();
686 usedHeight += handleItem->height();
688 qCDebug(qlcQQuickSplitView).nospace() <<
" - " <<
i <<
": positioned handle " << handleItem;
736 qCDebug(qlcQQuickSplitView) <<
"laying out" <<
count <<
"split items"
737 << (horizontal ?
"horizontally" :
"vertically") <<
"in SplitView" << q_func();
741 qreal usedHeight = 0;
742 int indexBeingResizedDueToDrag = -1;
745 qCDebug(qlcQQuickSplitView) <<
" resizing:";
751 qCDebug(qlcQQuickSplitView).nospace()
752 <<
" - (remaining width=" <<
width - usedWidth
753 <<
" remaining height=" <<
height - usedHeight <<
")";
762 qCDebug(qlcQQuickSplitView) <<
" positioning:";
767 qCDebug(qlcQQuickSplitView).nospace() <<
"finished layouting";
779 qCDebug(qlcQQuickSplitView) <<
"creating" <<
count <<
"handles";
791 qCDebug(qlcQQuickSplitView) <<
"- creating handle for split item at index" <<
index
792 <<
"from handle component" <<
m_handle;
803 handleItem->setParent(
q);
804 qCDebug(qlcQQuickSplitView) <<
"- successfully created handle item" << handleItem <<
"for split item at index" <<
index;
811 handleItem->setParentItem(
q);
814 handleItem->setKeepMouseGrab(
true);
816 updateCursorHandle(handleItem);
826 qCDebug(qlcQQuickSplitView) <<
"removing" << excess <<
"excess handles from the end of our list";
827 for (; excess > 0; --excess) {
837 for (
int i = firstIndex;
i <= lastIndex; ++
i) {
845 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
849 if (horizontal && attachedPrivate->m_isMinimumWidthSet)
850 size += attachedPrivate->m_minimumWidth;
851 else if (!horizontal && attachedPrivate->m_isMinimumHeightSet)
852 size += attachedPrivate->m_minimumHeight;
858 if (
i < lastIndex || lastIndex < contentModel->
count() - 1) {
860 if (handleItem->isVisible())
861 size += horizontal ? handleItem->
width() : handleItem->height();
869 return attachedPrivate && attachedPrivate->m_isMinimumWidthSet ? attachedPrivate->m_minimumWidth : 0;
874 return attachedPrivate && attachedPrivate->m_isMinimumHeightSet ? attachedPrivate->m_minimumHeight : 0;
880 return attachedPrivate && attachedPrivate->m_isPreferredWidthSet
881 ? attachedPrivate->m_preferredWidth : itemPrivate->
implicitWidth;
887 return attachedPrivate && attachedPrivate->m_isPreferredHeightSet
888 ? attachedPrivate->m_preferredHeight : itemPrivate->
implicitHeight;
893 return attachedPrivate && attachedPrivate->m_isMaximumWidthSet
894 ? attachedPrivate->m_maximumWidth : std::numeric_limits<qreal>::infinity();
899 return attachedPrivate && attachedPrivate->m_isMaximumHeightSet
900 ? attachedPrivate->m_maximumHeight : std::numeric_limits<qreal>::infinity();
939 handleItem->setWidth(horizontal ? handleItem->implicitWidth() :
width);
940 handleItem->setHeight(horizontal ?
height : handleItem->implicitHeight());
950void QQuickSplitViewPrivate::updateCursorHandle(
QQuickItem *handleItem)
969 int lastVisibleItemIndex = -1;
970 for (
int i =
count - 1;
i >= 0; --
i) {
973 lastVisibleItemIndex =
i;
978 for (
int i = 0;
i <
count - 1; ++
i) {
981 if (
i != lastVisibleItemIndex)
984 handleItem->setVisible(
false);
985 qCDebug(qlcQQuickSplitView) <<
"set visible property of handle" << handleItem <<
"at index"
986 <<
i <<
"to" << handleItem->isVisible();
992 qCDebug(qlcQQuickSplitViewPointer) <<
"updating hovered handle after" << hoveredItem <<
"was hovered";
1000 if (oldHoveredHandleIndex != -1) {
1003 qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(oldHoveredHandle,
true));
1005 qCDebug(qlcQQuickSplitViewPointer) <<
"handle item at index" << oldHoveredHandleIndex <<
"is no longer hovered";
1010 qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(hoveredItem,
true));
1014 qCDebug(qlcQQuickSplitViewPointer) <<
"either there is no hovered item or" << hoveredItem <<
"is not a handle";
1025 emit q->resizingChanged();
1049 if (pressedHandleIndex != -1) {
1060 if (nextItem->isVisible()) {
1061 rightOrBottomItem = nextItem;
1067 "Failed to find a visible item to the right/bottom of the one that was pressed at index %1; this shouldn't happen")
1078 qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(pressedItem,
true));
1083 qCDebug(qlcQQuickSplitViewPointer).nospace() <<
"handled press -"
1086 <<
" item=" << leftOrTopItem
1089 <<
" item=" << rightOrBottomItem;
1114 qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(pressedHandle,
true));
1134 qCDebug(qlcQQuickSplitView) <<
"visible property of split item"
1141 if (handleIndex != -1) {
1145 qCDebug(qlcQQuickSplitView) <<
"set visible property of handle item"
1146 << handleItem <<
"at index" << handleIndex <<
"to" <<
item->
isVisible();
1171 return splitView->d_func();
1195 for (
int i = 0;
i <
d->contentModel->count(); ++
i) {
1197 d->removeImplicitSizeListener(
item);
1215 return d->m_orientation;
1226#if QT_CONFIG(cursor)
1228 d->updateCursorHandle(handleItem);
1250 return d->m_resizing;
1301 d->destroyHandles();
1307 d->updateHandleVisibilities();
1324 return !
d->m_handleItems.contains(
item);
1341#if QT_CONFIG(cborstreamwriter)
1343 qCDebug(qlcQQuickSplitViewState) <<
"saving state for split items in" <<
this;
1347 for (
int i = 0;
i <
d->contentModel->count(); ++
i) {
1350 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
1360 if (!attachedPrivate->m_isPreferredWidthSet && !attachedPrivate->m_isPreferredHeightSet)
1365 if (attachedPrivate->m_isPreferredWidthSet) {
1366 cborMap[
QLatin1String(
"preferredWidth")] =
static_cast<double>(attachedPrivate->m_preferredWidth);
1368 qCDebug(qlcQQuickSplitViewState).nospace() <<
"- wrote preferredWidth of "
1369 << attachedPrivate->m_preferredWidth <<
" for split item " <<
item <<
" at index " <<
i;
1371 if (attachedPrivate->m_isPreferredHeightSet) {
1372 cborMap[
QLatin1String(
"preferredHeight")] =
static_cast<double>(attachedPrivate->m_preferredHeight);
1374 qCDebug(qlcQQuickSplitViewState).nospace() <<
"- wrote preferredHeight of "
1375 << attachedPrivate->m_preferredHeight <<
" for split item " <<
item <<
" at index " <<
i;
1378 cborArray.append(cborMap);
1381 const QByteArray byteArray = cborArray.toCborValue().toCbor();
1382 qCDebug(qlcQQuickSplitViewState) <<
"the resulting byte array is:" << byteArray;
1402 if (cborByteArray.isEmpty())
1406 const QCborValue cborValue(QCborValue::fromCbor(cborByteArray, &parserError));
1412 qCDebug(qlcQQuickSplitViewState) <<
"restoring state for split items of" <<
this
1413 <<
"from the following string:" <<
state;
1415 const QCborArray cborArray(cborValue.toArray());
1416 const int ourCount =
d->contentModel->count();
1418 if (cborArray.size() > ourCount) {
1419 qmlWarning(
this) <<
"Error reading SplitView state: expected "
1420 << ourCount <<
" or less split items but got " << cborArray.size();
1426 const int splitItemIndex = cborMap.value(
QLatin1String(
"index")).toInteger();
1427 const bool isPreferredWidthSet = cborMap.contains(
QLatin1String(
"preferredWidth"));
1428 const bool isPreferredHeightSet = cborMap.contains(
QLatin1String(
"preferredHeight"));
1435 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
true));
1436 if (isPreferredWidthSet) {
1437 const qreal preferredWidth = cborMap.value(
QLatin1String(
"preferredWidth")).toDouble();
1440 if (isPreferredHeightSet) {
1441 const qreal preferredHeight = cborMap.value(
QLatin1String(
"preferredHeight")).toDouble();
1446 qCDebug(qlcQQuickSplitViewState).nospace()
1447 <<
"- restored the following state for split item " <<
item <<
" at index " << splitItemIndex
1448 <<
": preferredWidthSet=" << attachedPrivate->m_isPreferredWidthSet
1449 <<
" preferredWidth=" << attachedPrivate->m_preferredWidth
1450 <<
" preferredHeightSet=" << attachedPrivate->m_isPreferredHeightSet
1451 <<
" preferredHeight=" << attachedPrivate->m_preferredHeight;
1461 d->updateFillIndex();
1471 d->updateHoveredHandle(hoveredItem);
1479 d->updateHoveredHandle(
nullptr);
1485 qCDebug(qlcQQuickSplitViewPointer) <<
"childMouseEventFilter called with" <<
item <<
event;
1489 const auto &eventPoint = pointerEvent->
points().
first();
1491 const auto timestamp = pointerEvent->timestamp();
1493 switch (
event->type()) {
1495 d->handlePress(point, timestamp);
1498 if (
d->m_pressedHandleIndex != -1)
1499 item->setKeepMouseGrab(
true);
1502 d->handleRelease(point, timestamp);
1505 d->handleMove(point, timestamp);
1508 if (pointerEvent->pointCount() == 1) {
1509 d->handlePress(point, timestamp);
1513 if (
d->m_pressedHandleIndex != -1) {
1514 item->setKeepTouchGrab(
true);
1515 pointerEvent->setExclusiveGrabber(eventPoint,
item);
1520 if (pointerEvent->pointCount() == 1)
1521 d->handleRelease(point, timestamp);
1524 if (pointerEvent->pointCount() == 1)
1525 d->handleMove(point, timestamp);
1534 if (
d->m_pressedHandleIndex != -1)
1554 const int count =
d->contentModel->count();
1555 qCDebug(qlcQQuickSplitView).nospace() <<
"split item " <<
item <<
" added at index " <<
index
1556 <<
"; there are now " <<
count <<
" items";
1559 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
1570 d->addImplicitSizeListener(
item);
1572 d->updateHandleVisibilities();
1573 d->updateFillIndex();
1583 qCDebug(qlcQQuickSplitView) <<
"split item" <<
item <<
"moved to index" <<
index;
1585 d->updateHandleVisibilities();
1586 d->updateFillIndex();
1596 qCDebug(qlcQQuickSplitView).nospace() <<
"split item " <<
item <<
" removed from index " <<
index
1597 <<
"; there are now " <<
d->contentModel->count() <<
" items";
1600 if (
d->m_hoveredHandleIndex != -1 ||
d->m_pressedHandleIndex != -1) {
1601 const int handleIndex =
d->m_hoveredHandleIndex != -1 ?
d->m_hoveredHandleIndex :
d->m_pressedHandleIndex;
1602 QQuickItem *itemHandle =
d->m_handleItems.at(handleIndex);
1604 qmlAttachedPropertiesObject<QQuickSplitHandleAttached>(itemHandle,
false));
1605 if (handleAttached) {
1607 handleAttachedPrivate->setHovered(
false);
1608 handleAttachedPrivate->setPressed(
false);
1611 d->m_hoveredHandleIndex = -1;
1612 d->m_pressedHandleIndex = -1;
1617 qmlAttachedPropertiesObject<QQuickSplitView>(
item,
false));
1621 d->removeImplicitSizeListener(
item);
1623 d->removeExcessHandles();
1624 d->updateHandleVisibilities();
1625 d->updateFillIndex();
1629#if QT_CONFIG(accessibility)
1630QAccessible::Role QQuickSplitView::accessibleRole()
const
1632 return QAccessible::Pane;
1642 qmlWarning(
parent) <<
"SplitView: attached properties can only be used on Items";
1649 d->m_splitItem =
item;
1662 qmlWarning(
parent) <<
"SplitView: attached properties must be accessed through a direct child of SplitView";
1666 d->setView(splitView);
1678 return d->m_splitView;
1697 return d->m_minimumWidth;
1703 d->m_isMinimumWidthSet =
true;
1707 d->m_minimumWidth =
width;
1708 d->requestLayoutView();
1717 d->m_isMinimumWidthSet =
false;
1718 d->m_minimumWidth = -1;
1721 if (
qFuzzyCompare(newEffectiveMinimumWidth, oldEffectiveMinimumWidth))
1724 d->requestLayoutView();
1744 return d->m_minimumHeight;
1750 d->m_isMinimumHeightSet =
true;
1755 d->requestLayoutView();
1764 d->m_isMinimumHeightSet =
false;
1765 d->m_minimumHeight = -1;
1768 if (
qFuzzyCompare(newEffectiveMinimumHeight, oldEffectiveMinimumHeight))
1771 d->requestLayoutView();
1798 return d->m_preferredWidth;
1804 d->m_isPreferredWidthSet =
true;
1808 const bool ignoreNextLayoutRequest = splitViewPrivate && splitViewPrivate->m_ignoreNextLayoutRequest;
1809 if (splitViewPrivate)
1810 splitViewPrivate->m_ignoreNextLayoutRequest =
false;
1815 d->m_preferredWidth =
width;
1817 if (!ignoreNextLayoutRequest) {
1820 d->requestLayoutView();
1832 d->m_isPreferredWidthSet =
false;
1833 d->m_preferredWidth = -1;
1837 if (
qFuzzyCompare(newEffectivePreferredWidth, oldEffectivePreferredWidth))
1840 d->requestLayoutView();
1867 return d->m_preferredHeight;
1873 d->m_isPreferredHeightSet =
true;
1877 const bool ignoreNextLayoutRequest = splitViewPrivate && splitViewPrivate->m_ignoreNextLayoutRequest;
1878 if (splitViewPrivate)
1879 splitViewPrivate->m_ignoreNextLayoutRequest =
false;
1884 d->m_preferredHeight =
height;
1886 if (!ignoreNextLayoutRequest) {
1889 d->requestLayoutView();
1901 d->m_isPreferredHeightSet =
false;
1902 d->m_preferredHeight = -1;
1906 if (
qFuzzyCompare(newEffectivePreferredHeight, oldEffectivePreferredHeight))
1909 d->requestLayoutView();
1929 return d->m_maximumWidth;
1935 d->m_isMaximumWidthSet =
true;
1939 d->m_maximumWidth =
width;
1940 d->requestLayoutView();
1949 d->m_isMaximumWidthSet =
false;
1950 d->m_maximumWidth = -1;
1953 if (
qFuzzyCompare(newEffectiveMaximumWidth, oldEffectiveMaximumWidth))
1956 d->requestLayoutView();
1976 return d->m_maximumHeight;
1982 d->m_isMaximumHeightSet =
true;
1987 d->requestLayoutView();
1996 d->m_isMaximumHeightSet =
false;
1997 d->m_maximumHeight = -1;
2000 if (
qFuzzyCompare(newEffectiveMaximumHeight, oldEffectiveMaximumHeight))
2003 d->requestLayoutView();
2026 return d->m_fillWidth;
2032 d->m_isFillWidthSet =
true;
2033 if (
fill ==
d->m_fillWidth)
2036 d->m_fillWidth =
fill;
2039 d->requestLayoutView();
2062 return d->m_fillHeight;
2068 d->m_isFillHeightSet =
true;
2069 if (
fill ==
d->m_fillHeight)
2072 d->m_fillHeight =
fill;
2073 if (
d->m_splitView &&
d->m_splitView->orientation() ==
Qt::Vertical)
2075 d->requestLayoutView();
2080 : m_fillWidth(
false)
2081 , m_fillHeight(
false)
2082 , m_isFillWidthSet(
false)
2083 , m_isFillHeightSet(
false)
2084 , m_isMinimumWidthSet(
false)
2085 , m_isMinimumHeightSet(
false)
2086 , m_isPreferredWidthSet(
false)
2087 , m_isPreferredHeightSet(
false)
2088 , m_isMaximumWidthSet(
false)
2089 , m_isMaximumHeightSet(
false)
2091 , m_minimumHeight(0)
2092 , m_preferredWidth(-1)
2093 , m_preferredHeight(-1)
2094 , m_maximumWidth(
std::numeric_limits<
qreal>::infinity())
2095 , m_maximumHeight(
std::numeric_limits<
qreal>::infinity())
2106 qCDebug(qlcQQuickSplitView) <<
"set SplitView" << newView <<
"on attached object" <<
this;
2107 emit q->viewChanged();
2118 return attached->d_func();
2123 return attached->d_func();
2139 emit q->hoveredChanged();
2149 emit q->pressedChanged();
2154 return attached->d_func();
2159 return attached->d_func();
2192 return d->m_hovered;
2205 return d->m_pressed;
2215#include "moc_qquicksplitview_p.cpp"
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator insert(qsizetype i, parameter_type t)
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
QObject * parent() const
Returns a pointer to the parent object.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
A base class for pointer events.
const QList< QEventPoint > & points() const
Returns a list of points in this pointer event.
The QQmlComponent class encapsulates a QML component definition.
virtual QObject * beginCreate(QQmlContext *)
Create an object instance from this component, within the specified context.
virtual void completeCreate()
This method provides advanced control over component instance creation.
QQmlContext * creationContext() const
Returns the QQmlContext the component was created in.
The QQmlContext class defines a context within a QML engine.
int count() const override
\qmlproperty int QtQml.Models::ObjectModel::count
int indexOf(QObject *object, QObject *objectContext) const override
QQmlObjectModel * contentModel
virtual bool handlePress(const QPointF &point, ulong timestamp)
virtual QQuickItem * getContentItem()
virtual bool handleRelease(const QPointF &point, ulong timestamp)
virtual bool handleMove(const QPointF &point, ulong timestamp)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
quint32 componentComplete
QQmlListProperty< QObject > data()
static QQuickItemPrivate * get(QQuickItem *item)
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
void setFiltersChildMouseEvents(bool filter)
Sets whether pointer events intended for this item's children should be filtered through this item.
Q_INVOKABLE QPointF mapFromItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in item's coordinate system to the equivalent point within this item's coordinat...
qreal x
\qmlproperty real QtQuick::Item::x \qmlproperty real QtQuick::Item::y \qmlproperty real QtQuick::Item...
QString state() const
\qmlproperty string QtQuick::Item::state
virtual void hoverMoveEvent(QHoverEvent *event)
This event handler can be reimplemented in a subclass to receive hover-move events for an item.
Q_INVOKABLE QQuickItem * childAt(qreal x, qreal y) const
\qmlmethod QtQuick::Item::childAt(real x, real y)
qreal width
This property holds the width of this item.
virtual bool childMouseEventFilter(QQuickItem *, QEvent *)
Reimplement this method to filter the pointer events that are received by this item's children.
void setHovered(bool hovered)
void setPressed(bool pressed)
QQuickSplitHandleAttachedPrivate()
static QQuickSplitHandleAttachedPrivate * get(QQuickSplitHandleAttached *attached)
bool isHovered() const
Provides attached properties for SplitView handles.
QQuickSplitHandleAttached(QObject *parent=nullptr)
static QQuickSplitHandleAttached * qmlAttachedProperties(QObject *object)
bool isPressed() const
\qmlattachedproperty bool QtQuick.Controls::SplitHandle::pressed
void setView(QQuickSplitView *newView)
static QQuickSplitViewAttachedPrivate * get(QQuickSplitViewAttached *attached)
QQuickSplitViewAttachedPrivate()
QQuickSplitView * m_splitView
void preferredHeightChanged()
void setMinimumHeight(qreal height)
void resetMaximumHeight()
void setMinimumWidth(qreal width)
void setMaximumHeight(qreal height)
QQuickSplitViewAttached(QObject *parent=nullptr)
void resetMinimumHeight()
void minimumWidthChanged()
void minimumHeightChanged()
void resetPreferredWidth()
void resetPreferredHeight()
void setPreferredWidth(qreal width)
void preferredWidthChanged()
void setPreferredHeight(qreal height)
void maximumHeightChanged()
void setMaximumWidth(qreal width)
void setFillWidth(bool fill)
void maximumWidthChanged()
void setFillHeight(bool fill)
void resizeHandle(QQuickItem *handleItem)
void setResizing(bool resizing)
qreal m_rightOrBottomItemSizeBeforePress
void updatePolish() override
bool handlePress(const QPointF &point, ulong timestamp) override
qreal accumulatedSize(int firstIndex, int lastIndex) const
void itemImplicitHeightChanged(QQuickItem *item) override
void itemVisibilityChanged(QQuickItem *item) override
bool handleRelease(const QPointF &point, ulong timestamp) override
void itemImplicitWidthChanged(QQuickItem *item) override
bool isHorizontal() const
QHash< QQuickItem *, LayoutData > m_layoutData
void updateHandleVisibilities()
void layoutResizeFillItem(QQuickItem *fillItem, qreal &usedWidth, qreal &usedHeight, int indexBeingResizedDueToDrag)
int handleIndexForSplitIndex(int splitIndex) const
Qt::Orientation m_orientation
bool handleMove(const QPointF &point, ulong timestamp) override
int m_nextVisibleIndexAfterPressedHandle
void limitAndApplySizes(qreal usedWidth, qreal usedHeight)
QPointF m_handlePosBeforePress
void layoutResizeSplitItems(qreal &usedWidth, qreal &usedHeight, int &indexBeingResizedDueToDrag)
EffectiveSizeData effectiveSizeData(const QQuickItemPrivate *itemPrivate, const QQuickSplitViewAttached *attached) const
void layoutPositionItems(const QQuickItem *fillItem)
void updateHoveredHandle(QQuickItem *hoveredItem)
QList< QQuickItem * > m_handleItems
bool m_ignoreNextLayoutRequest
void removeExcessHandles()
qreal m_leftOrTopItemSizeBeforePress
static QQuickSplitViewPrivate * get(QQuickSplitView *splitView)
void createHandleItem(int index)
QQuickItem * getContentItem() override
void updateFillIndex()
Lays out items with a draggable splitter between each item.
static QQuickSplitViewAttached * qmlAttachedProperties(QObject *object)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setOrientation(Qt::Orientation orientation)
~QQuickSplitView() override
void setHandle(QQmlComponent *handle)
void itemAdded(int index, QQuickItem *item) override
void hoverLeaveEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-leave events for an item.
void hoverMoveEvent(QHoverEvent *event) override
This event handler can be reimplemented in a subclass to receive hover-move events for an item.
Q_INVOKABLE QVariant saveState()
\qmlmethod var QtQuick.Controls::SplitView::saveState()
void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override
bool isContent(QQuickItem *item) const override
void orientationChanged()
QQmlComponent * handle
\qmlproperty Component QtQuick.Controls::SplitView::handle
Qt::Orientation orientation
void itemRemoved(int index, QQuickItem *item) override
bool childMouseEventFilter(QQuickItem *item, QEvent *event) override
Reimplement this method to filter the pointer events that are received by this item's children.
Q_INVOKABLE bool restoreState(const QVariant &state)
\qmlmethod bool QtQuick.Controls::SplitView::restoreState(state)
bool isResizing() const
\qmlproperty bool QtQuick.Controls::SplitView::resizing \readonly
QQuickSplitView(QQuickItem *parent=nullptr)
void itemMoved(int index, QQuickItem *item) override
\inmodule QtCore\reentrant
const_iterator constBegin() const noexcept
const_iterator constEnd() const noexcept
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
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)
GLuint64 GLenum void * handle
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLsizei const void * pointer
GLdouble GLdouble GLdouble GLdouble q
QQmlContext * qmlContext(const QObject *obj)
Q_QML_EXPORT QQmlInfo qmlWarning(const QObject *me)
QQuickItem * qobject_cast< QQuickItem * >(QObject *o)
qreal effectiveMaximumHeight(const QQuickSplitViewAttachedPrivate *attachedPrivate)
qreal effectivePreferredHeight(const QQuickSplitViewAttachedPrivate *attachedPrivate, const QQuickItemPrivate *itemPrivate)
qreal effectivePreferredWidth(const QQuickSplitViewAttachedPrivate *attachedPrivate, const QQuickItemPrivate *itemPrivate)
qreal effectiveMinimumWidth(const QQuickSplitViewAttachedPrivate *attachedPrivate)
qreal effectiveMaximumWidth(const QQuickSplitViewAttachedPrivate *attachedPrivate)
qreal effectiveMinimumHeight(const QQuickSplitViewAttachedPrivate *attachedPrivate)
#define Q_ASSERT_X(cond, x, msg)
#define qPrintable(string)
QLatin1StringView QLatin1String
\inmodule QtCore\reentrant
QString errorString() const
\variable QCborParserError::offset
qsizetype indexOf(const AT &t, qsizetype from=0) const noexcept