801 #include <QtCore/qbitarray.h>
802 #include <QtCore/qpoint.h>
803 #include <QtCore/qstack.h>
804 #include <QtCore/qtimer.h>
805 #include <QtCore/qvariant.h>
806 #include <QtCore/qvarlengtharray.h>
807 #include <QtCore/qnumeric.h>
808 #include <QtWidgets/qapplication.h>
809 #include <QtGui/qbitmap.h>
810 #include <QtGui/qpainter.h>
811 #include <QtGui/qpainterpath.h>
812 #include <QtGui/qpixmapcache.h>
813 #include <QtWidgets/qstyleoption.h>
814 #include <QtGui/qevent.h>
815 #include <QtGui/qinputmethod.h>
816 #if QT_CONFIG(graphicseffect)
817 #include <QtWidgets/qgraphicseffect.h>
820 #include <private/qgraphicsitem_p.h>
821 #include <private/qgraphicswidget_p.h>
822 #include <private/qwidgettextcontrol_p.h>
823 #include <private/qtextdocumentlayout_p.h>
824 #include <private/qtextengine_p.h>
825 #include <private/qwidget_p.h>
826 #include <private/qapplication_p.h>
827 #include <private/qgesturemanager_p.h>
828 #include <private/qdebug_p.h>
832 static inline void _q_adjustRect(
QRect *
rect)
836 rect->adjust(0, 0, 1, 0);
838 rect->adjust(0, 0, 0, 1);
868 ps.setWidth(penWidthZero);
896 acceptedMouseButtons(0x1f),
898 explicitlyHidden(
false),
900 explicitlyDisabled(
false),
904 isMemberOfGroup(
false),
905 handlesChildEvents(
false),
906 itemDiscovered(
false),
910 hasBoundingRegionGranularity(
false),
913 dirtyChildren(
false),
914 localCollisionHack(
false),
915 inSetPosHelper(
false),
916 needSortChildren(
false),
917 allChildrenDirty(
false),
918 fullUpdatePending(
false),
920 paintedViewBoundingRectsNeedRepaint(
false),
921 dirtySceneTransform(
true),
922 geometryChanged(
true),
925 ignoreVisible(
false),
926 ignoreOpacity(
false),
927 acceptTouchEvents(
false),
928 acceptedTouchBeginEvent(
false),
929 filtersDescendantEvents(
false),
930 sceneTransformTranslateOnly(
false),
931 notifyBoundingRectChanged(
false),
932 notifyInvalidated(
false),
933 mouseSetsFocus(
true),
934 explicitActivate(
false),
936 holesInSiblingIndex(
false),
937 sequentialOrdering(
true),
938 updateDueToGraphicsEffect(
false),
939 scenePosDescendants(
false),
940 pendingPolish(
false),
941 mayHaveChildWithGraphicsEffect(
false),
942 isDeclarativeItem(
false),
943 sendParentChangeNotification(
false),
944 dirtyChildrenBoundingRect(
true),
945 globalStackingOrder(-1),
971 switch (
int(childFlag)) {
1024 if ((
int(childFlag) != -1 &&
int(
flags & childFlag) == childFlag)
1073 if (!qgraphicsitem_cast<QGraphicsItemGroup *>(
q)) {
1087 switch (
event->type()) {
1095 for (
int i = 0x1;
i <= 0x10;
i <<= 1) {
1137 ? qobject_cast<QGraphicsView *>(
viewport->parentWidget())
1139 if (
view ==
nullptr)
1143 return viewportTransform *
q->deviceTransform(viewportTransform).
inverted();
1238 const QVariant *thisPointerVariant)
1255 scene->d_func()->setScenePosItemEnabled(
q,
false);
1272 if (thisPointerVariant)
1279 if (
parent && !newParent) {
1280 scene->d_func()->registerTopLevelItem(
q);
1281 }
else if (!
parent && newParent) {
1282 scene->d_func()->unregisterTopLevelItem(
q);
1296 parentFocusScopeItem = fsi;
1302 p =
p->d_ptr->parent;
1311 if (newFocusScopeItem && newParent) {
1319 while (
p2 &&
p2 !=
p) {
1326 p2 =
p2->d_ptr->parent;
1329 newFocusScopeItem = ancestorScope;
1341 p =
p->d_ptr->parent;
1348 if ((
parent = newParent)) {
1358 if (thisPointerVariant)
1363 scene->d_func()->setScenePosItemEnabled(
q,
true);
1410 if (newParentVariant)
1428 rect = &childrenRect;
1429 const bool setTopMostEffectItem = !topMostEffectItem;
1434 if (setTopMostEffectItem)
1435 topMostEffectItem =
child;
1442 *
rect |=
matrix.mapRect(
child->d_ptr->effectiveBoundingRect(topMostEffectItem));
1447 *
rect |=
x->mapRect(
child->d_ptr->effectiveBoundingRect(topMostEffectItem));
1449 *
rect |=
child->d_ptr->effectiveBoundingRect(topMostEffectItem);
1457 *
rect &=
x->mapRect(
q->boundingRect());
1459 *
rect &=
q->boundingRect();
1466 const QRegion &exposedRegion,
bool allItems)
const
1472 const QRectF brect =
q->boundingRect();
1475 option->exposedRect = brect;
1481 if (!
option->styleObject)
1491 if (
scene->d_func()->hoverItems.contains(
q_ptr))
1504 for (
const QRect &exposedRect : exposedRegion) {
1506 if (
option->exposedRect.contains(brect))
1509 option->exposedRect &= brect;
1523 for (
const auto &
data : constDeviceData)
1569 p->wasDeleted =
true;
1570 if (
p->declarativeData) {
1571 p->wasDeleted =
true;
1574 p->declarativeData =
nullptr;
1575 p->wasDeleted =
false;
1582 #ifndef QT_NO_GESTURES
1599 if (
p->d_ptr->focusScopeItem ==
this)
1613 d_ptr->
scene->d_func()->removeItemHelper(
this);
1619 #if QT_CONFIG(graphicseffect)
1632 dataStore->data.remove(
this);
1679 group->addToGroup(
this);
1735 while (
p && !
p->isWidget())
1736 p =
p->parentItem();
1768 if (
p &&
p->isWindow())
1827 if (newParent ==
this) {
1828 qWarning(
"QGraphicsItem::setParentItem: cannot assign %p as a parent of itself",
this);
1835 QVariant::fromValue<QGraphicsItem *>(newParent)));
1836 newParent = qvariant_cast<QGraphicsItem *>(newParentVariant);
1840 const QVariant thisPointerVariant(QVariant::fromValue<QGraphicsItem *>(
this));
1954 GraphicsItemFlags oldFlags = GraphicsItemFlags(
d_ptr->
flags);
2013 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
2019 d_ptr->
scene->d_func()->updateInputMethodSensitivityInViews();
2037 if (!
w->isAncestorOf(test) || test ==
w)
2046 beforeMe->d_func()->focusNext = afterMe;
2047 afterMe->d_func()->focusPrev = beforeMe;
2048 focusFirst->d_func()->focusPrev = focusLast;
2049 focusLast->d_func()->focusNext = focusFirst;
2051 focusFirst->d_func()->focusNext =
w;
2056 beforeMe->d_func()->focusNext =
w;
2057 afterMe->d_func()->focusPrev = focusLast;
2058 w->d_func()->focusPrev = beforeMe;
2059 focusLast->d_func()->focusNext = afterMe;
2067 d_ptr->
scene->d_func()->registerScenePosItem(
this);
2069 d_ptr->
scene->d_func()->unregisterScenePosItem(
this);
2144 if (lastMode ==
mode &&
cache->fixedSize == logicalCacheSize)
2145 noVisualChange =
true;
2146 cache->fixedSize = logicalCacheSize;
2149 if (!noVisualChange)
2181 d_ptr->
scene->d_func()->enterModal(
this, previousModality);
2203 blockingPanel = &
dummy;
2217 if (modalPanel !=
this && !modalPanel->
isAncestorOf(
this)) {
2218 *blockingPanel = modalPanel;
2223 if (modalPanel !=
this
2226 *blockingPanel = modalPanel;
2234 #if QT_CONFIG(tooltip)
2241 QString QGraphicsItem::toolTip()
const
2260 #ifndef QT_NO_CURSOR
2302 d_ptr->
scene->d_func()->allItemsUseDefaultCursor =
false;
2305 view->viewport()->setMouseTracking(
true);
2307 if (
view->underMouse()) {
2312 const auto itemsUnderCursor =
view->items(viewPoint);
2314 if (itemUnderCursor->hasCursor()) {
2399 if (
p->d_ptr->explicitlyHidden)
2401 }
while ((
p =
p->d_ptr->parent));
2402 return parent ==
nullptr;
2412 bool update,
bool hiddenByPanel)
2431 newVisible = newVisibleVariant.
toBool();
2442 #if QT_CONFIG(graphicseffect)
2443 invalidateParentGraphicsEffectsRecursively();
2453 if (
scene->d_func()->mouseGrabberItems.contains(
q))
2455 if (
scene->d_func()->keyboardGrabberItems.contains(
q))
2456 q->ungrabKeyboard();
2460 if (hasFocus &&
scene) {
2466 if (focusItem ==
q_ptr) {
2497 if (!newVisible || !
child->d_ptr->explicitlyHidden)
2498 child->d_ptr->setVisibleHelper(newVisible,
false, updateChildren, hiddenByPanel);
2502 if (
scene &&
q->isPanel()) {
2530 p =
p->d_ptr->parent;
2548 if (
p->d_ptr->visible) {
2554 p =
p->d_ptr->parent;
2665 if (focusItem ==
q_ptr) {
2689 if (!newEnabled || !
child->d_ptr->explicitlyDisabled)
2690 child->d_ptr->setEnabledHelper(newEnabled,
false);
2745 return group->isSelected();
2776 group->setSelected(selected);
2785 bool newSelected = newSelectedVariant.
toBool();
2893 #if QT_CONFIG(graphicseffect)
2894 d_ptr->invalidateParentGraphicsEffectsRecursively();
2896 d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
2902 if (wasFullyTransparent)
2915 #if QT_CONFIG(graphicseffect)
2961 #if QT_CONFIG(graphicseffect)
2984 #if QT_CONFIG(graphicseffect)
2996 sceneEffectRect |=
view->d_func()->mapRectToScene(deviceEffectRect);
2998 return q->mapRectFromScene(sceneEffectRect);
3016 #if QT_CONFIG(graphicseffect)
3021 || topMostEffectItem ==
q)
3025 while (effectParent) {
3028 const QRectF brectInParentSpace =
q->mapRectToItem(effectParent, brect);
3034 || topMostEffectItem == effectParent) {
3071 }
while ((parentItem = itemd->
parent));
3137 &&
d_ptr->
scene->d_func()->lastMouseGrabberItemHasImplicitMouseGrab) {
3196 d_ptr->
scene->d_func()->allItemsIgnoreHoverEvents =
false;
3197 d_ptr->
scene->d_func()->enableMouseTrackingOnViews();
3226 d_ptr->
scene->d_func()->allItemsIgnoreTouchEvents =
false;
3227 d_ptr->
scene->d_func()->enableTouchEventsOnViews();
3364 if (!activePanel || activePanel == thisPanel) {
3370 if (!nextToActivate)
3371 nextToActivate =
d_ptr->
scene->d_func()->lastActivePanel;
3372 if (nextToActivate ==
this ||
isAncestorOf(nextToActivate))
3373 nextToActivate =
nullptr;
3436 while (
f->d_ptr->focusProxy)
3449 if (oldFocusScopeItem)
3452 if (!
p->focusItem() && !focusFromHide) {
3461 p =
p->d_ptr->parent;
3465 while (
f->d_ptr->focusScopeItem &&
f->d_ptr->focusScopeItem->isVisible())
3466 f =
f->d_ptr->focusScopeItem;
3476 f->d_ptr->setSubFocus(
f, commonAncestor);
3483 scene->d_func()->setFocusItemHelper(
f, focusReason);
3516 if (giveFocusToParent) {
3522 if (
p->d_ptr->focusScopeItem ==
q_ptr) {
3532 p =
p->d_ptr->parent;
3539 if (!hiddenByParentPanel)
3584 qWarning(
"QGraphicsItem::setFocusProxy: cannot assign self as focus proxy");
3589 qWarning(
"QGraphicsItem::setFocusProxy: focus proxy must be in same scene");
3594 qWarning(
"QGraphicsItem::setFocusProxy: %p is already in the focus proxy chain",
item);
3669 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse without scene");
3673 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse while invisible");
3688 qWarning(
"QGraphicsItem::ungrabMouse: cannot ungrab mouse without scene");
3731 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard without scene");
3735 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard while invisible");
3750 qWarning(
"QGraphicsItem::ungrabKeyboard: cannot ungrab keyboard without scene");
3753 d_ptr->
scene->d_func()->ungrabKeyboard(
this);
3849 q->prepareGeometryChange();
3855 if (
pos.
x() != oldPos.
x())
3857 if (
pos.
y() != oldPos.
y())
3897 static_cast<QGraphicsWidget *
>(
this)->d_func()->setGeometryFromSetPos();
3956 view->ensureVisible(sceneRect, xmargin, ymargin);
4032 newRotation = newRotationVariant.
toReal();
4098 newScale = newScaleVariant.
toReal();
4188 t->d_func()->setItem(
q);
4205 t->d_func()->setItem(
q);
4242 QVariant::fromValue<QPointF>(origin)));
4243 newOrigin = newOriginVariant.
toPointF();
4336 parents.
prepend(untransformedAncestor);
4337 untransformedAncestor = untransformedAncestor->
parentItem();
4340 if (!untransformedAncestor) {
4342 Q_ASSERT_X(untransformedAncestor,
"QGraphicsItem::deviceTransform",
4343 "Invalid object structure!");
4352 if (parentOfUntransformedAncestor)
4353 inheritedMatrix = parentOfUntransformedAncestor->
sceneTransform();
4354 QPointF mappedPoint = (inheritedMatrix * viewportTransform).
map(untransformedAncestor->
pos());
4362 for (
int i = 0;
i < parents.
size(); ++
i) {
4390 if (
other ==
nullptr) {
4391 qWarning(
"QGraphicsItem::itemTransform: null pointer passed");
4394 if (
other ==
this) {
4413 if (otherParent ==
this) {
4415 if (
other->d_ptr->transformData) {
4417 other->d_ptr->combineTransformFromParent(&otherToParent);
4426 if (
parent == otherParent) {
4431 QPointF delta = itemPos - otherPos;
4440 other->d_ptr->combineTransformFromParent(&otherToParent);
4441 return itemToParent * otherToParent.
inverted(
ok);
4447 if (!commonAncestor) {
4449 other->d_ptr->ensureSceneTransform();
4455 bool cousins =
other != commonAncestor &&
this != commonAncestor;
4461 otherToScene =
other->itemTransform(commonAncestor, &good);
4467 return thisToScene * otherToScene.
inverted(
ok);
4478 p->d_ptr.data()->combineTransformToParent(&
x);
4479 }
while ((
p =
p->d_ptr->parent) &&
p != root);
4481 return x.inverted(
ok);
4527 QVariant::fromValue<QTransform>(newTransform)));
4528 newTransform = qvariant_cast<QTransform>(newTransformVariant);
4618 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
4666 if (
q->isAncestorOf(
item))
4691 if (sibling ==
this)
4694 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
4701 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
4710 d_ptr->
scene->d_func()->ensureSequentialTopLevelSiblingIndexes();
4715 if (myIndex >= siblingIndex) {
4716 siblings->
move(myIndex, siblingIndex);
4718 for (
int i = 0;
i < siblings->
size(); ++
i) {
4720 if (
i != siblingIndex &&
index >= siblingIndex &&
index <= myIndex)
4724 for (
int i = 0;
i < siblings->
size(); ++
i) {
4726 if (
i != siblingIndex &&
index >= siblingIndex &&
index <= myIndex)
4898 if (thisBoundingRect.
isEmpty())
4903 clip.
addRect(thisBoundingRect);
4924 if (lastParent !=
this) {
4993 if (clips || otherClips) {
4996 closestClipper = closestClipper->
parentItem();
4999 otherClosestClipper = otherClosestClipper->
parentItem();
5000 if (closestClipper == otherClosestClipper) {
5028 if (
path.isEmpty()) {
5034 _q_adjustRect(&rectA);
5036 _q_adjustRect(&rectB);
5057 return path.intersects(thisShape);
5058 return path.contains(thisShape);
5117 if (qt_QGraphicsItem_isObscured(
this,
item, testRect))
5206 if (granularity == 0.0)
5221 p.scale(granularity, granularity);
5223 p.translate(pad, pad);
5224 p.setWorldTransform(itemToDeviceTransform,
true);
5284 if (granularity < 0.0 || granularity > 1.0) {
5285 qWarning(
"QGraphicsItem::setBoundingRegionGranularity: invalid granularity %g", granularity);
5288 if (granularity == 0.0) {
5295 QVariant::fromValue<qreal>(granularity));
5347 bool ignoreOpacity)
const
5371 #if QT_CONFIG(graphicseffect)
5372 void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()
5385 void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::InvalidateReason reason)
5399 childPrivate->invalidateChildGraphicsEffectsRecursively(reason);
5470 child->d_ptr->siblingIndex = -1;
5515 for (
int i = 0;
i <
scene->d_func()->views.size(); ++
i) {
5522 if (updateChildren) {
5538 *topMostDirtyItem =
q_ptr;
5543 if (*topMostDirtyItem ==
q_ptr) {
5546 *topMostDirtyItem =
nullptr;
5547 }
else if (*topMostDirtyItem) {
5680 if (
rect.isEmpty() && !
rect.isNull())
5684 #if QT_CONFIG(graphicseffect)
5685 d_ptr->invalidateParentGraphicsEffectsRecursively();
5691 if (!
cache->allExposed) {
5692 if (
rect.isNull()) {
5693 cache->allExposed =
true;
5694 cache->exposed.clear();
5738 if (dx == 0.0 && dy == 0.0)
5763 if (
cache->allExposed ||
cache->fixedSize.isValid()) {
5790 for (
int i = 0;
i <
cache->exposed.size(); ++
i) {
5792 if (!
rect.isNull() && !
e.intersects(
rect))
5794 e.translate(dx, dy);
5800 for (
const QRect &exposedRect : exposed)
5801 cache->exposed += exposedRect;
5805 d->scene->d_func()->markDirty(
this,
rect);
6443 if (ancestor ==
this)
6466 int otherDepth =
other->d_ptr->depth();
6467 while (thisDepth > otherDepth) {
6471 while (otherDepth > thisDepth) {
6475 while (thisw && thisw != otherw) {
6496 const auto views =
d->scene->views();
6536 qt_dataStore()->data[
this][
key] =
value;
6598 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed"
6599 " on items in a scene.");
6603 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed"
6604 " on items in the same scene.");
6607 d_ptr->
scene->d_func()->installSceneEventFilter(
this, filterItem);
6619 d_ptr->
scene->d_func()->removeSceneEventFilter(
this, filterItem);
6692 switch (
event->type()) {
6774 if (
child->isVisible() && !
child->isPanel()) {
6838 if (
d->isProxyWidget())
6862 if (
d->isProxyWidget())
6889 if (
d->isProxyWidget())
6911 if (
d->isProxyWidget())
7057 ++
scene->d_func()->selectionChanging;
7059 --
scene->d_func()->selectionChanging;
7072 if (!
w->rect().contains(
event->pos()))
7119 initialPositions =
d_ptr->
scene->d_func()->movingItemsInitialPositions;
7120 if (initialPositions.
isEmpty()) {
7123 initialPositions[
this] =
pos();
7125 d_ptr->
scene->d_func()->movingItemsInitialPositions = initialPositions;
7130 if (
event->widget())
7131 view = qobject_cast<QGraphicsView *>(
event->widget()->parentWidget());
7135 bool movedMe =
false;
7136 while (
i <= selectedItems.
size()) {
7138 if (
i < selectedItems.
size())
7173 currentParentPos = viewToParentTransform.
map(
QPointF(
view->mapFromGlobal(
event->screenPos())));
7222 bool selectionChanged =
false;
7224 ++
scene->d_func()->selectionChanging;
7232 selectionChanged =
true;
7240 --
scene->d_func()->selectionChanging;
7241 if (selectionChanged)
7360 d->scene->d_func()->updateInputMethodSensitivityInViews();
7495 d_ptr->
scene->d_func()->dirtyGrowingItemsBoundingRect =
true;
7563 const qreal pad = itemPenWidth / 2;
7565 const qreal penWidth = 0;
7567 const QColor fgcolor =
option->palette.windowText().color();
7569 fgcolor.
red() > 127 ? 0 : 255,
7570 fgcolor.
green() > 127 ? 0 : 255,
7571 fgcolor.
blue() > 127 ? 0 : 255);
7631 QGraphicsObject::~QGraphicsObject()
7650 #ifndef QT_NO_GESTURES
7703 return d->children.count();
7710 return d->children.at(
index)->toGraphicsObject();
7718 int childCount =
d->children.count();
7719 if (
d->sendParentChangeNotification) {
7721 d->children.at(0)->setParentItem(
nullptr);
8153 if (
d->brush.isOpaque())
8200 if (!
path.isEmpty())
8242 if (
d->path ==
path)
8256 if (
d->boundingRect.isNull()) {
8259 d->boundingRect =
d->path.controlPointRect();
8264 return d->boundingRect;
8273 return qt_graphicsItem_shapeFromPath(
d->path,
d->pen);
8459 if (
d->rect ==
rect)
8486 if (
d->boundingRect.isNull()) {
8488 d->boundingRect =
d->rect;
8490 d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw);
8492 return d->boundingRect;
8502 path.addRect(
d->rect);
8503 return qt_graphicsItem_shapeFromPath(
path,
d->pen);
8697 if (
d->rect ==
rect)
8715 return d->startAngle;
8728 if (
angle !=
d->startAngle) {
8747 return d->spanAngle;
8761 if (
angle !=
d->spanAngle) {
8775 if (
d->boundingRect.isNull()) {
8777 if (pw == 0.0 &&
d->spanAngle == 360 * 16)
8778 d->boundingRect =
d->rect;
8782 return d->boundingRect;
8792 if (
d->rect.isNull())
8794 if (
d->spanAngle != 360 * 16) {
8795 path.moveTo(
d->rect.center());
8796 path.arcTo(
d->rect,
d->startAngle / 16.0,
d->spanAngle / 16.0);
8798 path.addEllipse(
d->rect);
8801 return qt_graphicsItem_shapeFromPath(
path,
d->pen);
8822 if ((
d->spanAngle != 0) && (
qAbs(
d->spanAngle) % (360 * 16) == 0))
8999 if (
rule !=
d->fillRule) {
9011 if (
d->boundingRect.isNull()) {
9014 d->boundingRect =
d->polygon.boundingRect();
9018 return d->boundingRect;
9028 path.addPolygon(
d->polygon);
9029 return qt_graphicsItem_shapeFromPath(
path,
d->pen);
9230 if (
d->line ==
line)
9253 if (
d->pen.widthF() == 0.0) {
9277 path.moveTo(
d->line.p1());
9278 path.lineTo(
d->line.p2());
9279 return qt_graphicsItem_shapeFromPath(
path,
d->pen);
9434 if (!
mask.isNull()) {
9444 #ifndef QT_NO_IMAGE_HEURISTIC_MASK
9494 d->hasShape =
false;
9520 return d->transformationMode;
9537 if (
mode !=
d->transformationMode) {
9538 d->transformationMode =
mode;
9568 d->hasShape =
false;
9585 if (
d->pixmap.isNull())
9589 return QRectF(
d->offset,
d->pixmap.deviceIndependentSize()).
adjusted(-pw/2, -pw/2, pw/2, pw/2);
9591 return QRectF(
d->offset,
d->pixmap.deviceIndependentSize());
9606 return d_func()->shape;
9667 return d_func()->shapeMode;
9679 if (
d->shapeMode ==
mode)
9681 d->shapeMode =
mode;
9682 d->hasShape =
false;
9791 if (!
text.isEmpty())
9829 #ifndef QT_NO_TEXTHTMLPARSER
10079 switch (
event->type()) {
10125 }
else if (
event->buttons() ==
event->button()
10132 if (!
event->isAccepted())
10161 && !
event->buttons()) {
10317 if (
v.userType() == QMetaType::QRectF)
10319 else if (
v.userType() == QMetaType::QPointF)
10321 else if (
v.userType() == QMetaType::QRect)
10323 else if (
v.userType() == QMetaType::QPoint)
10361 if (
rect.isValid()) {
10401 [dd = that->dd](
const QRectF &
rect) { dd->_q_update(rect); });
10403 [dd = that->dd](
QSizeF size) { dd->_q_updateBoundingRect(size); });
10405 [dd = that->dd](
const QRectF &
rect) { dd->_q_ensureVisible(rect); });
10412 if (pgSize.
height() != -1) {
10438 -
format.bottomMargin()));
10440 return path.subtracted(docPath).contains(
event->pos());
10588 layout->setCacheEnabled(
true);
10590 while (
layout->createLine().isValid())
10593 qreal maxWidth = 0;
10595 for (
int i = 0;
i <
layout->lineCount(); ++
i) {
10597 maxWidth = qMax(maxWidth,
line.naturalTextWidth());
10599 y +=
line.height();
10601 return QRectF(0, 0, maxWidth,
y);
10615 br = setupTextLayout(&
layout);
10618 q->prepareGeometryChange();
10698 if (
d->text ==
text)
10701 d->updateBoundingRect();
10721 d->updateBoundingRect();
10739 return d->boundingRect;
10749 path.addRect(
d->boundingRect);
10759 return d->boundingRect.contains(point);
10778 p.setBrush(
d->brush);
10786 range.format.setTextOutline(
d->pen);
10790 setupTextLayout(&
layout);
10943 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add null item");
10946 if (
item ==
this) {
10947 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add a group to itself");
10956 qWarning(
"QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates");
10972 for (
int i = 0;
i < transformList.
size(); ++
i)
10974 newItemTransform *=
m.toTransform().
inverted();
10975 newItemTransform.
translate(origin.
x(), origin.
y());
10978 newItemTransform.
translate(-origin.
x(), -origin.
y());
10983 item->d_func()->setIsMemberOfGroup(
true);
11001 qWarning(
"QGraphicsItemGroup::removeFromGroup: cannot remove null item");
11028 for (
int i = 0;
i < transformList.
size(); ++
i)
11039 item->d_func()->setIsMemberOfGroup(
item->
group() !=
nullptr);
11054 return d->itemsBoundingRect;
11095 #if QT_CONFIG(graphicseffect)
11099 if (!
info && deviceCoordinates) {
11101 qWarning(
"QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");
11109 if (deviceCoordinates) {
11120 qWarning(
"QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw");
11128 info->widget,
info->opacity,
info->effectTransform,
info->wasDirtySceneTransform,
11131 QTransform effectTransform =
info->painter->worldTransform().inverted();
11134 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11150 effectRectF =
item->graphicsEffect()->boundingRectFor(
deviceRect);
11152 *unpadded = (effectRectF.
size() == sourceRect.
size());
11154 effectRectF =
info->painter->worldTransform().inverted().mapRect(effectRectF);
11157 effectRectF =
item->graphicsEffect()->boundingRectFor(sourceRect);
11161 effectRectF = sourceRect.
adjusted(-1.5, -1.5, 1.5, 1.5);
11163 effectRectF = sourceRect;
11168 return effectRectF;
11175 if (!
info && deviceCoordinates) {
11177 qWarning(
"QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
11185 const QRectF sourceRect = boundingRect(system);
11186 QRectF effectRectF = paddedEffectRect(system,
mode, sourceRect, &unpadded);
11192 bool untransformed = !deviceCoordinates
11194 if (untransformed && unpadded && isPixmap()) {
11196 *
offset = boundingRect(system).topLeft().toPoint();
11203 const auto dpr =
info ?
info->painter->device()->devicePixelRatio() : 1.0;
11205 pixmap.setDevicePixelRatio(dpr);
11211 if (deviceCoordinates &&
info->effectTransform)
11212 effectTransform *= *
info->effectTransform;
11218 newEffectTransform *= effectTransform;
11220 &newEffectTransform,
false,
true);
11221 }
else if (deviceCoordinates) {
11223 scened->
draw(
item, &pixmapPainter,
info->viewTransform,
info->transformPtr,
nullptr,
11224 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11229 newEffectTransform *= effectTransform;
11230 scened->
draw(
item, &pixmapPainter,
info->viewTransform,
info->transformPtr,
nullptr,
11231 info->widget,
info->opacity, &newEffectTransform,
info->wasDirtySceneTransform,
11235 pixmapPainter.end();
11241 #ifndef QT_NO_DEBUG_STREAM
11245 debug <<
", parent=" <<
static_cast<const void *
>(
parent);
11260 debug <<
"QGraphicsItem(0)";
11265 debug <<
o->metaObject()->className();
11267 debug <<
"QGraphicsItem";
11268 debug << '(' << static_cast<const void *>(
item);
11270 debug <<
", widget=";
11271 if (
const QWidget *
w = pw->widget()) {
11272 debug <<
w->metaObject()->className() <<
'(' <<
static_cast<const void *
>(
w);
11273 if (!
w->objectName().isEmpty())
11274 debug <<
", name=" <<
w->objectName();
11277 debug <<
"QWidget(0)";
11291 debug <<
"QGraphicsObject(0)";
11295 debug <<
item->metaObject()->className() <<
'(' <<
static_cast<const void *
>(
item);
11296 if (!
item->objectName().isEmpty())
11297 debug <<
", name=" <<
item->objectName();
11305 const char *
str =
"UnknownChange";
11308 str =
"ItemChildAddedChange";
11311 str =
"ItemChildRemovedChange";
11314 str =
"ItemCursorChange";
11317 str =
"ItemCursorHasChanged";
11320 str =
"ItemEnabledChange";
11323 str =
"ItemEnabledHasChanged";
11326 str =
"ItemFlagsChange";
11329 str =
"ItemFlagsHaveChanged";
11332 str =
"ItemParentChange";
11335 str =
"ItemParentHasChanged";
11338 str =
"ItemPositionChange";
11341 str =
"ItemPositionHasChanged";
11344 str =
"ItemSceneChange";
11347 str =
"ItemSceneHasChanged";
11350 str =
"ItemSelectedChange";
11353 str =
"ItemSelectedHasChanged";
11356 str =
"ItemToolTipChange";
11359 str =
"ItemToolTipHasChanged";
11362 str =
"ItemTransformChange";
11365 str =
"ItemTransformHasChanged";
11368 str =
"ItemVisibleChange";
11371 str =
"ItemVisibleHasChanged";
11374 str =
"ItemZValueChange";
11377 str =
"ItemZValueHasChanged";
11380 str =
"ItemOpacityChange";
11383 str =
"ItemOpacityHasChanged";
11386 str =
"ItemScenePositionHasChanged";
11389 str =
"ItemRotationChange";
11392 str =
"ItemRotationHasChanged";
11395 str =
"ItemScaleChange";
11398 str =
"ItemScaleHasChanged";
11401 str =
"ItemTransformOriginPointChange";
11404 str =
"ItemTransformOriginPointHasChanged";
11413 const char *
str =
"UnknownFlag";
11416 str =
"ItemIsMovable";
11419 str =
"ItemIsSelectable";
11422 str =
"ItemIsFocusable";
11425 str =
"ItemClipsToShape";
11428 str =
"ItemClipsChildrenToShape";
11431 str =
"ItemIgnoresTransformations";
11434 str =
"ItemIgnoresParentOpacity";
11437 str =
"ItemDoesntPropagateOpacityToChildren";
11440 str =
"ItemStacksBehindParent";
11443 str =
"ItemUsesExtendedStyleOption";
11446 str =
"ItemHasNoContents";
11449 str =
"ItemSendsGeometryChanges";
11452 str =
"ItemAcceptsInputMethod";
11455 str =
"ItemNegativeZStacksBehindParent";
11458 str =
"ItemIsPanel";
11461 str =
"ItemIsFocusScope";
11464 str =
"ItemSendsScenePositionChanges";
11467 str =
"ItemStopsClickFocusPropagation";
11470 str =
"ItemStopsFocusHandling";
11473 str =
"ItemContainsChildrenInShape";
11484 for (
int i = 0;
i < 17; ++
i) {
11500 #include "moc_qgraphicsitem.cpp"
small capitals from c petite p scientific i
[1]
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
The QAbstractGraphicsShapeItem class provides a common base for all path items.
void setPen(const QPen &pen)
bool isObscuredBy(const QGraphicsItem *item) const override
void setBrush(const QBrush &brush)
QPainterPath opaqueArea() const override
QAbstractGraphicsShapeItem(QGraphicsItem *parent=nullptr)
~QAbstractGraphicsShapeItem()
static QWidget * focusWidget()
The QBitmap class provides monochrome (1-bit depth) pixmaps.
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
The QBrush class defines the fill pattern of shapes drawn by QPainter.
The QColor class provides colors based on RGB, HSV or CMYK values.
int blue() const noexcept
int green() const noexcept
The QCursor class provides a mouse cursor with an arbitrary shape.
operator<<(QDataStream &ds, qfloat16 f)
The QDebug class provides an output stream for debugging information.
Convenience class for custom QDebug operators.
The QEvent class is the base class of all event classes. Event objects contain event parameters.
@ GraphicsSceneContextMenu
@ GraphicsSceneMouseRelease
@ GraphicsSceneMousePress
@ GraphicsSceneHoverLeave
@ GraphicsSceneMouseDoubleClick
@ GraphicsSceneHoverEnter
The QFocusEvent class contains event parameters for widget focus events. \inmodule QtGui.
The QFont class specifies a query for a font used for drawing text.
static QGestureManager * instance(InstanceCreation ic=ForceCreation)
The QGraphicsEffect class is the base class for all graphics effects.
@ PadToEffectiveBoundingRect
QGraphicsEffectSource * source() const
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QRectF boundingRect() const override
QGraphicsEllipseItem(QGraphicsItem *parent=nullptr)
QPainterPath opaqueArea() const override
void setExtension(Extension extension, const QVariant &variant) override
QVariant extension(const QVariant &variant) const override
bool supportsExtension(Extension extension) const override
bool contains(const QPointF &point) const override
void setStartAngle(int angle)
void setSpanAngle(int angle)
bool isObscuredBy(const QGraphicsItem *item) const override
void setRect(const QRectF &rect)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
QPainterPath shape() const override
int type() const override
QGraphicsEllipseItemPrivate()
QHash< QPaintDevice *, DeviceData > deviceData
QHash< const QGraphicsItem *, QMap< int, QVariant > > data
The QGraphicsItemGroup class provides a container that treats a group of items as a single item.
bool isObscuredBy(const QGraphicsItem *item) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
QPainterPath opaqueArea() const override
QRectF boundingRect() const override
int type() const override
void addToGroup(QGraphicsItem *item)
void removeFromGroup(QGraphicsItem *item)
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
virtual bool contains(const QPointF &point) const
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
virtual QVariant extension(const QVariant &variant) const
QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const
QTransform deviceTransform(const QTransform &viewportTransform) const
QTransform itemTransform(const QGraphicsItem *other, bool *ok=nullptr) const
@ ItemTransformOriginPointChange
@ ItemTransformOriginPointHasChanged
@ ItemTransformHasChanged
@ ItemScenePositionHasChanged
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
void setSelected(bool selected)
QGraphicsWidget * topLevelWidget() const
void setData(int key, const QVariant &value)
QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const
QScopedPointer< QGraphicsItemPrivate > d_ptr
void ensureVisible(const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
void setScale(qreal scale)
void update(const QRectF &rect=QRectF())
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
void setTransformOriginPoint(const QPointF &origin)
QPainterPath clipPath() const
bool isObscured(const QRectF &rect=QRectF()) const
bool handlesChildEvents() const
QGraphicsWidget * parentWidget() const
void setTransform(const QTransform &matrix, bool combine=false)
void setRotation(qreal angle)
virtual void dropEvent(QGraphicsSceneDragDropEvent *event)
void setOpacity(qreal opacity)
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
qreal boundingRegionGranularity() const
friend class QGraphicsObject
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)=0
void setPanelModality(PanelModality panelModality)
QGraphicsScene * scene() const
void setAcceptHoverEvents(bool enabled)
virtual void setExtension(Extension extension, const QVariant &variant)
void setGroup(QGraphicsItemGroup *group)
QList< QGraphicsItem * > childItems() const
void installSceneEventFilter(QGraphicsItem *filterItem)
CacheMode cacheMode() const
virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
virtual QPainterPath shape() const
@ ItemDoesntPropagateOpacityToChildren
@ ItemIgnoresTransformations
@ ItemClipsChildrenToShape
@ ItemContainsChildrenInShape
@ ItemNegativeZStacksBehindParent
@ ItemSendsScenePositionChanges
@ ItemIgnoresParentOpacity
@ ItemStopsClickFocusPropagation
@ ItemUsesExtendedStyleOption
@ ItemSendsGeometryChanges
void setFiltersChildEvents(bool enabled)
virtual void focusInEvent(QFocusEvent *event)
void stackBefore(const QGraphicsItem *sibling)
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
QGraphicsWidget * window() const
QRectF sceneBoundingRect() const
virtual QRectF boundingRect() const =0
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
void setPos(const QPointF &pos)
bool isBlockedByModalPanel(QGraphicsItem **blockingPanel=nullptr) const
friend class QGraphicsItemEffectSourcePrivate
bool acceptHoverEvents() const
QGraphicsObject * toGraphicsObject()
QRectF mapRectToParent(const QRectF &rect) const
virtual void focusOutEvent(QFocusEvent *event)
QGraphicsItem * focusProxy() const
virtual void advance(int phase)
bool isUnderMouse() const
QGraphicsItemGroup * group() const
friend class QGraphicsItemGroup
void setHandlesChildEvents(bool enabled)
void setParentItem(QGraphicsItem *parent)
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
QGraphicsItem * topLevelItem() const
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
QPointF mapToScene(const QPointF &point) const
QGraphicsItem * focusScopeItem() const
virtual void keyPressEvent(QKeyEvent *event)
QRectF childrenBoundingRect() const
QPointF transformOriginPoint() const
void prepareGeometryChange()
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Qt::MouseButtons acceptedMouseButtons() const
void setFocusProxy(QGraphicsItem *item)
void setFlags(GraphicsItemFlags flags)
void setEnabled(bool enabled)
void setCacheMode(CacheMode mode, const QSize &cacheSize=QSize())
QVariant data(int key) const
QList< QGraphicsTransform * > transformations() const
void setFlag(GraphicsItemFlag flag, bool enabled=true)
QRectF mapRectToScene(const QRectF &rect) const
qreal effectiveOpacity() const
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
void scroll(qreal dx, qreal dy, const QRectF &rect=QRectF())
QGraphicsObject * parentObject() const
void setAcceptDrops(bool on)
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
void setActive(bool active)
virtual void inputMethodEvent(QInputMethodEvent *event)
QGraphicsItem * panel() const
QPointF mapToParent(const QPointF &point) const
bool filtersChildEvents() const
QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
virtual bool isObscuredBy(const QGraphicsItem *item) const
QGraphicsItem * parentItem() const
friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *)
QRectF mapRectFromScene(const QRectF &rect) const
QTransform sceneTransform() const
QRegion boundingRegion(const QTransform &itemToDeviceTransform) const
Qt::InputMethodHints inputMethodHints() const
void removeSceneEventFilter(QGraphicsItem *filterItem)
void setVisible(bool visible)
QPointF mapFromParent(const QPointF &point) const
void setBoundingRegionGranularity(qreal granularity)
QGraphicsItem * commonAncestorItem(const QGraphicsItem *other) const
QRectF mapRectFromParent(const QRectF &rect) const
virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
void setInputMethodHints(Qt::InputMethodHints hints)
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
void setTransformations(const QList< QGraphicsTransform * > &transformations)
void setAcceptTouchEvents(bool enabled)
QGraphicsItem * focusItem() const
QGraphicsItem(QGraphicsItem *parent=nullptr)
QList< QGraphicsItem * > collidingItems(Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
QTransform transform() const
virtual void keyReleaseEvent(QKeyEvent *event)
PanelModality panelModality() const
virtual bool supportsExtension(Extension extension) const
bool isVisibleTo(const QGraphicsItem *parent) const
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
virtual QPainterPath opaqueArea() const
void setCursor(const QCursor &cursor)
GraphicsItemFlags flags() const
virtual bool sceneEvent(QEvent *event)
bool acceptTouchEvents() const
QPointF mapFromScene(const QPointF &point) const
bool isAncestorOf(const QGraphicsItem *child) const
quint32 localCollisionHack
virtual ~QGraphicsItemPrivate()
bool isOpacityNull() const
void updateChildWithGraphicsEffectFlagRecursively()
void sendScenePosChange()
QGraphicsItem * subFocusItem
void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide)
void invalidateChildrenSceneTransform()
virtual void setPosHelper(const QPointF &pos)
QVariant extra(Extra type) const
quint32 dirtySceneTransform
static bool insertionOrder(QGraphicsItem *a, QGraphicsItem *b)
void invalidateDepthRecursively()
QList< QGraphicsItem ** > focusProxyRefs
static void children_append(QDeclarativeListProperty< QGraphicsObject > *list, QGraphicsObject *item)
QTransform transformToParent() const
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
virtual void focusScopeItemChange(bool isSubFocusItem)
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, const QRegion &exposedRegion, bool allItems=false) const
QGraphicsEffect * graphicsEffect
@ ExtraBoundingRegionGranularity
QGraphicsItem * focusProxy
virtual qreal height() const
void markParentDirty(bool updateBoundingRect=false)
QGraphicsItem * focusScopeItem
void setEnabledHelper(bool newEnabled, bool explicitly, bool update=true)
void setSubFocus(QGraphicsItem *rootItem=nullptr, QGraphicsItem *stopItem=nullptr)
quint32 explicitlyDisabled
void combineTransformToParent(QTransform *x, const QTransform *viewTransform=nullptr) const
quint32 notifyInvalidated
virtual qreal width() const
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
bool itemIsUntransformable() const
quint32 filtersDescendantEvents
quint32 mayHaveChildWithGraphicsEffect
quint32 acceptedMouseButtons
quint32 dirtyChildrenBoundingRect
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, AncestorFlag flag=NoFlag, bool enabled=false, bool root=true)
bool discardUpdateRequest(bool ignoreVisibleBit=false, bool ignoreDirtyBit=false, bool ignoreOpacity=false) const
void combineTransformFromParent(QTransform *x, const QTransform *viewTransform=nullptr) const
void setExtra(Extra type, const QVariant &value)
virtual void resetWidth()
QGraphicsItem::PanelModality panelModality
void updateAncestorFlags()
virtual void transformChanged()
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
bool childrenCombineOpacity() const
void appendGraphicsTransform(QGraphicsTransform *t)
void clearSubFocus(QGraphicsItem *rootItem=nullptr, QGraphicsItem *stopItem=nullptr)
void ensureSceneTransform()
void setTransformHelper(const QTransform &transform)
QList< QGraphicsItem * > children
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem)
void ensureSequentialSiblingIndex()
void removeChild(QGraphicsItem *child)
@ AncestorContainsChildren
@ AncestorFiltersChildEvents
@ AncestorHandlesChildEvents
@ AncestorIgnoresTransformations
quint32 updateDueToGraphicsEffect
QRectF sceneEffectiveBoundingRect() const
quint32 hasBoundingRegionGranularity
quint32 sceneTransformTranslateOnly
void remapItemPos(QEvent *event, QGraphicsItem *item)
void clearFocusHelper(bool giveFocusToParent, bool hiddenByParentPanel)
static bool movableAncestorIsSelected(const QGraphicsItem *item)
quint32 sendParentChangeNotification
QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem=nullptr) const
quint32 scenePosDescendants
void updatePaintedViewBoundingRects(bool updateChildren)
bool isFullyTransparent() const
virtual void setWidth(qreal)
quint32 acceptTouchEvents
QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const
quint32 sequentialOrdering
virtual void updateSceneTransformFromParent()
QTransform genericMapFromSceneTransform(const QWidget *viewport=nullptr) const
virtual void siblingOrderChange()
QDeclarativeListProperty< QGraphicsObject > childrenList()
quint32 paintedViewBoundingRectsNeedRepaint
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
bool hasTranslateOnlySceneTransform()
QRectF childrenBoundingRect
static void children_clear(QDeclarativeListProperty< QGraphicsObject > *list)
quint32 holesInSiblingIndex
void removeExtraItemCache()
virtual void subFocusItemChange()
qreal effectiveOpacity() const
quint32 handlesChildEvents
quint32 notifyBoundingRectChanged
TransformData * transformData
QGraphicsItemCache * maybeExtraItemCache() const
void prependGraphicsTransform(QGraphicsTransform *t)
static int children_count(QDeclarativeListProperty< QGraphicsObject > *list)
QTransform sceneTransform
virtual void resetHeight()
QHash< QWidget *, QRect > paintedViewBoundingRects
QGraphicsItemCache * extraItemCache() const
void unsetExtra(Extra type)
void addChild(QGraphicsItem *child)
void setIsMemberOfGroup(bool enabled)
virtual bool isProxyWidget() const
void ensureSortedChildren()
void setVisibleHelper(bool newVisible, bool explicitly, bool update=true, bool hiddenByPanel=false)
virtual void setHeight(qreal)
quint32 fullUpdatePending
static QGraphicsObject * children_at(QDeclarativeListProperty< QGraphicsObject > *list, int)
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
QVariant extension(const QVariant &variant) const override
bool contains(const QPointF &point) const override
QPainterPath opaqueArea() const override
QPainterPath shape() const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
void setPen(const QPen &pen)
void setLine(const QLineF &line)
QRectF boundingRect() const override
int type() const override
bool isObscuredBy(const QGraphicsItem *item) const override
bool supportsExtension(Extension extension) const override
QGraphicsLineItem(QGraphicsItem *parent=nullptr)
void setExtension(Extension extension, const QVariant &variant) override
The QGraphicsObject class provides a base class for all graphics items that require signals,...
bool event(QEvent *ev) override
void setExtension(Extension extension, const QVariant &variant) override
int type() const override
QPainterPath opaqueArea() const override
QPainterPath shape() const override
QVariant extension(const QVariant &variant) const override
void setPath(const QPainterPath &path)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
bool supportsExtension(Extension extension) const override
QPainterPath path() const
bool isObscuredBy(const QGraphicsItem *item) const override
bool contains(const QPointF &point) const override
QGraphicsPathItem(QGraphicsItem *parent=nullptr)
QRectF boundingRect() const override
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void setExtension(Extension extension, const QVariant &variant) override
void setPixmap(const QPixmap &pixmap)
QVariant extension(const QVariant &variant) const override
void setOffset(const QPointF &offset)
bool isObscuredBy(const QGraphicsItem *item) const override
ShapeMode shapeMode() const
bool supportsExtension(Extension extension) const override
Qt::TransformationMode transformationMode() const
void setShapeMode(ShapeMode mode)
QGraphicsPixmapItem(QGraphicsItem *parent=nullptr)
bool contains(const QPointF &point) const override
QPainterPath opaqueArea() const override
void setTransformationMode(Qt::TransformationMode mode)
QRectF boundingRect() const override
QPainterPath shape() const override
int type() const override
QGraphicsPixmapItem::ShapeMode shapeMode
QGraphicsPixmapItemPrivate()
Qt::TransformationMode transformationMode
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
QGraphicsPolygonItem(QGraphicsItem *parent=nullptr)
int type() const override
void setExtension(Extension extension, const QVariant &variant) override
bool supportsExtension(Extension extension) const override
void setPolygon(const QPolygonF &polygon)
QPainterPath shape() const override
bool isObscuredBy(const QGraphicsItem *item) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
QVariant extension(const QVariant &variant) const override
QRectF boundingRect() const override
void setFillRule(Qt::FillRule rule)
QPainterPath opaqueArea() const override
QPolygonF polygon() const
bool contains(const QPointF &point) const override
Qt::FillRule fillRule() const
QGraphicsPolygonItemPrivate()
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
int type() const override
bool contains(const QPointF &point) const override
QPainterPath shape() const override
bool isObscuredBy(const QGraphicsItem *item) const override
QVariant extension(const QVariant &variant) const override
QPainterPath opaqueArea() const override
bool supportsExtension(Extension extension) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
void setRect(const QRectF &rect)
QGraphicsRectItem(QGraphicsItem *parent=nullptr)
void setExtension(Extension extension, const QVariant &variant) override
QRectF boundingRect() const override
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
void setPos(const QPointF &pos)
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void removeItem(QGraphicsItem *item)
void addItem(QGraphicsItem *item)
void setFocusItem(QGraphicsItem *item, Qt::FocusReason focusReason=Qt::OtherFocusReason)
bool sendEvent(QGraphicsItem *item, QEvent *event)
void setActivePanel(QGraphicsItem *item)
QList< QGraphicsItem * > selectedItems() const
QGraphicsItem * activePanel() const
QList< QGraphicsView * > views() const
void update(qreal x, qreal y, qreal w, qreal h)
virtual bool focusNextPrevChild(bool next)
QList< QGraphicsItem * > collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
QGraphicsItem * focusItem() const
QGraphicsItem * mouseGrabberItem() const
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos)
void setLastPos(const QPointF &pos)
void setPos(const QPointF &pos)
Qt::MouseButtons buttons() const
QPointF buttonDownPos(Qt::MouseButton button) const
QList< QGraphicsView * > views
QList< QGraphicsItem * > modalPanels
QList< QGraphicsWidget * > popupWidgets
void markDirty(QGraphicsItem *item, const QRectF &rect=QRectF(), bool invalidateChildren=false, bool force=false, bool ignoreOpacity=false, bool removingItemFromScene=false, bool updateBoundingRect=false)
QSet< QGraphicsItem * > selectedItems
QGraphicsSceneIndex * index
void draw(QGraphicsItem *, QPainter *, const QTransform *const, const QTransform *const, QRegion *, QWidget *, qreal, const QTransform *const, bool, bool)
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
void setPos(const QPointF &pos)
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsSce...
bool contains(const QPointF &point) const override
void setExtension(Extension extension, const QVariant &variant) override
~QGraphicsSimpleTextItem()
QPainterPath shape() const override
QGraphicsSimpleTextItem(QGraphicsItem *parent=nullptr)
void setText(const QString &text)
QVariant extension(const QVariant &variant) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void setFont(const QFont &font)
bool isObscuredBy(const QGraphicsItem *item) const override
bool supportsExtension(Extension extension) const override
int type() const override
QPainterPath opaqueArea() const override
QRectF boundingRect() const override
void updateBoundingRect()
QGraphicsSimpleTextItemPrivate()
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
void setDocument(QTextDocument *document)
void linkHovered(const QString &)
bool contains(const QPointF &point) const override
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
QTextCursor textCursor() const
void setHtml(const QString &html)
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override
void linkActivated(const QString &)
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
bool isObscuredBy(const QGraphicsItem *item) const override
void focusInEvent(QFocusEvent *event) override
QVariant extension(const QVariant &variant) const override
bool openExternalLinks() const
QGraphicsTextItem(QGraphicsItem *parent=nullptr)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
void setDefaultTextColor(const QColor &c)
QPainterPath opaqueArea() const override
void setTextCursor(const QTextCursor &cursor)
void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override
Qt::TextInteractionFlags textInteractionFlags() const
QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
bool tabChangesFocus() const
QColor defaultTextColor() const
void focusOutEvent(QFocusEvent *event) override
QRectF boundingRect() const override
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
int type() const override
void setOpenExternalLinks(bool open)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
void setExtension(Extension extension, const QVariant &variant) override
void dropEvent(QGraphicsSceneDragDropEvent *event) override
void inputMethodEvent(QInputMethodEvent *event) override
bool sceneEvent(QEvent *event) override
QPainterPath shape() const override
void setTextWidth(qreal width)
void setTabChangesFocus(bool b)
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override
QString toPlainText() const
QTextDocument * document() const
void keyPressEvent(QKeyEvent *event) override
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
void keyReleaseEvent(QKeyEvent *event) override
void setPlainText(const QString &text)
bool supportsExtension(Extension extension) const override
void setFont(const QFont &font)
void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
void _q_updateBoundingRect(const QSizeF &)
void _q_ensureVisible(QRectF)
QWidgetTextControl * control
QPointF controlOffset() const
QGraphicsTextItemPrivate()
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
QWidgetTextControl * textControl() const
void sendControlEvent(QEvent *e)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
bool updateRect(const QRect &rect)
static QInputMethod * inputMethod()
The QHash class is a template class that provides a hash-table-based dictionary.
bool contains(const Key &key) const noexcept
T value(const Key &key) const noexcept
bool isEmpty() const noexcept
The QImage class provides a hardware-independent image representation that allows direct access to th...
@ Format_ARGB32_Premultiplied
The QKeyEvent class describes a key event.
Qt::KeyboardModifiers modifiers() const
The QLineF class provides a two-dimensional vector using floating point precision.
qsizetype size() const noexcept
bool isEmpty() const noexcept
void removeAt(qsizetype i)
iterator insert(qsizetype i, parameter_type t)
bool removeOne(const AT &t)
const_reference at(qsizetype i) const noexcept
void move(qsizetype from, qsizetype to)
void remove(qsizetype i, qsizetype n=1)
qsizetype count() const noexcept
void prepend(rvalue_ref t)
void append(parameter_type t)
iterator insert(const Key &key, const T &value)
bool contains(const Key &key) const
const_iterator constBegin() const
const_iterator constEnd() const
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
virtual bool event(QEvent *event)
bool isSignalConnected(uint signalIdx, bool checkDeclarative=true) const
static QObjectPrivate * get(QObject *o)
The QPainter class performs low-level painting on widgets and other paint devices.
void drawRect(const QRectF &rect)
void drawPath(const QPainterPath &path)
void drawPie(const QRectF &rect, int a, int alen)
void setPen(const QColor &color)
void drawLine(const QLineF &line)
const QTransform & worldTransform() const
void setFont(const QFont &f)
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
void drawEllipse(const QRectF &r)
void setBrush(const QBrush &brush)
const QTransform & transform() const
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
void translate(const QPointF &offset)
void setRenderHint(RenderHint hint, bool on=true)
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
void addRect(const QRectF &rect)
QRectF controlPointRect() const
bool contains(const QPointF &pt) const
QPainterPath intersected(const QPainterPath &r) const
The QPainterPathStroker class is used to generate fillable outlines for a given painter path.
The QPalette class contains color groups for each widget state.
const QColor & color(ColorGroup cg, ColorRole cr) const
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
The QPen class defines how a QPainter should draw lines and outlines of shapes.
void setStyle(Qt::PenStyle)
[0]
Qt::PenCapStyle capStyle() const
Qt::PenJoinStyle joinStyle() const
Qt::PenStyle style() const
static bool find(const QString &key, QPixmap *pixmap)
static void remove(const QString &key)
static bool insert(const QString &key, const QPixmap &pixmap)
The QPixmap class is an off-screen image representation that can be used as a paint device.
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed=nullptr)
QBitmap createHeuristicMask(bool clipTight=true) const
The QPointF class defines a point in the plane using floating point precision.
constexpr qreal x() const noexcept
constexpr qreal y() const noexcept
constexpr QPoint toPoint() const
bool isNull() const noexcept
The QPoint class defines a point in the plane using integer precision.
The QPolygonF class provides a list of points using floating point precision. \inmodule QtGui.
The QRectF class defines a finite rectangle in the plane using floating point precision.
constexpr bool isEmpty() const noexcept
QRect toAlignedRect() const noexcept
constexpr qreal height() const noexcept
constexpr qreal width() const noexcept
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
bool contains(const QRectF &r) const noexcept
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
bool intersects(const QRectF &r) const noexcept
constexpr void setSize(const QSizeF &s) noexcept
constexpr QPointF topLeft() const noexcept
constexpr QSizeF size() const noexcept
constexpr QRect toRect() const noexcept
constexpr void translate(qreal dx, qreal dy) noexcept
The QRect class defines a rectangle in the plane using integer precision.
constexpr bool isEmpty() const noexcept
bool intersects(const QRect &r) const noexcept
constexpr int height() const noexcept
constexpr QPoint topLeft() const noexcept
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
constexpr int x() const noexcept
constexpr QSize size() const noexcept
constexpr int width() const noexcept
constexpr QRect translated(int dx, int dy) const noexcept
constexpr int y() const noexcept
The QRegion class specifies a clip region for a painter.
void translate(int dx, int dy)
QRegion translated(int dx, int dy) const
T * data() const noexcept
The QSizeF class defines the size of a two-dimensional object using floating point precision.
constexpr qreal height() const noexcept
The QSize class defines the size of a two-dimensional object using integer point precision.
The QString class provides a Unicode character string.
QString & replace(qsizetype i, qsizetype len, QChar after)
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
The QTextCursor class offers an API to access and modify QTextDocuments.
The QTextDocument class holds formatted text.
QFont defaultFont
the default font used to display the document's text
QAbstractTextDocumentLayout * documentLayout() const
QSizeF pageSize
the page size that should be used for laying out the document
void setDefaultFont(const QFont &font)
QTextFrame * rootFrame() const
The QTextFrameFormat class provides formatting information for frames in a QTextDocument....
QTextFrameFormat frameFormat() const
The QTextLayout class is used to lay out and render text. \inmodule QtGui.
The QTextLine class represents a line of text inside a QTextLayout. \inmodule QtGui.
The QVariant class acts like a union for the most common Qt data types.
qreal toReal(bool *ok=nullptr) const
void setPlainText(const QString &text)
QTextCursor textCursor() const
Qt::TextInteractionFlags textInteractionFlags
QString toPlainText() const
void setOpenExternalLinks(bool open)
void setHtml(const QString &text)
void setTextCursor(const QTextCursor &cursor, bool selectionClipboard=false)
void linkActivated(const QString &link)
void updateRequest(const QRectF &rect=QRectF())
void setDocument(QTextDocument *document)
void drawContents(QPainter *painter, const QRectF &rect=QRectF(), QWidget *widget=nullptr)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property, QVariant argument) const
virtual void processEvent(QEvent *e, const QTransform &transform, QWidget *contextWidget=nullptr)
void documentSizeChanged(const QSizeF &)
void linkHovered(const QString &)
void visibilityRequest(const QRectF &rect)
QTextDocument * document() const
void setTextWidth(qreal width)
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
QRhiGraphicsPipeline * ps
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
backing_store_ptr info
[4]
@ IntersectsItemBoundingRect
constexpr Initialization Uninitialized
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
QT_BEGIN_NAMESPACE bool done
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
QT_END_INCLUDE_NAMESPACE typedef double qreal
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
QPainterPath qt_regionToPath(const QRegion ®ion)
void Q_WIDGETS_EXPORT qt_graphicsItem_highlightSelected(QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option)
#define Q_ARG(type, data)
GLboolean GLboolean GLboolean b
GLsizei const GLfloat * v
[13]
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLint GLint GLint GLint GLint x
[0]
GLfloat GLfloat GLfloat w
[0]
GLuint GLfloat GLfloat GLfloat GLfloat y1
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLuint GLintptr offset
GLint GLint GLint GLint GLint GLint GLint GLbitfield mask
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLsizei GLchar * source
GLuint GLenum GLenum transform
GLfixed GLfixed GLfixed y2
GLdouble GLdouble GLdouble GLdouble q
GLsizei const GLchar *const * path
#define Q_ASSERT_X(cond, x, msg)
file open(QIODevice::ReadOnly)
QFileInfo fi("c:/temp/foo")
[newstuff]
QGraphicsOpacityEffect * effect
rect sceneTransform().map(QPointF(0
view viewport() -> scroll(dx, dy, deviceRect)
myFilter draw(painter, QPoint(0, 0), originalPixmap)
backaction setToolTip(browser.historyTitle(-1))
[0]
QNetworkAccessManager manager
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
bool contains(const AT &t) const noexcept
The QTextLayout::FormatRange structure is used to apply extra formatting information for a specified ...
QThreadStorage< int * > dummy[8]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent