Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qsplitter.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "qsplitter.h"
5
6#include "qapplication.h"
7#include "qcursor.h"
8#include "qdrawutil.h"
9#include "qevent.h"
10#include "qlayout.h"
11#include "qlist.h"
12#include "qpainter.h"
13#if QT_CONFIG(rubberband)
14#include "qrubberband.h"
15#endif
16#include "qstyle.h"
17#include "qstyleoption.h"
18#include "qtextstream.h"
19#include "qvarlengtharray.h"
20#include "private/qlayoutengine_p.h"
21#include "private/qsplitter_p.h"
22#include "qtimer.h"
23#include "qdebug.h"
24
25#include <ctype.h>
26
28
29using namespace Qt::StringLiterals;
30
31//#define QSPLITTER_DEBUG
32
36
87 : QWidget(*new QSplitterHandlePrivate, parent, { })
88{
89 Q_D(QSplitterHandle);
90 d->s = parent;
91 setOrientation(orientation);
92}
93
100
108{
109 Q_D(QSplitterHandle);
110 d->orient = orientation;
111#ifndef QT_NO_CURSOR
113#endif
114}
115
122{
123 Q_D(const QSplitterHandle);
124 return d->orient;
125}
126
127
135{
136 Q_D(const QSplitterHandle);
137 return d->s->opaqueResize();
138}
139
140
147{
148 return d_func()->s;
149}
150
162{
163 Q_D(QSplitterHandle);
164 if (d->s->isRightToLeft() && d->orient == Qt::Horizontal)
165 pos = d->s->contentsRect().width() - pos;
166 d->s->moveSplitter(pos, d->s->indexOf(this));
167}
168
178{
179 Q_D(QSplitterHandle);
180 QSplitter *s = d->s;
181 if (s->isRightToLeft() && d->orient == Qt::Horizontal) {
182 int w = s->contentsRect().width();
183 return w - s->closestLegalPosition(w - pos, s->indexOf(this));
184 }
185 return s->closestLegalPosition(pos, s->indexOf(this));
186}
187
192{
193 Q_D(const QSplitterHandle);
194 int hw = d->s->handleWidth();
195 QStyleOption opt(0);
196 opt.initFrom(d->s);
198 return parentWidget()->style()->sizeFromContents(QStyle::CT_Splitter, &opt, QSize(hw, hw), d->s);
199}
200
205{
206 Q_D(const QSplitterHandle);
207
208 // Ensure the actual grab area is at least 4 or 5 pixels
209 const int handleMargin = (5 - d->s->handleWidth()) / 2;
210
211 // Note that QSplitter uses contentsRect for layouting
212 // and ensures that handles are drawn on top of widgets
213 // We simply use the contents margins for draggin and only
214 // paint the mask area
215 const bool useTinyMode = handleMargin > 0;
216 setAttribute(Qt::WA_MouseNoMask, useTinyMode);
217 if (useTinyMode) {
219 setContentsMargins(handleMargin, 0, handleMargin, 0);
220 else
221 setContentsMargins(0, handleMargin, 0, handleMargin);
223 } else {
224 setContentsMargins(0, 0, 0, 0);
225 clearMask();
226 }
227
229}
230
235{
236 Q_D(QSplitterHandle);
237 switch(event->type()) {
239 d->hover = true;
240 update();
241 break;
243 d->hover = false;
244 update();
245 break;
246 default:
247 break;
248 }
249 return QWidget::event(event);
250}
251
256{
257 Q_D(QSplitterHandle);
258 if (!d->pressed)
259 return;
260
261 const int pos = d->pick(parentWidget()->mapFromGlobal(e->globalPosition().toPoint()))
262 - d->mouseOffset;
263 if (opaqueResize()) {
265 } else {
266 d->s->setRubberBand(closestLegalPosition(pos));
267 }
268}
269
274{
275 Q_D(QSplitterHandle);
276 if (e->button() == Qt::LeftButton) {
277 d->mouseOffset = d->pick(e->position().toPoint());
278 d->pressed = true;
279 update();
280 }
281}
282
287{
288 Q_D(QSplitterHandle);
289 if (!d->pressed)
290 return;
291
292 if (!opaqueResize()) {
293 const int pos = d->pick(parentWidget()->mapFromGlobal(e->globalPosition().toPoint()))
294 - d->mouseOffset;
295 d->s->setRubberBand(-1);
297 }
298
299 d->pressed = false;
300 update();
301}
302
325
326
328{
329 if (sizer == -1) {
330 QSize s = widget->sizeHint();
331 const int presizer = pick(s, orient);
332 const int realsize = pick(widget->size(), orient);
333 if (!s.isValid() || (widget->testAttribute(Qt::WA_Resized) && (realsize > presizer))) {
334 sizer = pick(widget->size(), orient);
335 } else {
336 sizer = presizer;
337 }
339 int sf = (orient == Qt::Horizontal) ? p.horizontalStretch() : p.verticalStretch();
340 if (sf > 1)
341 sizer *= sf;
342 }
343 return sizer;
344}
345
347{
348 return pick(handle->sizeHint(), orient);
349}
350
352{
353 Q_Q(QSplitter);
355 if (orient == Qt::Vertical)
356 sp.transpose();
357 q->setSizePolicy(sp);
358 q->setAttribute(Qt::WA_WState_OwnSizePolicy, false);
359}
360
362{
363 Q_Q(QSplitter);
364 int n = list.size();
365 /*
366 Splitter handles before the first visible widget or right
367 before a hidden widget must be hidden.
368 */
369 bool first = true;
370 bool allInvisible = n != 0;
371 for (int i = 0; i < n ; ++i) {
373 bool widgetHidden = s->widget->isHidden();
374 if (allInvisible && !widgetHidden && !s->collapsed)
375 allInvisible = false;
376 s->handle->setHidden(first || widgetHidden);
377 if (!widgetHidden)
378 first = false;
379 }
380
381 if (allInvisible)
382 for (int i = 0; i < n ; ++i) {
384 if (!s->widget->isHidden()) {
385 s->collapsed = false;
386 break;
387 }
388 }
389
390 int fi = 2 * q->frameWidth();
391 int maxl = fi;
392 int minl = fi;
393 int maxt = QWIDGETSIZE_MAX;
394 int mint = fi;
395 /*
396 calculate min/max sizes for the whole splitter
397 */
398 bool empty = true;
399 for (int j = 0; j < n; j++) {
401
402 if (!s->widget->isHidden()) {
403 empty = false;
404 if (!s->handle->isHidden()) {
405 minl += s->getHandleSize(orient);
406 maxl += s->getHandleSize(orient);
407 }
408
409 QSize minS = qSmartMinSize(s->widget);
410 minl += pick(minS);
411 maxl += pick(qSmartMaxSize(s->widget));
412 mint = qMax(mint, trans(minS));
413 int tm = trans(qSmartMaxSize(s->widget));
414 if (tm > 0)
415 maxt = qMin(maxt, tm);
416 }
417 }
418
419 if (empty) {
420 if (qobject_cast<QSplitter *>(parent)) {
421 // nested splitters; be nice
422 maxl = maxt = 0;
423 } else {
424 // QSplitter with no children yet
425 maxl = QWIDGETSIZE_MAX;
426 }
427 } else {
428 maxl = qMin<int>(maxl, QWIDGETSIZE_MAX);
429 }
430 if (maxt < mint)
431 maxt = mint;
432
433 if (update) {
434 if (orient == Qt::Horizontal) {
435 q->setMaximumSize(maxl, maxt);
436 if (q->isWindow())
437 q->setMinimumSize(minl,mint);
438 } else {
439 q->setMaximumSize(maxt, maxl);
440 if (q->isWindow())
441 q->setMinimumSize(mint,minl);
442 }
443 doResize();
444 q->updateGeometry();
445 } else {
446 firstShow = true;
447 }
448}
449
451{
452 Q_Q(QSplitter);
453 QRect r = q->contentsRect();
454 int n = list.size();
455 QList<QLayoutStruct> a(n * 2);
456 int i;
457
458 bool noStretchFactorsSet = true;
459 for (i = 0; i < n; ++i) {
461 int sf = orient == Qt::Horizontal ? p.horizontalStretch() : p.verticalStretch();
462 if (sf != 0) {
463 noStretchFactorsSet = false;
464 break;
465 }
466 }
467
468 int j=0;
469 for (i = 0; i < n; ++i) {
471#ifdef QSPLITTER_DEBUG
472 qDebug("widget %d hidden: %d collapsed: %d handle hidden: %d", i, s->widget->isHidden(),
473 s->collapsed, s->handle->isHidden());
474#endif
475
476 a[j].init();
477 if (s->handle->isHidden()) {
478 a[j].maximumSize = 0;
479 } else {
480 a[j].sizeHint = a[j].minimumSize = a[j].maximumSize = s->getHandleSize(orient);
481 a[j].empty = false;
482 }
483 ++j;
484
485 a[j].init();
486 if (s->widget->isHidden() || s->collapsed) {
487 a[j].maximumSize = 0;
488 } else {
489 a[j].minimumSize = pick(qSmartMinSize(s->widget));
490 a[j].maximumSize = pick(qSmartMaxSize(s->widget));
491 a[j].empty = false;
492
493 bool stretch = noStretchFactorsSet;
494 if (!stretch) {
495 QSizePolicy p = s->widget->sizePolicy();
496 int sf = orient == Qt::Horizontal ? p.horizontalStretch() : p.verticalStretch();
497 stretch = (sf != 0);
498 }
499 if (stretch) {
500 a[j].stretch = s->getWidgetSize(orient);
501 a[j].sizeHint = a[j].minimumSize;
502 a[j].expansive = true;
503 } else {
504 a[j].sizeHint = qMax(s->getWidgetSize(orient), a[j].minimumSize);
505 }
506 }
507 ++j;
508 }
509
510 qGeomCalc(a, 0, n*2, pick(r.topLeft()), pick(r.size()), 0);
511
512#ifdef QSPLITTER_DEBUG
513 for (i = 0; i < n*2; ++i) {
514 qDebug("%*s%d: stretch %d, sh %d, minS %d, maxS %d, exp %d, emp %d -> %d, %d",
515 i, "", i,
516 a[i].stretch,
517 a[i].sizeHint,
518 a[i].minimumSize,
519 a[i].maximumSize,
520 a[i].expansive,
521 a[i].empty,
522 a[i].pos,
523 a[i].size);
524 }
525#endif
526
527 for (i = 0; i < n; ++i) {
529 setGeo(s, a[i*2+1].pos, a[i*2+1].size, false);
530 }
531}
532
534{
535 for (int i = 0; i < list.size(); ++i) {
537 sls->sizer = pick(sls->rect.size());
538 }
539}
540
541void QSplitterPrivate::addContribution(int index, int *min, int *max, bool mayCollapse) const
542{
544 if (!s->widget->isHidden()) {
545 if (!s->handle->isHidden()) {
546 *min += s->getHandleSize(orient);
547 *max += s->getHandleSize(orient);
548 }
549 if (mayCollapse || !s->collapsed)
550 *min += pick(qSmartMinSize(s->widget));
551
552 *max += pick(qSmartMaxSize(s->widget));
553 }
554}
555
556int QSplitterPrivate::findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const
557{
558 if (delta < 0)
559 index += delta;
560 do {
562 if (!w->isHidden()) {
563 if (collapsible(list.at(index)))
564 collapsibleSize = pick(qSmartMinSize(w));
565 return index;
566 }
567 index += delta;
568 } while (index >= 0 && index < list.size());
569
570 return -1;
571}
572
573/*
574 For the splitter handle with index \a index, \a min and \a max give the range without collapsing any widgets,
575 and \a farMin and farMax give the range with collapsing included.
576*/
577void QSplitterPrivate::getRange(int index, int *farMin, int *min, int *max, int *farMax) const
578{
579 Q_Q(const QSplitter);
580 int n = list.size();
581 if (index <= 0 || index >= n)
582 return;
583
584 int collapsibleSizeBefore = 0;
585 int idJustBefore = findWidgetJustBeforeOrJustAfter(index, -1, collapsibleSizeBefore);
586
587 int collapsibleSizeAfter = 0;
588 int idJustAfter = findWidgetJustBeforeOrJustAfter(index, +1, collapsibleSizeAfter);
589
590 int minBefore = 0;
591 int minAfter = 0;
592 int maxBefore = 0;
593 int maxAfter = 0;
594 int i;
595
596 for (i = 0; i < index; ++i)
597 addContribution(i, &minBefore, &maxBefore, i == idJustBefore);
598 for (i = index; i < n; ++i)
599 addContribution(i, &minAfter, &maxAfter, i == idJustAfter);
600
601 QRect r = q->contentsRect();
602 int farMinVal;
603 int minVal;
604 int maxVal;
605 int farMaxVal;
606
607 int smartMinBefore = qMax(minBefore, pick(r.size()) - maxAfter);
608 int smartMaxBefore = qMin(maxBefore, pick(r.size()) - minAfter);
609
610 minVal = pick(r.topLeft()) + smartMinBefore;
611 maxVal = pick(r.topLeft()) + smartMaxBefore;
612
613 farMinVal = minVal;
614 if (minBefore - collapsibleSizeBefore >= pick(r.size()) - maxAfter)
615 farMinVal -= collapsibleSizeBefore;
616 farMaxVal = maxVal;
617 if (pick(r.size()) - (minAfter - collapsibleSizeAfter) <= maxBefore)
618 farMaxVal += collapsibleSizeAfter;
619
620 if (farMin)
621 *farMin = farMinVal;
622 if (min)
623 *min = minVal;
624 if (max)
625 *max = maxVal;
626 if (farMax)
627 *farMax = farMaxVal;
628}
629
630int QSplitterPrivate::adjustPos(int pos, int index, int *farMin, int *min, int *max, int *farMax) const
631{
632 const int Threshold = 40;
633
634 getRange(index, farMin, min, max, farMax);
635
636 if (pos >= *min) {
637 if (pos <= *max) {
638 return pos;
639 } else {
640 int delta = pos - *max;
641 int width = *farMax - *max;
642
643 if (delta > width / 2 && delta >= qMin(Threshold, width)) {
644 return *farMax;
645 } else {
646 return *max;
647 }
648 }
649 } else {
650 int delta = *min - pos;
651 int width = *min - *farMin;
652
653 if (delta > width / 2 && delta >= qMin(Threshold, width)) {
654 return *farMin;
655 } else {
656 return *min;
657 }
658 }
659}
660
662{
663 if (s->collapsible != Default) {
664 return (bool)s->collapsible;
665 } else {
666 return childrenCollapsible;
667 }
668}
669
671{
672 Q_Q(QSplitter);
673 recalc(q->isVisible());
674}
675
676void QSplitterPrivate::setSizes_helper(const QList<int> &sizes, bool clampNegativeSize)
677{
678 int j = 0;
679
680 for (int i = 0; i < list.size(); ++i) {
682
683 s->collapsed = false;
684 s->sizer = sizes.value(j++);
685 if (clampNegativeSize && s->sizer < 0)
686 s->sizer = 0;
687 int smartMinSize = pick(qSmartMinSize(s->widget));
688
689 // Make sure that we reset the collapsed state.
690 if (s->sizer == 0) {
691 if (collapsible(s) && smartMinSize > 0) {
692 s->collapsed = true;
693 } else {
694 s->sizer = smartMinSize;
695 }
696 } else {
697 if (s->sizer < smartMinSize)
698 s->sizer = smartMinSize;
699 }
700 }
701 doResize();
702}
703
704/*
705 Used by various methods inserting a widget to find out if we need to show the widget
706 explicitly, which we have to if the splitter is already visible, and if the widget hasn't
707 been explicitly hidden before inserting it.
708*/
710{
711 Q_Q(const QSplitter);
712 return q->isVisible() && !QWidgetPrivate::get(w)->isExplicitlyHidden();
713}
714
715void QSplitterPrivate::setGeo(QSplitterLayoutStruct *sls, int p, int s, bool allowCollapse)
716{
717 Q_Q(QSplitter);
718 QWidget *w = sls->widget;
719 QRect r;
720 QRect contents = q->contentsRect();
721 if (orient == Qt::Horizontal) {
722 r.setRect(p, contents.y(), s, contents.height());
723 } else {
724 r.setRect(contents.x(), p, contents.width(), s);
725 }
726 sls->rect = r;
727
728 int minSize = pick(qSmartMinSize(w));
729
730 if (orient == Qt::Horizontal && q->isRightToLeft())
731 r.moveRight(contents.width() - r.left());
732
733 if (allowCollapse)
734 sls->collapsed = s <= 0 && minSize > 0 && !w->isHidden();
735
736 // Hide the child widget, but without calling hide() so that
737 // the splitter handle is still shown.
738 if (sls->collapsed)
739 r.moveTopLeft(QPoint(-r.width()-1, -r.height()-1));
740
741 w->setGeometry(r);
742
743 if (!sls->handle->isHidden()) {
744 QSplitterHandle *h = sls->handle;
745 QSize hs = h->sizeHint();
746 const QMargins m = h->contentsMargins();
747 if (orient==Qt::Horizontal) {
748 if (q->isRightToLeft())
749 p = contents.width() - p + hs.width();
750 h->setGeometry(p-hs.width() - m.left(), contents.y(), hs.width() + m.left() + m.right(), contents.height());
751 } else {
752 h->setGeometry(contents.x(), p-hs.height() - m.top(), contents.width(), hs.height() + m.top() + m.bottom());
753 }
754 }
755}
756
757void QSplitterPrivate::doMove(bool backwards, int hPos, int index, int delta, bool mayCollapse,
758 int *positions, int *widths)
759{
760 if (index < 0 || index >= list.size())
761 return;
762
763#ifdef QSPLITTER_DEBUG
764 qDebug() << "QSplitterPrivate::doMove" << backwards << hPos << index << delta << mayCollapse;
765#endif
766
768 QWidget *w = s->widget;
769
770 int nextId = backwards ? index - delta : index + delta;
771
772 if (w->isHidden()) {
773 doMove(backwards, hPos, nextId, delta, collapsible(nextId), positions, widths);
774 } else {
775 int hs =s->handle->isHidden() ? 0 : s->getHandleSize(orient);
776
777 int ws = backwards ? hPos - pick(s->rect.topLeft())
778 : pick(s->rect.bottomRight()) - hPos -hs + 1;
779 if (ws > 0 || (!s->collapsed && !mayCollapse)) {
780 ws = qMin(ws, pick(qSmartMaxSize(w)));
781 ws = qMax(ws, pick(qSmartMinSize(w)));
782 } else {
783 ws = 0;
784 }
785 positions[index] = backwards ? hPos - ws : hPos + hs;
786 widths[index] = ws;
787 doMove(backwards, backwards ? hPos - ws - hs : hPos + hs + ws, nextId, delta,
788 collapsible(nextId), positions, widths);
789 }
790
791}
792
794{
795 for (int i = 0; i < list.size(); ++i) {
796 if (list.at(i)->widget == w)
797 return list.at(i);
798 }
799 return nullptr;
800}
801
802
807{
808 Q_Q(QSplitter);
810 const bool needShow = show && shouldShowWidget(widget);
811 if (widget->parentWidget() != q)
813 if (needShow)
814 widget->show();
816 recalc(q->isVisible());
817}
818
819/*
820 Inserts the widget \a w at position \a index in the splitter's list of widgets.
821
822 If \a w is already in the splitter, it will be moved to the new position.
823*/
824
826{
827 Q_Q(QSplitter);
828 QSplitterLayoutStruct *sls = nullptr;
829 int i;
830 int last = list.size();
831 for (i = 0; i < list.size(); ++i) {
833 if (s->widget == w) {
834 sls = s;
835 --last;
836 break;
837 }
838 }
839 if (index < 0 || index > last)
840 index = last;
841
842 if (sls) {
843 list.move(i,index);
844 } else {
845 sls = new QSplitterLayoutStruct;
846 QSplitterHandle *newHandle = q->createHandle();
847 newHandle->setObjectName("qt_splithandle_"_L1 + w->objectName());
848 sls->handle = newHandle;
849 sls->widget = w;
850 w->lower();
851 list.insert(index,sls);
852
853 if (newHandle && q->isVisible())
854 newHandle->show(); // will trigger sending of post events
855
856 }
857 return sls;
858}
859
920 : QSplitter(Qt::Horizontal, parent)
921{
922}
923
924
931 : QFrame(*new QSplitterPrivate, parent)
932{
933 Q_D(QSplitter);
934 d->orient = orientation;
935 d->init();
936}
937
938
944{
945 Q_D(QSplitter);
946#if QT_CONFIG(rubberband)
947 delete d->rubberBand;
948#endif
949 while (!d->list.isEmpty())
950 delete d->list.takeFirst();
951}
952
958{
959 Q_D(QSplitter);
960 d->recalc(true);
961}
962
975{
976 Q_D(QSplitter);
977 if (d->orient == orientation)
978 return;
979
981 setSizePolicy(sizePolicy().transposed());
983 }
984
985 d->orient = orientation;
986
987 for (int i = 0; i < d->list.size(); ++i) {
988 QSplitterLayoutStruct *s = d->list.at(i);
990 }
991 d->recalc(isVisible());
992}
993
995{
996 Q_D(const QSplitter);
997 return d->orient;
998}
999
1012{
1013 Q_D(QSplitter);
1014 d->childrenCollapsible = collapse;
1015}
1016
1018{
1019 Q_D(const QSplitter);
1020 return d->childrenCollapsible;
1021}
1022
1036void QSplitter::setCollapsible(int index, bool collapse)
1037{
1038 Q_D(QSplitter);
1039
1040 if (Q_UNLIKELY(index < 0 || index >= d->list.size())) {
1041 qWarning("QSplitter::setCollapsible: Index %d out of range", index);
1042 return;
1043 }
1044 d->list.at(index)->collapsible = collapse ? 1 : 0;
1045}
1046
1051{
1052 Q_D(const QSplitter);
1053 if (Q_UNLIKELY(index < 0 || index >= d->list.size())) {
1054 qWarning("QSplitter::isCollapsible: Index %d out of range", index);
1055 return false;
1056 }
1057 return d->list.at(index)->collapsible;
1058}
1059
1064{
1065 Q_D(QSplitter);
1066 d->doResize();
1067}
1068
1080{
1081 Q_D(QSplitter);
1082 insertWidget(d->list.size(), widget);
1083}
1084
1098{
1099 Q_D(QSplitter);
1100 d->insertWidget_helper(index, widget, true);
1101}
1102
1125{
1126 Q_D(QSplitter);
1127 if (!widget) {
1128 qWarning("QSplitter::replaceWidget: Widget can't be null");
1129 return nullptr;
1130 }
1131
1132 if (index < 0 || index >= d->list.size()) {
1133 qWarning("QSplitter::replaceWidget: Index %d out of range", index);
1134 return nullptr;
1135 }
1136
1137 QSplitterLayoutStruct *s = d->list.at(index);
1138 QWidget *current = s->widget;
1139 if (current == widget) {
1140 qWarning("QSplitter::replaceWidget: Trying to replace a widget with itself");
1141 return nullptr;
1142 }
1143
1144 if (widget->parentWidget() == this) {
1145 qWarning("QSplitter::replaceWidget: Trying to replace a widget with one of its siblings");
1146 return nullptr;
1147 }
1148
1149 QBoolBlocker b(d->blockChildAdd);
1150
1151 const QRect geom = current->geometry();
1152 const bool wasHidden = current->isHidden();
1153
1154 s->widget = widget;
1155 current->setParent(nullptr);
1156 widget->setParent(this);
1157
1158 // The splitter layout struct's geometry is already set and
1159 // should not change. Only set the geometry on the new widget
1160 widget->setGeometry(geom);
1161 widget->lower();
1162 if (wasHidden)
1163 widget->hide();
1164 else if (d->shouldShowWidget(widget))
1165 widget->show();
1166
1167 return current;
1168}
1169
1181{
1182 Q_D(const QSplitter);
1183 for (int i = 0; i < d->list.size(); ++i) {
1184 QSplitterLayoutStruct *s = d->list.at(i);
1185 if (s->widget == widget || s->handle == widget)
1186 return i;
1187 }
1188 return -1;
1189}
1190
1199{
1200 Q_D(QSplitter);
1201 return new QSplitterHandle(d->orient, this);
1202}
1203
1216{
1217 Q_D(const QSplitter);
1218 if (index < 0 || index >= d->list.size())
1219 return nullptr;
1220 return d->list.at(index)->handle;
1221}
1222
1230{
1231 Q_D(const QSplitter);
1232 if (index < 0 || index >= d->list.size())
1233 return nullptr;
1234 return d->list.at(index)->widget;
1235}
1236
1243{
1244 Q_D(const QSplitter);
1245 return d->list.size();
1246}
1247
1264{
1265 Q_D(QSplitter);
1266 if (c->added()) {
1267 if (!c->child()->isWidgetType()) {
1268 if (Q_UNLIKELY(qobject_cast<QLayout *>(c->child())))
1269 qWarning("Adding a QLayout to a QSplitter is not supported.");
1270 return;
1271 }
1272 QWidget *w = static_cast<QWidget*>(c->child());
1273 if (!d->blockChildAdd && !w->isWindow() && !d->findWidget(w))
1274 d->insertWidget_helper(d->list.size(), w, false);
1275 } else if (c->polished()) {
1276 if (!c->child()->isWidgetType())
1277 return;
1278 QWidget *w = static_cast<QWidget*>(c->child());
1279 if (!d->blockChildAdd && !w->isWindow() && d->shouldShowWidget(w))
1280 w->show();
1281 } else if (c->removed()) {
1282 QObject *child = c->child();
1283 for (int i = 0; i < d->list.size(); ++i) {
1284 QSplitterLayoutStruct *s = d->list.at(i);
1285 if (s->widget == child) {
1286 d->list.removeAt(i);
1287 delete s;
1288 d->recalc(isVisible());
1289 return;
1290 }
1291 }
1292 }
1293}
1294
1295
1302{
1303#if QT_CONFIG(rubberband)
1304 Q_D(QSplitter);
1305 if (pos < 0) {
1306 if (d->rubberBand)
1307 d->rubberBand->deleteLater();
1308 return;
1309 }
1310 QRect r = contentsRect();
1311 const int rBord = 3; // customizable?
1312 int hw = handleWidth();
1313 if (!d->rubberBand) {
1314 QBoolBlocker b(d->blockChildAdd);
1315 d->rubberBand = new QRubberBand(QRubberBand::Line, this);
1316 // For accessibility to identify this special widget.
1317 d->rubberBand->setObjectName("qt_rubberband"_L1);
1318 }
1319
1320 const QRect newGeom = d->orient == Qt::Horizontal ? QRect(QPoint(pos + hw / 2 - rBord, r.y()), QSize(2 * rBord, r.height()))
1321 : QRect(QPoint(r.x(), pos + hw / 2 - rBord), QSize(r.width(), 2 * rBord));
1322 d->rubberBand->setGeometry(newGeom);
1323 d->rubberBand->show();
1324#else
1325 Q_UNUSED(pos);
1326#endif
1327}
1328
1334{
1335 Q_D(QSplitter);
1336 switch (e->type()) {
1337 case QEvent::Hide:
1338 // Reset firstShow to false here since things can be done to the splitter in between
1339 if (!d->firstShow)
1340 d->firstShow = true;
1341 break;
1342 case QEvent::Show:
1343 if (!d->firstShow)
1344 break;
1345 d->firstShow = false;
1346 Q_FALLTHROUGH();
1350 d->recalc(isVisible());
1351 break;
1352 default:
1353 ;
1354 }
1355 return QFrame::event(e);
1356}
1357
1383{
1384 Q_D(QSplitter);
1385 QSplitterLayoutStruct *s = d->list.at(index);
1386 int farMin = 0;
1387 int min = 0;
1388 int max = 0;
1389 int farMax = 0;
1390
1391#ifdef QSPLITTER_DEBUG
1392 int debugp = pos;
1393#endif
1394
1395 pos = d->adjustPos(pos, index, &farMin, &min, &max, &farMax);
1396 int oldP = d->pick(s->rect.topLeft());
1397#ifdef QSPLITTER_DEBUG
1398 qDebug() << "QSplitter::moveSplitter" << debugp << index << "adjusted" << pos << "oldP" << oldP;
1399#endif
1400
1401 QVarLengthArray<int, 32> poss(d->list.size());
1402 QVarLengthArray<int, 32> ws(d->list.size());
1403 bool upLeft;
1404
1405 d->doMove(false, pos, index, +1, (d->collapsible(s) && (pos > max)), poss.data(), ws.data());
1406 d->doMove(true, pos, index - 1, +1, (d->collapsible(index - 1) && (pos < min)), poss.data(), ws.data());
1407 upLeft = (pos < oldP);
1408
1409 int wid, delta, count = d->list.size();
1410 if (upLeft) {
1411 wid = 0;
1412 delta = 1;
1413 } else {
1414 wid = count - 1;
1415 delta = -1;
1416 }
1417 for (; wid >= 0 && wid < count; wid += delta) {
1418 QSplitterLayoutStruct *sls = d->list.at( wid );
1419 if (!sls->widget->isHidden())
1420 d->setGeo(sls, poss[wid], ws[wid], true);
1421 }
1422 d->storeSizes();
1423
1425}
1426
1427
1433void QSplitter::getRange(int index, int *min, int *max) const
1434{
1435 Q_D(const QSplitter);
1436 d->getRange(index, min, nullptr, nullptr, max);
1437}
1438
1439
1451{
1452 Q_D(QSplitter);
1453 int x = 0;
1454 int i = 0;
1455 int n = 0;
1456 int u = 0;
1457 return d->adjustPos(pos, index, &u, &n, &i, &x);
1458}
1459
1473{
1474 Q_D(const QSplitter);
1475 return d->opaqueResizeSet ? d->opaque : style()->styleHint(QStyle::SH_Splitter_OpaqueResize, nullptr, this);
1476}
1477
1478
1480{
1481 Q_D(QSplitter);
1482 d->opaqueResizeSet = true;
1483 d->opaque = on;
1484}
1485
1486
1491{
1492 Q_D(const QSplitter);
1494 int l = 0;
1495 int t = 0;
1496 for (int i = 0; i < d->list.size(); ++i) {
1497 QWidget *w = d->list.at(i)->widget;
1498 if (w->isHidden())
1499 continue;
1500 QSize s = w->sizeHint();
1501 if (s.isValid()) {
1502 l += d->pick(s);
1503 t = qMax(t, d->trans(s));
1504 }
1505 }
1506 return orientation() == Qt::Horizontal ? QSize(l, t) : QSize(t, l);
1507}
1508
1509
1515{
1516 Q_D(const QSplitter);
1518 int l = 0;
1519 int t = 0;
1520
1521 for (int i = 0; i < d->list.size(); ++i) {
1522 QSplitterLayoutStruct *s = d->list.at(i);
1523 if (!s || !s->widget)
1524 continue;
1525 if (s->widget->isHidden())
1526 continue;
1527 QSize widgetSize = qSmartMinSize(s->widget);
1528 if (widgetSize.isValid()) {
1529 l += d->pick(widgetSize);
1530 t = qMax(t, d->trans(widgetSize));
1531 }
1532 if (!s->handle || s->handle->isHidden())
1533 continue;
1534 QSize splitterSize = s->handle->sizeHint();
1535 if (splitterSize.isValid()) {
1536 l += d->pick(splitterSize);
1537 t = qMax(t, d->trans(splitterSize));
1538 }
1539 }
1540 return orientation() == Qt::Horizontal ? QSize(l, t) : QSize(t, l);
1541}
1542
1543
1560QList<int> QSplitter::sizes() const
1561{
1562 Q_D(const QSplitter);
1564
1565 const int numSizes = d->list.size();
1566 QList<int> list;
1567 list.reserve(numSizes);
1568
1569 for (int i = 0; i < numSizes; ++i) {
1570 QSplitterLayoutStruct *s = d->list.at(i);
1571 list.append(d->pick(s->rect.size()));
1572 }
1573 return list;
1574}
1575
1597void QSplitter::setSizes(const QList<int> &list)
1598{
1599 Q_D(QSplitter);
1600 d->setSizes_helper(list, true);
1601}
1602
1615{
1616 Q_D(const QSplitter);
1617 if (d->handleWidth >= 0) {
1618 return d->handleWidth;
1619 } else {
1620 return style()->pixelMetric(QStyle::PM_SplitterWidth, nullptr, this);
1621 }
1622}
1623
1625{
1626 Q_D(QSplitter);
1627 d->handleWidth = width;
1628 d->updateHandles();
1629}
1630
1635{
1636 Q_D(QSplitter);
1637 if (ev->type() == QEvent::StyleChange)
1638 d->updateHandles();
1640}
1641
1642static const qint32 SplitterMagic = 0xff;
1643
1656{
1657 Q_D(const QSplitter);
1658 int version = 1;
1661 stream.setVersion(QDataStream::Qt_5_0);
1662
1664 stream << qint32(version);
1665 const int numSizes = d->list.size();
1666 QList<int> list;
1667 list.reserve(numSizes);
1668 for (int i = 0; i < numSizes; ++i) {
1669 QSplitterLayoutStruct *s = d->list.at(i);
1670 list.append(s->sizer);
1671 }
1672 stream << list;
1674 stream << qint32(d->handleWidth);
1675 stream << opaqueResize();
1677 stream << d->opaqueResizeSet;
1678 return data;
1679}
1680
1698{
1699 Q_D(QSplitter);
1700 int version = 1;
1701 QByteArray sd = state;
1703 stream.setVersion(QDataStream::Qt_5_0);
1704 QList<int> list;
1705 bool b;
1706 qint32 i;
1707 qint32 marker;
1708 qint32 v;
1709
1710 stream >> marker;
1711 stream >> v;
1712 if (marker != SplitterMagic || v > version)
1713 return false;
1714
1715 stream >> list;
1716 d->setSizes_helper(list, false);
1717
1718 stream >> b;
1720
1721 stream >> i;
1723
1724 stream >> b;
1726
1727 stream >> i;
1729 d->doResize();
1730
1731 if (v >= 1)
1732 stream >> d->opaqueResizeSet;
1733
1734 return true;
1735}
1736
1752{
1753 Q_D(QSplitter);
1754 if (index <= -1 || index >= d->list.size())
1755 return;
1756
1757 QWidget *widget = d->list.at(index)->widget;
1759 sp.setHorizontalStretch(stretch);
1760 sp.setVerticalStretch(stretch);
1762}
1763
1765
1766#include "moc_qsplitter.cpp"
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qcoreevent.h:379
\inmodule QtCore\reentrant
Definition qdatastream.h:46
\inmodule QtCore
Definition qcoreevent.h:45
@ StyleChange
Definition qcoreevent.h:136
@ LayoutRequest
Definition qcoreevent.h:112
@ HoverLeave
Definition qcoreevent.h:176
@ HoverEnter
Definition qcoreevent.h:175
@ HideToParent
Definition qcoreevent.h:86
@ ShowToParent
Definition qcoreevent.h:85
Type type() const
Returns the event type.
Definition qcoreevent.h:304
The QFrame class is the base class of widgets that can have a frame.
Definition qframe.h:17
bool event(QEvent *e) override
\reimp
Definition qframe.cpp:511
void changeEvent(QEvent *) override
\reimp
Definition qframe.cpp:498
qsizetype size() const noexcept
Definition qlist.h:397
iterator insert(qsizetype i, parameter_type t)
Definition qlist.h:488
const_reference at(qsizetype i) const noexcept
Definition qlist.h:446
void move(qsizetype from, qsizetype to)
Definition qlist.h:610
void reserve(qsizetype size)
Definition qlist.h:753
void append(parameter_type t)
Definition qlist.h:458
\inmodule QtCore
Definition qmargins.h:24
\inmodule QtGui
Definition qevent.h:196
QObject * parent
Definition qobject.h:73
\inmodule QtCore
Definition qobject.h:103
Q_WEAK_OVERLOAD void setObjectName(const QString &name)
Sets the object's name to name.
Definition qobject.h:127
The QPaintEvent class contains event parameters for paint events.
Definition qevent.h:486
The QPainter class performs low-level painting on widgets and other paint devices.
Definition qpainter.h:46
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
Definition qpoint.h:404
\inmodule QtCore\reentrant
Definition qpoint.h:25
constexpr int y() const noexcept
Returns the y coordinate of this point.
Definition qpoint.h:135
\inmodule QtCore\reentrant
Definition qrect.h:30
constexpr int width() const noexcept
Returns the width of the rectangle.
Definition qrect.h:236
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
The QRubberBand class provides a rectangle or line that can indicate a selection or a boundary.
Definition qrubberband.h:18
QPointF globalPosition() const
Returns the position of the point in this event on the screen or virtual desktop.
Definition qevent.h:123
QPointF position() const
Returns the position of the point in this event, relative to the widget or item that received the eve...
Definition qevent.h:119
Qt::MouseButton button() const
Returns the button that caused the event.
Definition qevent.h:116
The QSizePolicy class is a layout attribute describing horizontal and vertical resizing policy.
Definition qsizepolicy.h:18
constexpr int horizontalStretch() const noexcept
Returns the horizontal stretch factor of the size policy.
Definition qsizepolicy.h:92
\inmodule QtCore
Definition qsize.h:25
constexpr int height() const noexcept
Returns the height.
Definition qsize.h:133
constexpr int width() const noexcept
Returns the width.
Definition qsize.h:130
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
Definition qsize.h:127
The QSplitterHandle class provides handle functionality for the splitter.
Definition qsplitter.h:98
void paintEvent(QPaintEvent *) override
\reimp
void mouseMoveEvent(QMouseEvent *) override
\reimp
bool event(QEvent *) override
\reimp
int closestLegalPosition(int p)
Returns the closest legal position to pos of the splitter handle.
void setOrientation(Qt::Orientation o)
Sets the orientation of the splitter handle to orientation.
void mousePressEvent(QMouseEvent *) override
\reimp
QSplitterHandle(Qt::Orientation o, QSplitter *parent)
Creates a QSplitter handle with the given orientation and parent.
Definition qsplitter.cpp:86
void moveSplitter(int p)
Tells the splitter to move this handle to position pos, which is the distance from the left or top ed...
void mouseReleaseEvent(QMouseEvent *) override
\reimp
void resizeEvent(QResizeEvent *) override
\reimp
bool opaqueResize() const
Returns true if widgets are resized dynamically (opaquely) while interactively moving the splitter.
~QSplitterHandle()
Destructor.
Definition qsplitter.cpp:97
QSize sizeHint() const override
\reimp
Qt::Orientation orientation() const
Returns the handle's orientation.
QSplitter * splitter() const
Returns the splitter associated with this splitter handle.
int getWidgetSize(Qt::Orientation orient)
int getHandleSize(Qt::Orientation orient)
int pick(const QSize &size, Qt::Orientation orient)
Definition qsplitter_p.h:43
QSplitterHandle * handle
Definition qsplitter_p.h:37
Qt::Orientation orient
Definition qsplitter_p.h:63
int trans(const QPoint &pos) const
Definition qsplitter_p.h:77
int pick(const QPoint &pos) const
Definition qsplitter_p.h:72
void getRange(int index, int *, int *, int *, int *) const
void recalc(bool update=false)
void doMove(bool backwards, int pos, int index, int delta, bool mayCollapse, int *positions, int *widths)
QSplitterLayoutStruct * findWidget(QWidget *) const
bool collapsible(QSplitterLayoutStruct *) const
bool shouldShowWidget(const QWidget *w) const
void addContribution(int, int *, int *, bool) const
QSplitterLayoutStruct * insertWidget(int index, QWidget *)
int adjustPos(int, int, int *, int *, int *, int *) const
QList< QSplitterLayoutStruct * > list
Definition qsplitter_p.h:62
void setSizes_helper(const QList< int > &sizes, bool clampNegativeSize=false)
void insertWidget_helper(int index, QWidget *widget, bool show)
void setGeo(QSplitterLayoutStruct *s, int pos, int size, bool allowCollapse)
int findWidgetJustBeforeOrJustAfter(int index, int delta, int &collapsibleSize) const
The QSplitter class implements a splitter widget.
Definition qsplitter.h:21
void refresh()
Updates the splitter's state.
int indexOf(QWidget *w) const
Returns the index in the splitter's layout of the specified widget, or -1 if widget is not found.
void resizeEvent(QResizeEvent *) override
\reimp
int closestLegalPosition(int, int)
Returns the closest legal position to pos of the widget at index.
int handleWidth
the width of the splitter handles
Definition qsplitter.h:26
void setStretchFactor(int index, int stretch)
Updates the size policy of the widget at position index to have a stretch factor of stretch.
void setOrientation(Qt::Orientation)
void getRange(int index, int *, int *) const
Returns the valid range of the splitter at index in {min} and *{max} if min and max are not 0.
void setCollapsible(int index, bool)
Sets whether the child widget at index is collapsible to collapse.
void setOpaqueResize(bool opaque=true)
virtual QSplitterHandle * createHandle()
Returns a new splitter handle as a child widget of this splitter.
int count() const
Returns the number of widgets contained in the splitter's layout.
QSplitter(QWidget *parent=nullptr)
Constructs a horizontal splitter with the parent argument passed on to the QFrame constructor.
QSize minimumSizeHint() const override
\reimp
bool restoreState(const QByteArray &state)
Restores the splitter's layout to the state specified.
void setChildrenCollapsible(bool)
friend class QSplitterHandle
Definition qsplitter.h:92
void changeEvent(QEvent *) override
\reimp
void setRubberBand(int position)
Displays a rubber band at position pos.
QByteArray saveState() const
Saves the state of the splitter's layout.
bool event(QEvent *) override
\reimp
void setSizes(const QList< int > &list)
Sets the child widgets' respective sizes to the values given in the list.
QSize sizeHint() const override
\reimp
void splitterMoved(int pos, int index)
This signal is emitted when the splitter handle at a particular index has been moved to position pos.
bool opaqueResize
Returns true if widgets are resized dynamically (opaquely) while interactively moving the splitter.
Definition qsplitter.h:25
QSplitterHandle * handle(int index) const
Returns the handle to the left of (or above) the item in the splitter's layout at the given index,...
bool isCollapsible(int index) const
Returns true if the widget at index is collapsible, otherwise returns false.
QWidget * replaceWidget(int index, QWidget *widget)
Qt::Orientation orientation
the orientation of the splitter
Definition qsplitter.h:24
void moveSplitter(int pos, int index)
Moves the left or top edge of the splitter handle at index as close as possible to position pos,...
void childEvent(QChildEvent *) override
\reimp
QList< int > sizes() const
Returns a list of the size parameters of all the widgets in this splitter.
QWidget * widget(int index) const
Returns the widget at the given index in the splitter's layout, or \nullptr if there is no such widge...
bool childrenCollapsible
whether child widgets can be resized down to size 0 by the user
Definition qsplitter.h:27
void insertWidget(int index, QWidget *widget)
Inserts the widget specified into the splitter's layout at the given index.
~QSplitter()
Destroys the splitter.
void addWidget(QWidget *widget)
Adds the given widget to the splitter's layout after all the other items.
void setHandleWidth(int)
The QStyleOption class stores the parameters used by QStyle functions.
QStyle::State state
QPalette palette
void initFrom(const QWidget *w)
@ State_MouseOver
Definition qstyle.h:80
@ State_Sunken
Definition qstyle.h:69
@ State_Enabled
Definition qstyle.h:67
@ State_Horizontal
Definition qstyle.h:74
@ State_None
Definition qstyle.h:66
@ CT_Splitter
Definition qstyle.h:552
virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
Returns the size of the element described by the specified option and type, based on the provided con...
@ SH_Splitter_OpaqueResize
Definition qstyle.h:686
virtual int styleHint(StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
Returns an integer representing the specified style hint for the given widget described by the provid...
@ CE_Splitter
Definition qstyle.h:208
@ PM_SplitterWidth
Definition qstyle.h:447
virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
Draws the given element with the provided painter with the style options specified by option.
virtual int pixelMetric(PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
Returns the value of the given pixel metric.
static QWidgetPrivate * get(QWidget *w)
Definition qwidget_p.h:212
void update(T t)
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
void setAttribute(Qt::WidgetAttribute, bool on=true)
Sets the attribute attribute on this widget if on is true; otherwise clears the attribute.
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qwidget.h:886
void setContentsMargins(int left, int top, int right, int bottom)
Sets the margins around the contents of the widget to have the sizes left, top, right,...
Definition qwidget.cpp:7590
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
void setMask(const QBitmap &)
Causes only the pixels of the widget for which bitmap has a corresponding 1 bit to be visible.
void setSizePolicy(QSizePolicy)
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition qwidget.h:877
QSize size
the size of the widget excluding any window frame
Definition qwidget.h:113
QRect geometry
the geometry of the widget relative to its parent and excluding the window frame
Definition qwidget.h:106
QPalette palette
the widget's palette
Definition qwidget.h:132
int width
the width of the widget excluding any window frame
Definition qwidget.h:114
QPoint pos
the position of the widget within its parent widget
Definition qwidget.h:111
QRect contentsRect() const
Returns the area inside the widget's margins.
Definition qwidget.cpp:7667
QSizePolicy sizePolicy
the default layout behavior of the widget
Definition qwidget.h:119
void hide()
Hides the widget.
Definition qwidget.cpp:8135
void show()
Shows the widget and its child widgets.
Definition qwidget.cpp:7875
void ensurePolished() const
Ensures that the widget and its children have been polished by QStyle (i.e., have a proper font and p...
bool isEnabled() const
Definition qwidget.h:814
void lower()
Lowers the widget to the bottom of the parent widget's stack.
void update()
Updates the widget unless updates are disabled or the widget is hidden.
QSize sizeHint
the recommended size for the widget
Definition qwidget.h:148
bool event(QEvent *event) override
This is the main event handler; it handles event event.
Definition qwidget.cpp:8866
QStyle * style() const
Definition qwidget.cpp:2600
virtual void resizeEvent(QResizeEvent *event)
This event handler can be reimplemented in a subclass to receive widget resize events which are passe...
Definition qwidget.cpp:9822
QWidget * parentWidget() const
Returns the parent of this widget, or \nullptr if it does not have any parent widget.
Definition qwidget.h:904
void clearMask()
Removes any mask set by setMask().
bool isVisible() const
Definition qwidget.h:874
QPointF mapFromGlobal(const QPointF &) const
Translates the global screen coordinate pos to widget coordinates.
void setCursor(const QCursor &)
Definition qwidget.cpp:4960
bool testAttribute(Qt::WidgetAttribute) const
Returns true if attribute attribute is set on this widget; otherwise returns false.
Definition qwidget.h:910
QOpenGLWidget * widget
[1]
QStyleOptionButton opt
else opt state
[0]
Combined button and popup list for selecting options.
Definition qcompare.h:63
@ LeftButton
Definition qnamespace.h:58
@ WA_Resized
Definition qnamespace.h:308
@ WA_WState_OwnSizePolicy
Definition qnamespace.h:334
@ WA_MouseNoMask
Definition qnamespace.h:338
Orientation
Definition qnamespace.h:98
@ Horizontal
Definition qnamespace.h:99
@ Vertical
Definition qnamespace.h:100
@ SplitVCursor
@ SplitHCursor
#define Q_FALLTHROUGH()
#define Q_UNLIKELY(x)
static const QCssKnownValue positions[NumKnownPositionModes - 1]
EGLStreamKHR stream
Q_WIDGETS_EXPORT QSize qSmartMinSize(const QSize &sizeHint, const QSize &minSizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy)
void qGeomCalc(QList< QLayoutStruct > &chain, int start, int count, int pos, int space, int spacer)
Q_WIDGETS_EXPORT QSize qSmartMaxSize(const QSize &sizeHint, const QSize &minSize, const QSize &maxSize, const QSizePolicy &sizePolicy, Qt::Alignment align)
#define qDebug
[1]
Definition qlogging.h:164
#define qWarning
Definition qlogging.h:166
constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:40
constexpr const T & qMax(const T &a, const T &b)
Definition qminmax.h:42
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
const GLfloat * m
GLfloat GLfloat GLfloat w
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint index
[2]
GLboolean r
[2]
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei width
const GLchar * marker
GLint first
GLfloat n
GLfloat GLfloat GLfloat GLfloat h
struct _cl_event * event
GLdouble s
[6]
Definition qopenglext.h:235
const GLubyte * c
GLuint GLsizei const GLuint const GLintptr const GLsizeiptr * sizes
GLdouble GLdouble t
Definition qopenglext.h:243
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
static const qint32 SplitterMagic
static QT_BEGIN_NAMESPACE const uint Default
Definition qsplitter_p.h:27
#define sp
#define emit
#define Q_UNUSED(x)
int qint32
Definition qtypes.h:49
#define QWIDGETSIZE_MAX
Definition qwidget.h:917
static uint nextId
view show()
[18] //! [19]
QList< int > list
[14]
QLayoutItem * child
[0]