764#include <QtCore/qbitarray.h>
765#include <QtCore/qpoint.h>
766#include <QtCore/qstack.h>
767#include <QtCore/qtimer.h>
768#include <QtCore/qvariant.h>
769#include <QtCore/qvarlengtharray.h>
770#include <QtCore/qnumeric.h>
771#include <QtWidgets/qapplication.h>
772#include <QtGui/qbitmap.h>
773#include <QtGui/qpainter.h>
774#include <QtGui/qpainterpath.h>
775#include <QtGui/qpixmapcache.h>
776#include <QtWidgets/qstyleoption.h>
777#include <QtGui/qevent.h>
778#include <QtGui/qinputmethod.h>
779#if QT_CONFIG(graphicseffect)
780#include <QtWidgets/qgraphicseffect.h>
783#include <private/qgraphicsitem_p.h>
784#include <private/qgraphicswidget_p.h>
785#include <private/qwidgettextcontrol_p.h>
786#include <private/qtextdocumentlayout_p.h>
787#include <private/qtextengine_p.h>
788#include <private/qwidget_p.h>
789#include <private/qapplication_p.h>
790#include <private/qgesturemanager_p.h>
791#include <private/qdebug_p.h>
801 rect->adjust(0, 0, 1, 0);
803 rect->adjust(0, 0, 0, 1);
832 if (pen.widthF() <= 0.0)
859 imHints(
Qt::ImhNone),
861 acceptedMouseButtons(0x1f),
863 explicitlyHidden(
false),
865 explicitlyDisabled(
false),
869 isMemberOfGroup(
false),
870 handlesChildEvents(
false),
871 itemDiscovered(
false),
875 hasBoundingRegionGranularity(
false),
878 dirtyChildren(
false),
879 localCollisionHack(
false),
880 inSetPosHelper(
false),
881 needSortChildren(
false),
882 allChildrenDirty(
false),
883 fullUpdatePending(
false),
885 paintedViewBoundingRectsNeedRepaint(
false),
886 dirtySceneTransform(true),
887 geometryChanged(true),
890 ignoreVisible(
false),
891 ignoreOpacity(
false),
892 acceptTouchEvents(
false),
893 acceptedTouchBeginEvent(
false),
894 filtersDescendantEvents(
false),
895 sceneTransformTranslateOnly(
false),
896 notifyBoundingRectChanged(
false),
897 notifyInvalidated(
false),
898 mouseSetsFocus(true),
899 explicitActivate(
false),
901 holesInSiblingIndex(
false),
902 sequentialOrdering(true),
903 updateDueToGraphicsEffect(
false),
904 scenePosDescendants(
false),
905 pendingPolish(
false),
906 mayHaveChildWithGraphicsEffect(
false),
907 sendParentChangeNotification(
false),
908 dirtyChildrenBoundingRect(true),
909 globalStackingOrder(-1),
935 switch (
int(childFlag)) {
988 if ((
int(childFlag) != -1 &&
int(
flags & childFlag) == childFlag)
1037 if (!qgraphicsitem_cast<QGraphicsItemGroup *>(
q)) {
1051 switch (
event->type()) {
1059 for (
int i = 0x1;
i <= 0x10;
i <<= 1) {
1101 ? qobject_cast<QGraphicsView *>(
viewport->parentWidget())
1103 if (
view ==
nullptr)
1107 return viewportTransform *
q->deviceTransform(viewportTransform).
inverted();
1202 const QVariant *thisPointerVariant)
1219 scene->d_func()->setScenePosItemEnabled(
q,
false);
1236 if (thisPointerVariant)
1243 if (
parent && !newParent) {
1244 scene->d_func()->registerTopLevelItem(
q);
1245 }
else if (!
parent && newParent) {
1246 scene->d_func()->unregisterTopLevelItem(
q);
1260 parentFocusScopeItem = fsi;
1266 p =
p->d_ptr->parent;
1275 if (newFocusScopeItem && newParent) {
1283 while (
p2 &&
p2 !=
p) {
1290 p2 =
p2->d_ptr->parent;
1293 newFocusScopeItem = ancestorScope;
1305 p =
p->d_ptr->parent;
1312 if ((
parent = newParent)) {
1322 if (thisPointerVariant)
1327 scene->d_func()->setScenePosItemEnabled(
q,
true);
1374 if (newParentVariant)
1392 rect = &childrenRect;
1393 const bool setTopMostEffectItem = !topMostEffectItem;
1398 if (setTopMostEffectItem)
1399 topMostEffectItem =
child;
1406 *
rect |=
matrix.mapRect(
child->d_ptr->effectiveBoundingRect(topMostEffectItem));
1411 *
rect |=
x->mapRect(
child->d_ptr->effectiveBoundingRect(topMostEffectItem));
1413 *
rect |=
child->d_ptr->effectiveBoundingRect(topMostEffectItem);
1421 *
rect &=
x->mapRect(
q->boundingRect());
1423 *
rect &=
q->boundingRect();
1430 const QRegion &exposedRegion,
bool allItems)
const
1436 const QRectF brect =
q->boundingRect();
1439 option->exposedRect = brect;
1445 if (!
option->styleObject)
1455 if (
scene->d_func()->hoverItems.contains(
q_ptr))
1468 for (
const QRect &exposedRect : exposedRegion) {
1470 if (
option->exposedRect.contains(brect))
1473 option->exposedRect &= brect;
1487 for (
const auto &
data : constDeviceData)
1533 p->wasDeleted =
true;
1534 if (
p->declarativeData) {
1535 p->wasDeleted =
true;
1538 p->declarativeData =
nullptr;
1539 p->wasDeleted =
false;
1546#ifndef QT_NO_GESTURES
1563 if (
p->d_ptr->focusScopeItem ==
this)
1577 d_ptr->
scene->d_func()->removeItemHelper(
this);
1583#if QT_CONFIG(graphicseffect)
1596 dataStore->data.remove(
this);
1643 group->addToGroup(
this);
1699 while (
p && !
p->isWidget())
1700 p =
p->parentItem();
1732 if (
p &&
p->isWindow())
1791 if (newParent ==
this) {
1792 qWarning(
"QGraphicsItem::setParentItem: cannot assign %p as a parent of itself",
this);
1799 QVariant::fromValue<QGraphicsItem *>(newParent)));
1800 newParent = qvariant_cast<QGraphicsItem *>(newParentVariant);
1804 const QVariant thisPointerVariant(QVariant::fromValue<QGraphicsItem *>(
this));
1918 GraphicsItemFlags oldFlags = GraphicsItemFlags(
d_ptr->
flags);
1965 flags &= ~ItemStacksBehindParent;
1977 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
1983 d_ptr->
scene->d_func()->updateInputMethodSensitivityInViews();
2001 if (!
w->isAncestorOf(test) || test ==
w)
2010 beforeMe->d_func()->focusNext = afterMe;
2011 afterMe->d_func()->focusPrev = beforeMe;
2012 focusFirst->d_func()->focusPrev = focusLast;
2013 focusLast->d_func()->focusNext = focusFirst;
2015 focusFirst->d_func()->focusNext =
w;
2020 beforeMe->d_func()->focusNext =
w;
2021 afterMe->d_func()->focusPrev = focusLast;
2022 w->d_func()->focusPrev = beforeMe;
2023 focusLast->d_func()->focusNext = afterMe;
2031 d_ptr->
scene->d_func()->registerScenePosItem(
this);
2033 d_ptr->
scene->d_func()->unregisterScenePosItem(
this);
2108 if (lastMode ==
mode &&
cache->fixedSize == logicalCacheSize)
2109 noVisualChange =
true;
2110 cache->fixedSize = logicalCacheSize;
2113 if (!noVisualChange)
2145 d_ptr->
scene->d_func()->enterModal(
this, previousModality);
2167 blockingPanel = &dummy;
2181 if (modalPanel !=
this && !modalPanel->
isAncestorOf(
this)) {
2182 *blockingPanel = modalPanel;
2187 if (modalPanel !=
this
2190 *blockingPanel = modalPanel;
2198#if QT_CONFIG(tooltip)
2205QString QGraphicsItem::toolTip()
const
2216void QGraphicsItem::setToolTip(
const QString &toolTip)
2266 d_ptr->
scene->d_func()->allItemsUseDefaultCursor =
false;
2269 view->viewport()->setMouseTracking(
true);
2271 if (
view->underMouse()) {
2276 const auto itemsUnderCursor =
view->items(viewPoint);
2278 if (itemUnderCursor->hasCursor()) {
2363 if (
p->d_ptr->explicitlyHidden)
2365 }
while ((
p =
p->d_ptr->parent));
2366 return parent ==
nullptr;
2376 bool update,
bool hiddenByPanel)
2395 newVisible = newVisibleVariant.
toBool();
2406#if QT_CONFIG(graphicseffect)
2407 invalidateParentGraphicsEffectsRecursively();
2417 if (
scene->d_func()->mouseGrabberItems.contains(
q))
2419 if (
scene->d_func()->keyboardGrabberItems.contains(
q))
2420 q->ungrabKeyboard();
2424 if (hasFocus &&
scene) {
2430 if (focusItem ==
q_ptr) {
2461 if (!newVisible || !
child->d_ptr->explicitlyHidden)
2462 child->d_ptr->setVisibleHelper(newVisible,
false, updateChildren, hiddenByPanel);
2466 if (
scene &&
q->isPanel()) {
2494 p =
p->d_ptr->parent;
2512 if (
p->d_ptr->visible) {
2518 p =
p->d_ptr->parent;
2629 if (focusItem ==
q_ptr) {
2653 if (!newEnabled || !
child->d_ptr->explicitlyDisabled)
2654 child->d_ptr->setEnabledHelper(newEnabled,
false);
2709 return group->isSelected();
2740 group->setSelected(selected);
2749 bool newSelected = newSelectedVariant.
toBool();
2857#if QT_CONFIG(graphicseffect)
2858 d_ptr->invalidateParentGraphicsEffectsRecursively();
2860 d_ptr->invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::OpacityChanged);
2866 if (wasFullyTransparent)
2879#if QT_CONFIG(graphicseffect)
2925#if QT_CONFIG(graphicseffect)
2948#if QT_CONFIG(graphicseffect)
2960 sceneEffectRect |=
view->d_func()->mapRectToScene(deviceEffectRect);
2962 return q->mapRectFromScene(sceneEffectRect);
2980#if QT_CONFIG(graphicseffect)
2985 || topMostEffectItem ==
q)
2989 while (effectParent) {
2992 const QRectF brectInParentSpace =
q->mapRectToItem(effectParent, brect);
2998 || topMostEffectItem == effectParent) {
3035 }
while ((parentItem = itemd->
parent));
3101 &&
d_ptr->
scene->d_func()->lastMouseGrabberItemHasImplicitMouseGrab) {
3160 d_ptr->
scene->d_func()->allItemsIgnoreHoverEvents =
false;
3161 d_ptr->
scene->d_func()->enableMouseTrackingOnViews();
3190 d_ptr->
scene->d_func()->allItemsIgnoreTouchEvents =
false;
3191 d_ptr->
scene->d_func()->enableTouchEventsOnViews();
3328 if (!activePanel || activePanel == thisPanel) {
3334 if (!nextToActivate)
3335 nextToActivate =
d_ptr->
scene->d_func()->lastActivePanel;
3336 if (nextToActivate ==
this ||
isAncestorOf(nextToActivate))
3337 nextToActivate =
nullptr;
3400 while (
f->d_ptr->focusProxy)
3413 if (oldFocusScopeItem)
3416 if (!
p->focusItem() && !focusFromHide) {
3425 p =
p->d_ptr->parent;
3429 while (
f->d_ptr->focusScopeItem &&
f->d_ptr->focusScopeItem->isVisible())
3430 f =
f->d_ptr->focusScopeItem;
3440 f->d_ptr->setSubFocus(
f, commonAncestor);
3447 scene->d_func()->setFocusItemHelper(
f, focusReason);
3480 if (giveFocusToParent) {
3486 if (
p->d_ptr->focusScopeItem ==
q_ptr) {
3496 p =
p->d_ptr->parent;
3503 if (!hiddenByParentPanel)
3548 qWarning(
"QGraphicsItem::setFocusProxy: cannot assign self as focus proxy");
3553 qWarning(
"QGraphicsItem::setFocusProxy: focus proxy must be in same scene");
3558 qWarning(
"QGraphicsItem::setFocusProxy: %p is already in the focus proxy chain",
item);
3633 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse without scene");
3637 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse while invisible");
3652 qWarning(
"QGraphicsItem::ungrabMouse: cannot ungrab mouse without scene");
3695 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard without scene");
3699 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard while invisible");
3714 qWarning(
"QGraphicsItem::ungrabKeyboard: cannot ungrab keyboard without scene");
3717 d_ptr->
scene->d_func()->ungrabKeyboard(
this);
3813 q->prepareGeometryChange();
3819 if (
pos.
x() != oldPos.
x())
3821 if (
pos.
y() != oldPos.
y())
3861 static_cast<QGraphicsWidget *
>(
this)->d_func()->setGeometryFromSetPos();
3920 view->ensureVisible(sceneRect, xmargin, ymargin);
3996 newRotation = newRotationVariant.
toReal();
4057 qreal newScale = factor;
4062 newScale = newScaleVariant.
toReal();
4152 t->d_func()->setItem(
q);
4169 t->d_func()->setItem(
q);
4206 QVariant::fromValue<QPointF>(origin)));
4207 newOrigin = newOriginVariant.
toPointF();
4300 parents.
prepend(untransformedAncestor);
4301 untransformedAncestor = untransformedAncestor->
parentItem();
4304 if (!untransformedAncestor) {
4306 Q_ASSERT_X(untransformedAncestor,
"QGraphicsItem::deviceTransform",
4307 "Invalid object structure!");
4316 if (parentOfUntransformedAncestor)
4317 inheritedMatrix = parentOfUntransformedAncestor->
sceneTransform();
4318 QPointF mappedPoint = (inheritedMatrix * viewportTransform).
map(untransformedAncestor->
pos());
4326 for (
int i = 0;
i < parents.
size(); ++
i) {
4354 if (
other ==
nullptr) {
4355 qWarning(
"QGraphicsItem::itemTransform: null pointer passed");
4358 if (
other ==
this) {
4377 if (otherParent ==
this) {
4379 if (
other->d_ptr->transformData) {
4381 other->d_ptr->combineTransformFromParent(&otherToParent);
4390 if (
parent == otherParent) {
4395 QPointF delta = itemPos - otherPos;
4404 other->d_ptr->combineTransformFromParent(&otherToParent);
4405 return itemToParent * otherToParent.
inverted(
ok);
4411 if (!commonAncestor) {
4413 other->d_ptr->ensureSceneTransform();
4419 bool cousins =
other != commonAncestor &&
this != commonAncestor;
4425 otherToScene =
other->itemTransform(commonAncestor, &good);
4431 return thisToScene * otherToScene.
inverted(
ok);
4442 p->d_ptr.data()->combineTransformToParent(&
x);
4443 }
while ((
p =
p->d_ptr->parent) &&
p != root);
4445 return x.inverted(
ok);
4491 QVariant::fromValue<QTransform>(newTransform)));
4492 newTransform = qvariant_cast<QTransform>(newTransformVariant);
4582 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
4630 if (
q->isAncestorOf(
item))
4655 if (sibling ==
this)
4658 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
4665 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
4674 d_ptr->
scene->d_func()->ensureSequentialTopLevelSiblingIndexes();
4679 if (myIndex >= siblingIndex) {
4680 siblings->
move(myIndex, siblingIndex);
4682 for (
int i = 0;
i < siblings->
size(); ++
i) {
4683 int &
index = siblings->
at(
i)->d_ptr->siblingIndex;
4684 if (
i != siblingIndex &&
index >= siblingIndex &&
index <= myIndex)
4688 for (
int i = 0;
i < siblings->
size(); ++
i) {
4689 int &
index = siblings->
at(
i)->d_ptr->siblingIndex;
4690 if (
i != siblingIndex &&
index >= siblingIndex &&
index <= myIndex)
4691 siblings->
at(
i)->d_ptr->siblingOrderChange();
4862 if (thisBoundingRect.
isEmpty())
4867 clip.
addRect(thisBoundingRect);
4888 if (lastParent !=
this) {
4957 if (clips || otherClips) {
4960 closestClipper = closestClipper->
parentItem();
4963 otherClosestClipper = otherClosestClipper->
parentItem();
4964 if (closestClipper == otherClosestClipper) {
4992 if (
path.isEmpty()) {
5021 return path.intersects(thisShape);
5022 return path.contains(thisShape);
5170 if (granularity == 0.0)
5185 p.scale(granularity, granularity);
5187 p.translate(pad, pad);
5188 p.setWorldTransform(itemToDeviceTransform,
true);
5248 if (granularity < 0.0 || granularity > 1.0) {
5249 qWarning(
"QGraphicsItem::setBoundingRegionGranularity: invalid granularity %g", granularity);
5252 if (granularity == 0.0) {
5259 QVariant::fromValue<qreal>(granularity));
5311 bool ignoreOpacity)
const
5335#if QT_CONFIG(graphicseffect)
5336void QGraphicsItemPrivate::invalidateParentGraphicsEffectsRecursively()
5344 static_cast<QGraphicsItemEffectSourcePrivate *
>(itemPrivate->
graphicsEffect->d_func()->
source->d_func())->invalidateCache();
5349void QGraphicsItemPrivate::invalidateChildGraphicsEffectsRecursively(QGraphicsItemPrivate::InvalidateReason reason)
5360 static_cast<QGraphicsItemEffectSourcePrivate *
>(childPrivate->
graphicsEffect->d_func()->
source->d_func())->invalidateCache();
5363 childPrivate->invalidateChildGraphicsEffectsRecursively(reason);
5434 child->d_ptr->siblingIndex = -1;
5479 for (
int i = 0;
i <
scene->d_func()->views.size(); ++
i) {
5486 if (updateChildren) {
5502 *topMostDirtyItem =
q_ptr;
5507 if (*topMostDirtyItem ==
q_ptr) {
5510 *topMostDirtyItem =
nullptr;
5511 }
else if (*topMostDirtyItem) {
5644 if (
rect.isEmpty() && !
rect.isNull())
5648#if QT_CONFIG(graphicseffect)
5649 d_ptr->invalidateParentGraphicsEffectsRecursively();
5655 if (!
cache->allExposed) {
5656 if (
rect.isNull()) {
5657 cache->allExposed =
true;
5658 cache->exposed.clear();
5702 if (dx == 0.0 && dy == 0.0)
5727 if (
cache->allExposed ||
cache->fixedSize.isValid()) {
5754 for (
int i = 0;
i <
cache->exposed.size(); ++
i) {
5756 if (!
rect.isNull() && !
e.intersects(
rect))
5758 e.translate(dx, dy);
5764 for (
const QRect &exposedRect : exposed)
5765 cache->exposed += exposedRect;
5769 d->scene->d_func()->markDirty(
this,
rect);
6407 if (ancestor ==
this)
6430 int otherDepth =
other->d_ptr->depth();
6431 while (thisDepth > otherDepth) {
6435 while (otherDepth > thisDepth) {
6439 while (thisw && thisw != otherw) {
6460 const auto views =
d->scene->views();
6500 qt_dataStore()->data[
this][
key] =
value;
6562 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed"
6563 " on items in a scene.");
6567 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed"
6568 " on items in the same scene.");
6571 d_ptr->
scene->d_func()->installSceneEventFilter(
this, filterItem);
6583 d_ptr->
scene->d_func()->removeSceneEventFilter(
this, filterItem);
6656 switch (
event->type()) {
6738 if (
child->isVisible() && !
child->isPanel()) {
6802 if (
d->isProxyWidget())
6826 if (
d->isProxyWidget())
6853 if (
d->isProxyWidget())
6875 if (
d->isProxyWidget())
7021 ++
scene->d_func()->selectionChanging;
7023 --
scene->d_func()->selectionChanging;
7036 if (!
w->rect().contains(
event->pos()))
7083 initialPositions =
d_ptr->
scene->d_func()->movingItemsInitialPositions;
7084 if (initialPositions.
isEmpty()) {
7087 initialPositions[
this] =
pos();
7089 d_ptr->
scene->d_func()->movingItemsInitialPositions = initialPositions;
7094 if (
event->widget())
7095 view = qobject_cast<QGraphicsView *>(
event->widget()->parentWidget());
7099 bool movedMe =
false;
7100 while (
i <= selectedItems.
size()) {
7102 if (
i < selectedItems.
size())
7137 currentParentPos = viewToParentTransform.
map(
QPointF(
view->mapFromGlobal(
event->screenPos())));
7186 bool selectionChanged =
false;
7188 ++
scene->d_func()->selectionChanging;
7196 selectionChanged =
true;
7204 --
scene->d_func()->selectionChanging;
7205 if (selectionChanged)
7324 d->scene->d_func()->updateInputMethodSensitivityInViews();
7459 d_ptr->
scene->d_func()->dirtyGrowingItemsBoundingRect =
true;
7527 const qreal pad = itemPenWidth / 2;
7529 const qreal penWidth = 0;
7531 const QColor fgcolor =
option->palette.windowText().color();
7533 fgcolor.
red() > 127 ? 0 : 255,
7534 fgcolor.
green() > 127 ? 0 : 255,
7535 fgcolor.
blue() > 127 ? 0 : 255);
7595QGraphicsObject::~QGraphicsObject()
7614#ifndef QT_NO_GESTURES
8057 if (
d->brush.isOpaque())
8104 if (!
path.isEmpty())
8146 if (
d->path ==
path)
8160 if (
d->boundingRect.isNull()) {
8163 d->boundingRect =
d->path.controlPointRect();
8168 return d->boundingRect;
8363 if (
d->rect ==
rect)
8390 if (
d->boundingRect.isNull()) {
8392 d->boundingRect =
d->rect;
8394 d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw);
8396 return d->boundingRect;
8406 path.addRect(
d->rect);
8601 if (
d->rect ==
rect)
8619 return d->startAngle;
8632 if (
angle !=
d->startAngle) {
8651 return d->spanAngle;
8665 if (
angle !=
d->spanAngle) {
8679 if (
d->boundingRect.isNull()) {
8681 if (pw == 0.0 &&
d->spanAngle == 360 * 16)
8682 d->boundingRect =
d->rect;
8686 return d->boundingRect;
8696 if (
d->rect.isNull())
8698 if (
d->spanAngle != 360 * 16) {
8699 path.moveTo(
d->rect.center());
8700 path.arcTo(
d->rect,
d->startAngle / 16.0,
d->spanAngle / 16.0);
8702 path.addEllipse(
d->rect);
8726 if ((
d->spanAngle != 0) && (
qAbs(
d->spanAngle) % (360 * 16) == 0))
8903 if (
rule !=
d->fillRule) {
8915 if (
d->boundingRect.isNull()) {
8918 d->boundingRect =
d->polygon.boundingRect();
8922 return d->boundingRect;
8932 path.addPolygon(
d->polygon);
9134 if (
d->line ==
line)
9157 if (
d->pen.widthF() == 0.0) {
9181 path.moveTo(
d->line.p1());
9182 path.lineTo(
d->line.p2());
9338 if (!
mask.isNull()) {
9348#ifndef QT_NO_IMAGE_HEURISTIC_MASK
9398 d->hasShape =
false;
9424 return d->transformationMode;
9441 if (
mode !=
d->transformationMode) {
9442 d->transformationMode =
mode;
9472 d->hasShape =
false;
9489 if (
d->pixmap.isNull())
9493 return QRectF(
d->offset,
d->pixmap.deviceIndependentSize()).
adjusted(-pw/2, -pw/2, pw/2, pw/2);
9495 return QRectF(
d->offset,
d->pixmap.deviceIndependentSize());
9510 return d_func()->shape;
9571 return d_func()->shapeMode;
9583 if (
d->shapeMode ==
mode)
9585 d->shapeMode =
mode;
9586 d->hasShape =
false;
9733#ifndef QT_NO_TEXTHTMLPARSER
9983 switch (
event->type()) {
10029 }
else if (
event->buttons() ==
event->button()
10036 if (!
event->isAccepted())
10065 && !
event->buttons()) {
10223 if (
v.userType() == QMetaType::QRectF)
10225 else if (
v.userType() == QMetaType::QPointF)
10227 else if (
v.userType() == QMetaType::QRect)
10229 else if (
v.userType() == QMetaType::QPoint)
10267 if (
rect.isValid()) {
10307 [dd = that->dd](
const QRectF &
rect) { dd->_q_update(rect); });
10309 [dd = that->dd](
QSizeF size) { dd->_q_updateBoundingRect(size); });
10311 [dd = that->dd](
const QRectF &
rect) { dd->_q_ensureVisible(rect); });
10318 if (pgSize.
height() != -1) {
10344 -
format.bottomMargin()));
10346 return path.subtracted(docPath).contains(
event->pos());
10494 layout->setCacheEnabled(
true);
10496 while (
layout->createLine().isValid())
10499 qreal maxWidth = 0;
10501 for (
int i = 0;
i <
layout->lineCount(); ++
i) {
10503 maxWidth =
qMax(maxWidth,
line.naturalTextWidth());
10505 y +=
line.height();
10507 return QRectF(0, 0, maxWidth,
y);
10524 q->prepareGeometryChange();
10604 if (
d->text ==
text)
10607 d->updateBoundingRect();
10627 d->updateBoundingRect();
10645 return d->boundingRect;
10655 path.addRect(
d->boundingRect);
10665 return d->boundingRect.contains(point);
10684 p.setBrush(
d->brush);
10692 range.format.setTextOutline(
d->pen);
10849 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add null item");
10852 if (
item ==
this) {
10853 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add a group to itself");
10862 qWarning(
"QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates");
10878 for (
int i = 0;
i < transformList.
size(); ++
i)
10879 transformList.
at(
i)->applyTo(&
m);
10880 newItemTransform *=
m.toTransform().
inverted();
10881 newItemTransform.
translate(origin.
x(), origin.
y());
10884 newItemTransform.
translate(-origin.
x(), -origin.
y());
10889 item->d_func()->setIsMemberOfGroup(
true);
10907 qWarning(
"QGraphicsItemGroup::removeFromGroup: cannot remove null item");
10934 for (
int i = 0;
i < transformList.
size(); ++
i)
10935 transformList.
at(
i)->applyTo(&
m);
10945 item->d_func()->setIsMemberOfGroup(
item->
group() !=
nullptr);
10960 return d->itemsBoundingRect;
11001#if QT_CONFIG(graphicseffect)
11005 if (!
info && deviceCoordinates) {
11007 qWarning(
"QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");
11015 if (deviceCoordinates) {
11026 qWarning(
"QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw");
11034 info->widget,
info->opacity,
info->effectTransform,
info->wasDirtySceneTransform,
11037 QTransform effectTransform =
info->painter->worldTransform().inverted();
11040 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11056 effectRectF =
item->graphicsEffect()->boundingRectFor(
deviceRect);
11058 *unpadded = (effectRectF.
size() == sourceRect.
size());
11060 effectRectF =
info->painter->worldTransform().inverted().mapRect(effectRectF);
11063 effectRectF =
item->graphicsEffect()->boundingRectFor(sourceRect);
11067 effectRectF = sourceRect.
adjusted(-1.5, -1.5, 1.5, 1.5);
11069 effectRectF = sourceRect;
11074 return effectRectF;
11081 if (!
info && deviceCoordinates) {
11083 qWarning(
"QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
11092 QRectF effectRectF = paddedEffectRect(system,
mode, sourceRect, &unpadded);
11098 bool untransformed = !deviceCoordinates
11100 if (untransformed && unpadded && isPixmap()) {
11109 const auto dpr =
info ?
info->painter->device()->devicePixelRatio() : 1.0;
11114 pixmapPainter.setRenderHints(
info ?
info->painter->renderHints() :
QPainter::TextAntialiasing);
11117 if (deviceCoordinates &&
info->effectTransform)
11118 effectTransform *= *
info->effectTransform;
11124 newEffectTransform *= effectTransform;
11126 &newEffectTransform,
false,
true);
11127 }
else if (deviceCoordinates) {
11129 scened->
draw(
item, &pixmapPainter,
info->viewTransform,
info->transformPtr,
nullptr,
11130 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11135 newEffectTransform *= effectTransform;
11136 scened->
draw(
item, &pixmapPainter,
info->viewTransform,
info->transformPtr,
nullptr,
11137 info->widget,
info->opacity, &newEffectTransform,
info->wasDirtySceneTransform,
11141 pixmapPainter.end();
11147#ifndef QT_NO_DEBUG_STREAM
11151 debug <<
", parent=" <<
static_cast<const void *
>(
parent);
11166 debug <<
"QGraphicsItem(0)";
11171 debug <<
o->metaObject()->className();
11173 debug <<
"QGraphicsItem";
11174 debug << '(' << static_cast<const void *>(
item);
11176 debug <<
", widget=";
11177 if (
const QWidget *
w = pw->widget()) {
11178 debug <<
w->metaObject()->className() <<
'(' <<
static_cast<const void *
>(
w);
11179 if (!
w->objectName().isEmpty())
11180 debug <<
", name=" <<
w->objectName();
11183 debug <<
"QWidget(0)";
11197 debug <<
"QGraphicsObject(0)";
11201 debug <<
item->metaObject()->className() <<
'(' <<
static_cast<const void *
>(
item);
11202 if (!
item->objectName().isEmpty())
11203 debug <<
", name=" <<
item->objectName();
11211 const char *
str =
"UnknownChange";
11214 str =
"ItemChildAddedChange";
11217 str =
"ItemChildRemovedChange";
11220 str =
"ItemCursorChange";
11223 str =
"ItemCursorHasChanged";
11226 str =
"ItemEnabledChange";
11229 str =
"ItemEnabledHasChanged";
11232 str =
"ItemFlagsChange";
11235 str =
"ItemFlagsHaveChanged";
11238 str =
"ItemParentChange";
11241 str =
"ItemParentHasChanged";
11244 str =
"ItemPositionChange";
11247 str =
"ItemPositionHasChanged";
11250 str =
"ItemSceneChange";
11253 str =
"ItemSceneHasChanged";
11256 str =
"ItemSelectedChange";
11259 str =
"ItemSelectedHasChanged";
11262 str =
"ItemToolTipChange";
11265 str =
"ItemToolTipHasChanged";
11268 str =
"ItemTransformChange";
11271 str =
"ItemTransformHasChanged";
11274 str =
"ItemVisibleChange";
11277 str =
"ItemVisibleHasChanged";
11280 str =
"ItemZValueChange";
11283 str =
"ItemZValueHasChanged";
11286 str =
"ItemOpacityChange";
11289 str =
"ItemOpacityHasChanged";
11292 str =
"ItemScenePositionHasChanged";
11295 str =
"ItemRotationChange";
11298 str =
"ItemRotationHasChanged";
11301 str =
"ItemScaleChange";
11304 str =
"ItemScaleHasChanged";
11307 str =
"ItemTransformOriginPointChange";
11310 str =
"ItemTransformOriginPointHasChanged";
11319 const char *
str =
"UnknownFlag";
11322 str =
"ItemIsMovable";
11325 str =
"ItemIsSelectable";
11328 str =
"ItemIsFocusable";
11331 str =
"ItemClipsToShape";
11334 str =
"ItemClipsChildrenToShape";
11337 str =
"ItemIgnoresTransformations";
11340 str =
"ItemIgnoresParentOpacity";
11343 str =
"ItemDoesntPropagateOpacityToChildren";
11346 str =
"ItemStacksBehindParent";
11349 str =
"ItemUsesExtendedStyleOption";
11352 str =
"ItemHasNoContents";
11355 str =
"ItemSendsGeometryChanges";
11358 str =
"ItemAcceptsInputMethod";
11361 str =
"ItemNegativeZStacksBehindParent";
11364 str =
"ItemIsPanel";
11367 str =
"ItemIsFocusScope";
11370 str =
"ItemSendsScenePositionChanges";
11373 str =
"ItemStopsClickFocusPropagation";
11376 str =
"ItemStopsFocusHandling";
11379 str =
"ItemContainsChildrenInShape";
11390 for (
int i = 0;
i < 17; ++
i) {
11406#include "moc_qgraphicsitem.cpp"
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
The QAbstractGraphicsShapeItem class provides a common base for all path items.
void setPen(const QPen &pen)
Sets the pen for this item to pen.
QPen pen() const
Returns the item's pen.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
void setBrush(const QBrush &brush)
Sets the item's brush to brush.
QBrush brush() const
Returns the item's brush, or an empty brush if no brush has been set.
QPainterPath opaqueArea() const override
\reimp
QAbstractGraphicsShapeItem(QGraphicsItem *parent=nullptr)
Constructs a QAbstractGraphicsShapeItem.
~QAbstractGraphicsShapeItem()
Destroys a QAbstractGraphicsShapeItem.
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or \nullptr if no widget in this ap...
static QBitmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Returns a copy of the given image converted to a bitmap using the specified image conversion flags.
The QColor class provides colors based on RGB, HSV or CMYK values.
int red() const noexcept
Returns the red color component of this color.
int blue() const noexcept
Returns the blue color component of this color.
int green() const noexcept
Returns the green color component of this color.
The QCursor class provides a mouse cursor with an arbitrary shape.
static QPoint pos()
Returns the position of the cursor (hot spot) of the primary screen in global screen coordinates.
Type
This enum type defines the valid event types in Qt.
@ GraphicsSceneContextMenu
@ GraphicsSceneMouseRelease
@ GraphicsSceneMousePress
@ GraphicsSceneHoverLeave
@ GraphicsSceneMouseDoubleClick
@ GraphicsSceneHoverEnter
Type type() const
Returns the event type.
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
The QFocusEvent class contains event parameters for widget focus events.
static QGestureManager * instance(InstanceCreation ic=ForceCreation)
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on.
The QGraphicsEffect class is the base class for all graphics effects.
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
@ PadToEffectiveBoundingRect
QGraphicsEffectSource * source() const
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
QGraphicsEllipseItemPrivate()
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QRectF boundingRect() const override
\reimp
QGraphicsEllipseItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsEllipseItem.
QPainterPath opaqueArea() const override
\reimp
void setExtension(Extension extension, const QVariant &variant) override
~QGraphicsEllipseItem()
Destroys the QGraphicsEllipseItem.
QRectF rect() const
Returns the item's ellipse geometry as a QRectF.
QVariant extension(const QVariant &variant) const override
bool supportsExtension(Extension extension) const override
int spanAngle() const
Returns the span angle of an ellipse segment in 16ths of a degree.
bool contains(const QPointF &point) const override
\reimp
void setStartAngle(int angle)
Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree.
int startAngle() const
Returns the start angle for an ellipse segment in 16ths of a degree.
void setSpanAngle(int angle)
Sets the span angle for an ellipse segment to angle, which is in 16ths of a degree.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
void setRect(const QRectF &rect)
Sets the item's ellipse geometry to rect.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
QPainterPath shape() const override
\reimp
int type() const override
\reimp
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
\reimp
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
QPainterPath opaqueArea() const override
\reimp
QRectF boundingRect() const override
\reimp
int type() const override
\reimp
void addToGroup(QGraphicsItem *item)
Adds the given item and item's child items to this item group.
~QGraphicsItemGroup()
Destroys the QGraphicsItemGroup.
void removeFromGroup(QGraphicsItem *item)
Removes the specified item from this group.
quint32 localCollisionHack
virtual ~QGraphicsItemPrivate()
bool isOpacityNull() const
void updateChildWithGraphicsEffectFlagRecursively()
Returns a pointer to this item's effect if it has one; otherwise \nullptr.
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
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()
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)
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()
quint32 paintedViewBoundingRectsNeedRepaint
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
bool hasTranslateOnlySceneTransform()
QRectF childrenBoundingRect
quint32 holesInSiblingIndex
void removeExtraItemCache()
virtual void subFocusItemChange()
qreal effectiveOpacity() const
quint32 handlesChildEvents
quint32 notifyBoundingRectChanged
TransformData * transformData
QGraphicsItemCache * maybeExtraItemCache() const
void prependGraphicsTransform(QGraphicsTransform *t)
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
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise,...
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
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
QPointF scenePos() const
Returns the item's position in scene coordinates.
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
@ ItemTransformOriginPointChange
@ ItemTransformOriginPointHasChanged
@ ItemTransformHasChanged
@ ItemScenePositionHasChanged
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
This event handler, for event event, can be reimplemented to receive wheel events for this item.
void setSelected(bool selected)
If selected is true and this item is selectable, this item is selected; otherwise,...
bool acceptDrops() const
Returns true if this item can accept drag and drop events; otherwise, returns false.
QGraphicsWidget * topLevelWidget() const
void setData(int key, const QVariant &value)
Sets this item's custom data for the key key to value.
QPointF mapToItem(const QGraphicsItem *item, const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to item's coordinate system,...
QScopedPointer< QGraphicsItemPrivate > d_ptr
void ensureVisible(const QRectF &rect=QRectF(), int xmargin=50, int ymargin=50)
If this item is part of a scene that is viewed by a QGraphicsView, this convenience function will att...
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover move events for this item.
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse double-click events for th...
void setScale(qreal scale)
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag enter events for this item.
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
void setTransformOriginPoint(const QPointF &origin)
QPainterPath clipPath() const
bool isObscured(const QRectF &rect=QRectF()) const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool handlesChildEvents() const
QGraphicsWidget * parentWidget() const
void setTransform(const QTransform &matrix, bool combine=false)
void setRotation(qreal angle)
virtual void dropEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drop events for this item.
void setOpacity(qreal opacity)
virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value)
This virtual function is called by QGraphicsItem to notify custom items that some part of the item's ...
qreal boundingRegionGranularity() const
friend class QGraphicsObject
void setPanelModality(PanelModality panelModality)
void clearFocus()
Takes keyboard input focus from the item.
QGraphicsScene * scene() const
Returns the current scene for the item, or \nullptr if the item is not stored in a scene.
bool isSelected() const
Returns true if this item is selected; otherwise, false is returned.
void setAcceptHoverEvents(bool enabled)
virtual void setExtension(Extension extension, const QVariant &variant)
void setGroup(QGraphicsItemGroup *group)
Adds this item to the item group group.
void unsetCursor()
Clears the cursor from this item.
QPointF pos() const
Returns the position of the item in parent coordinates.
QList< QGraphicsItem * > childItems() const
void installSceneEventFilter(QGraphicsItem *filterItem)
Installs an event filter for this item on filterItem, causing all events for this item to first pass ...
qreal y() const
This convenience function is equivalent to calling pos().y().
CacheMode cacheMode() const
virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns true if this item collides with other; otherwise returns false.
virtual QPainterPath shape() const
Returns the shape of this item as a QPainterPath in local coordinates.
GraphicsItemFlag
This enum describes different flags that you can set on an item to toggle different features in the i...
@ ItemDoesntPropagateOpacityToChildren
@ ItemIgnoresTransformations
@ ItemClipsChildrenToShape
@ ItemContainsChildrenInShape
@ ItemNegativeZStacksBehindParent
@ ItemSendsScenePositionChanges
@ ItemIgnoresParentOpacity
@ ItemStopsClickFocusPropagation
@ ItemUsesExtendedStyleOption
@ ItemSendsGeometryChanges
void setFiltersChildEvents(bool enabled)
void setZValue(qreal z)
Sets the Z-value of the item to z.
virtual void focusInEvent(QFocusEvent *event)
This event handler, for event event, can be reimplemented to receive focus in events for this item.
void stackBefore(const QGraphicsItem *sibling)
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag leave events for this item.
QGraphicsWidget * window() const
QRectF sceneBoundingRect() const
Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with bound...
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
QCursor cursor() const
Returns the current cursor shape for the item.
QPointF mapFromItem(const QGraphicsItem *item, const QPointF &point) const
Maps the point point, which is in item's coordinate system, to this item's coordinate system,...
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
bool isEnabled() const
Returns true if the item is enabled; otherwise, false is returned.
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)
This event handler, for event event, can be reimplemented to receive focus out events for this item.
bool hasFocus() const
Returns true if this item is active, and it or its \l{focusProxy()}{focus proxy} has keyboard input f...
QGraphicsItem * focusProxy() const
virtual void advance(int phase)
This virtual function is called twice for all items by the QGraphicsScene::advance() slot.
bool isClipped() const
Returns true if this item is clipped.
bool isUnderMouse() const
QGraphicsItemGroup * group() const
Returns a pointer to this item's item group, or \nullptr if this item is not member of a group.
friend class QGraphicsItemGroup
void setHandlesChildEvents(bool enabled)
qreal x() const
This convenience function is equivalent to calling pos().x().
bool hasCursor() const
Returns true if this item has a cursor set; otherwise, false is returned.
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item.
qreal zValue() const
Returns the Z-value of the item.
QGraphicsItem * topLevelItem() const
Returns this item's top-level item.
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag move events for this item.
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system,...
QGraphicsItem * focusScopeItem() const
virtual void keyPressEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented to receive key press events for this item.
QRectF childrenBoundingRect() const
Returns the bounding rect of this item's descendants (i.e., its children, their children,...
QPointF transformOriginPoint() const
void prepareGeometryChange()
Prepares the item for a geometry change.
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.
Qt::MouseButtons acceptedMouseButtons() const
Returns the mouse buttons that this item accepts mouse events for.
void setFocusProxy(QGraphicsItem *item)
void setFlags(GraphicsItemFlags flags)
Sets the item flags to flags.
void setEnabled(bool enabled)
If enabled is true, the item is enabled; otherwise, it is disabled.
void setCacheMode(CacheMode mode, const QSize &cacheSize=QSize())
QVariant data(int key) const
Returns this item's custom data for the key key as a QVariant.
QList< QGraphicsTransform * > transformations() const
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.
QRectF mapRectToScene(const QRectF &rect) const
qreal effectiveOpacity() const
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
This event handler can be reimplemented in a subclass to process context menu events.
void scroll(qreal dx, qreal dy, const QRectF &rect=QRectF())
QGraphicsObject * parentObject() const
void setAcceptDrops(bool on)
If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and ...
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover leave events for this item...
void setActive(bool active)
virtual void inputMethodEvent(QInputMethodEvent *event)
This event handler, for event event, can be reimplemented to receive input method events for this ite...
QGraphicsItem * panel() const
virtual int type() const
Returns the type of an item as an int.
QPointF mapToParent(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to its parent's coordinate system,...
bool filtersChildEvents() const
QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
This method is only relevant for input items.
virtual bool isObscuredBy(const QGraphicsItem *item) const
Returns true if this item's bounding rect is completely obscured by the opaque shape of item.
void updateMicroFocus()
Updates the item's micro focus.
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *)
Returns true if item1 is on top of item2.
QRectF mapRectFromScene(const QRectF &rect) const
QTransform sceneTransform() const
QRegion boundingRegion(const QTransform &itemToDeviceTransform) const
Qt::InputMethodHints inputMethodHints() const
Returns the current input method hints of this item.
void removeSceneEventFilter(QGraphicsItem *filterItem)
Removes an event filter on this item from filterItem.
void setVisible(bool visible)
If visible is true, the item is made visible.
QPointF mapFromParent(const QPointF &point) const
Maps the point point, which is in this item's parent's coordinate system, to this item's coordinate s...
virtual ~QGraphicsItem()
Destroys the QGraphicsItem and all its children.
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
Returns true if this item collides with path.
void setInputMethodHints(Qt::InputMethodHints hints)
Sets the current input method hints of this item to hints.
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover enter events for this item...
void setTransformations(const QList< QGraphicsTransform * > &transformations)
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
void setAcceptTouchEvents(bool enabled)
QGraphicsItem * focusItem() const
QGraphicsItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsItem with the given parent item.
QList< QGraphicsItem * > collidingItems(Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns a list of all items that collide with this item.
QTransform transform() const
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented to receive key release events for this item...
PanelModality panelModality() const
virtual bool supportsExtension(Extension extension) const
bool isVisibleTo(const QGraphicsItem *parent) const
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
Gives keyboard input focus to this item.
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons that this item accepts mouse events for.
virtual QPainterPath opaqueArea() const
This virtual function returns a shape representing the area where this item is opaque.
void setCursor(const QCursor &cursor)
Sets the current cursor shape for the item to cursor.
GraphicsItemFlags flags() const
Returns this item's flags.
virtual bool sceneEvent(QEvent *event)
This virtual function receives events to this item.
bool acceptTouchEvents() const
QPointF mapFromScene(const QPointF &point) const
Maps the point point, which is in this item's scene's coordinate system, to this item's coordinate sy...
bool isAncestorOf(const QGraphicsItem *child) const
Returns true if this item is an ancestor of child (i.e., if this item is child's parent,...
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
~QGraphicsLineItem()
Destroys the QGraphicsLineItem.
QVariant extension(const QVariant &variant) const override
bool contains(const QPointF &point) const override
\reimp
QPainterPath opaqueArea() const override
\reimp
QPainterPath shape() const override
\reimp
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
void setPen(const QPen &pen)
Sets the item's pen to pen.
void setLine(const QLineF &line)
Sets the item's line to be the given line.
QRectF boundingRect() const override
\reimp
int type() const override
\reimp
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
QPen pen() const
Returns the item's pen, or a black solid 0-width pen if no pen has been set.
QLineF line() const
Returns the item's line, or a null line if no line has been set.
bool supportsExtension(Extension extension) const override
QGraphicsLineItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsLineItem.
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
\reimp
void updateMicroFocus()
Updates the item's micro focus.
void setExtension(Extension extension, const QVariant &variant) override
int type() const override
\reimp
QPainterPath opaqueArea() const override
\reimp
QPainterPath shape() const override
\reimp
QVariant extension(const QVariant &variant) const override
void setPath(const QPainterPath &path)
Sets the item's path to be the given path.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
bool supportsExtension(Extension extension) const override
~QGraphicsPathItem()
Destroys the QGraphicsPathItem.
QPainterPath path() const
Returns the item's path as a QPainterPath.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
bool contains(const QPointF &point) const override
\reimp
QGraphicsPathItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsPath.
QRectF boundingRect() const override
\reimp
QGraphicsPixmapItem::ShapeMode shapeMode
QGraphicsPixmapItemPrivate()
Qt::TransformationMode transformationMode
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
\reimp
void setExtension(Extension extension, const QVariant &variant) override
QPixmap pixmap() const
Returns the item's pixmap, or an invalid QPixmap if no pixmap has been set.
ShapeMode
This enum describes how QGraphicsPixmapItem calculates its shape and opaque area.
void setPixmap(const QPixmap &pixmap)
Sets the item's pixmap to pixmap.
QVariant extension(const QVariant &variant) const override
void setOffset(const QPointF &offset)
Sets the pixmap item's offset to offset.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
ShapeMode shapeMode() const
Returns the item's shape mode.
bool supportsExtension(Extension extension) const override
Qt::TransformationMode transformationMode() const
Returns the transformation mode of the pixmap.
void setShapeMode(ShapeMode mode)
Sets the item's shape mode to mode.
QGraphicsPixmapItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsPixmapItem.
bool contains(const QPointF &point) const override
\reimp
QPainterPath opaqueArea() const override
\reimp
void setTransformationMode(Qt::TransformationMode mode)
Sets the pixmap item's transformation mode to mode, and toggles an update of the item.
QRectF boundingRect() const override
\reimp
QPainterPath shape() const override
\reimp
int type() const override
\reimp
QPointF offset() const
Returns the pixmap item's offset, which defines the point of the top-left corner of the pixmap,...
~QGraphicsPixmapItem()
Destroys the QGraphicsPixmapItem.
QGraphicsPolygonItemPrivate()
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
QGraphicsPolygonItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsPolygonItem.
int type() const override
\reimp
~QGraphicsPolygonItem()
Destroys the QGraphicsPolygonItem.
void setExtension(Extension extension, const QVariant &variant) override
bool supportsExtension(Extension extension) const override
void setPolygon(const QPolygonF &polygon)
Sets the item's polygon to be the given polygon.
QPainterPath shape() const override
\reimp
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
QVariant extension(const QVariant &variant) const override
QRectF boundingRect() const override
\reimp
void setFillRule(Qt::FillRule rule)
Sets the fill rule of the polygon to rule.
QPainterPath opaqueArea() const override
\reimp
QPolygonF polygon() const
Returns the item's polygon, or an empty polygon if no polygon has been set.
bool contains(const QPointF &point) const override
\reimp
Qt::FillRule fillRule() const
Returns the fill rule of the polygon.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
int type() const override
\reimp
bool contains(const QPointF &point) const override
\reimp
QPainterPath shape() const override
\reimp
~QGraphicsRectItem()
Destroys the QGraphicsRectItem.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
QVariant extension(const QVariant &variant) const override
QPainterPath opaqueArea() const override
\reimp
bool supportsExtension(Extension extension) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
\reimp
void setRect(const QRectF &rect)
Sets the item's rectangle to be the given rectangle.
QGraphicsRectItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsRectItem.
QRectF rect() const
Returns the item's rectangle.
void setExtension(Extension extension, const QVariant &variant) override
QRectF boundingRect() const override
\reimp
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)
QPointF pos() const
Returns the position of the mouse cursor in item coordinates at the moment the hover event was sent.
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
QPointF pos() const
Returns the mouse cursor position in item coordinates.
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos)
void setLastPos(const QPointF &pos)
void setPos(const QPointF &pos)
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked.
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)
QPointF pos() const
Returns the position of the cursor in item coordinates when the wheel event occurred.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items.
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
void addItem(QGraphicsItem *item)
Adds or moves the item and all its children to this scene.
void clearSelection()
Clears the current selection.
void setFocusItem(QGraphicsItem *item, Qt::FocusReason focusReason=Qt::OtherFocusReason)
Sets the scene's focus item to item, with the focus reason focusReason, after removing focus from any...
bool sendEvent(QGraphicsItem *item, QEvent *event)
void setActivePanel(QGraphicsItem *item)
QList< QGraphicsItem * > selectedItems() const
Returns a list of all currently selected items.
QGraphicsItem * activePanel() const
QList< QGraphicsView * > views() const
Returns a list of all the views that display this scene.
void update(qreal x, qreal y, qreal w, qreal h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
virtual bool focusNextPrevChild(bool next)
QList< QGraphicsItem * > collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns a list of all items that collide with item.
QGraphicsItem * focusItem() const
When the scene is active, this functions returns the scene's current focus item, or \nullptr if no it...
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or \nullptr if no item is currently grabbing the mouse.
void updateBoundingRect()
QGraphicsSimpleTextItemPrivate()
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsSce...
bool contains(const QPointF &point) const override
\reimp
void setExtension(Extension extension, const QVariant &variant) override
~QGraphicsSimpleTextItem()
Destroys the QGraphicsSimpleTextItem.
QPainterPath shape() const override
\reimp
QFont font() const
Returns the font that is used to draw the item's text.
QGraphicsSimpleTextItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsSimpleTextItem.
void setText(const QString &text)
Sets the item's text to text.
QVariant extension(const QVariant &variant) const override
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
\reimp
void setFont(const QFont &font)
Sets the font that is used to draw the item's text to font.
QString text() const
Returns the item's text.
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
bool supportsExtension(Extension extension) const override
int type() const override
\reimp
QPainterPath opaqueArea() const override
\reimp
QRectF boundingRect() const override
\reimp
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 QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
void setDocument(QTextDocument *document)
Sets the text document document on the item.
void linkHovered(const QString &)
This signal is emitted when the user hovers over a link on a text item that enables Qt::LinksAccessib...
bool contains(const QPointF &point) const override
\reimp
void adjustSize()
Adjusts the text item to a reasonable size.
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
Sets the flags flags to specify how the text item should react to user input.
QTextCursor textCursor() const
This property represents the visible text cursor in an editable text item.
void setHtml(const QString &html)
Sets the item's text to text, assuming that text is HTML formatted.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event) override
\reimp
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event) override
\reimp
void linkActivated(const QString &)
This signal is emitted when the user clicks on a link on a text item that enables Qt::LinksAccessible...
void mousePressEvent(QGraphicsSceneMouseEvent *event) override
\reimp
bool isObscuredBy(const QGraphicsItem *item) const override
\reimp
void focusInEvent(QFocusEvent *event) override
\reimp
QVariant extension(const QVariant &variant) const override
bool openExternalLinks() const
Specifies whether QGraphicsTextItem should automatically open links using QDesktopServices::openUrl()...
QGraphicsTextItem(QGraphicsItem *parent=nullptr)
Constructs a QGraphicsTextItem.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override
\reimp
void setDefaultTextColor(const QColor &c)
Sets the color for unformatted text to col.
QPainterPath opaqueArea() const override
\reimp
void setTextCursor(const QTextCursor &cursor)
void dragMoveEvent(QGraphicsSceneDragDropEvent *event) override
\reimp
Qt::TextInteractionFlags textInteractionFlags() const
Returns the current text interaction flags.
QVariant inputMethodQuery(Qt::InputMethodQuery query) const override
\reimp
bool tabChangesFocus() const
QColor defaultTextColor() const
Returns the default text color that is used for unformatted text.
void focusOutEvent(QFocusEvent *event) override
\reimp
QRectF boundingRect() const override
\reimp
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event) override
\reimp
int type() const override
\reimp
void setOpenExternalLinks(bool open)
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event) override
\reimp
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override
\reimp
void setExtension(Extension extension, const QVariant &variant) override
void dropEvent(QGraphicsSceneDragDropEvent *event) override
\reimp
void inputMethodEvent(QInputMethodEvent *event) override
\reimp
bool sceneEvent(QEvent *event) override
\reimp
QString toHtml() const
Returns the item's text converted to HTML, or an empty QString if no text has been set.
QPainterPath shape() const override
\reimp
void setTextWidth(qreal width)
Sets the preferred width for the item's text.
QFont font() const
Returns the item's font, which is used to render the text.
void setTabChangesFocus(bool b)
void hoverMoveEvent(QGraphicsSceneHoverEvent *event) override
\reimp
QString toPlainText() const
Returns the item's text converted to plain text, or an empty QString if no text has been set.
QTextDocument * document() const
Returns the item's text document.
void keyPressEvent(QKeyEvent *event) override
\reimp
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) override
\reimp
qreal textWidth() const
Returns the text width.
void keyReleaseEvent(QKeyEvent *event) override
\reimp
void setPlainText(const QString &text)
Sets the item's text to text.
bool supportsExtension(Extension extension) const override
void setFont(const QFont &font)
Sets the font used to render the text item to font.
void dragEnterEvent(QGraphicsSceneDragDropEvent *event) override
\reimp
~QGraphicsTextItem()
Destroys the QGraphicsTextItem.
void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override
\reimp
bool updateRect(const QRect &rect)
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
static QInputMethod * inputMethod()
returns the input method.
bool contains(const Key &key) const noexcept
Returns true if the hash contains an item with the key; otherwise returns false.
T value(const Key &key) const noexcept
bool isEmpty() const noexcept
Returns true if the hash contains no items; otherwise returns false.
@ Format_ARGB32_Premultiplied
The QKeyEvent class describes a key event.
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
int key() const
Returns the code of the key that was pressed or released.
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)
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.
bool isSignalConnected(uint signalIdx, bool checkDeclarative=true) const
static QObjectPrivate * get(QObject *o)
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
virtual bool event(QEvent *event)
This virtual function receives events to an object and should return true if the event e was recogniz...
The QPainterPathStroker class is used to generate fillable outlines for a given painter path.
void setCapStyle(Qt::PenCapStyle style)
Sets the cap style of the generated outlines to style.
void setWidth(qreal width)
Sets the width of the generated outline painter path to width.
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path.
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style of the generated outlines to style.
void setMiterLimit(qreal length)
Sets the miter limit of the generated outlines to limit.
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
void addPath(const QPainterPath &path)
Adds the given path to this path as a closed subpath.
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
bool contains(const QPointF &pt) const
Returns true if the given point is inside the path, otherwise returns false.
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
QPainterPath intersected(const QPainterPath &r) const
The QPainter class performs low-level painting on widgets and other paint devices.
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling.
void drawPie(const QRectF &rect, int a, int alen)
Draws a pie defined by the given rectangle, startAngle and spanAngle.
void setPen(const QColor &color)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void drawLine(const QLineF &line)
Draws a line defined by line.
void restore()
Restores the current painter state (pops a saved state off the stack).
const QTransform & worldTransform() const
Returns the world transformation matrix.
void save()
Saves the current painter state (pushes the state onto a stack).
void setFont(const QFont &f)
Sets the painter's font to the given font.
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
const QTransform & transform() const
Alias for worldTransform().
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule=Qt::OddEvenFill)
Draws the polygon defined by the first pointCount points in the array points using the current pen an...
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint.
The QPalette class contains color groups for each widget state.
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
void setColor(ColorGroup cg, ColorRole cr, const QColor &color)
Sets the color in the specified color group, used for the given color role, to the specified solid co...
qreal widthF() const
Returns the pen width with floating point precision.
void setStyle(Qt::PenStyle)
[0]
Qt::PenStyle style() const
Returns the pen style.
The QPixmapCache::Key class can be used for efficient access to the QPixmapCache.
static bool find(const QString &key, QPixmap *pixmap)
Looks for a cached pixmap associated with the given key in the cache.
static void remove(const QString &key)
Removes the pixmap associated with key from the cache.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
int height() const
Returns the height of the pixmap.
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed=nullptr)
QBitmap mask() const
Returns true if this pixmap has an alpha channel, or has a mask, otherwise returns false.
int width() const
Returns the width of the pixmap.
QBitmap createHeuristicMask(bool clipTight=true) const
Creates and returns a heuristic mask for this pixmap.
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
constexpr QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0.0 (ignoring the sign); otherwise returns fa...
\inmodule QtCore\reentrant
The QPolygonF class provides a list of points using floating point precision.
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
QRect toAlignedRect() const noexcept
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QRectF translated(qreal dx, qreal dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
bool contains(const QRectF &r) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
constexpr QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
bool intersects(const QRectF &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e.
constexpr void setSize(const QSizeF &s) noexcept
Sets the size of the rectangle to the given finite size.
constexpr QPointF topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
constexpr QRect toRect() const noexcept
Returns a QRect based on the values of this rectangle.
constexpr void translate(qreal dx, qreal dy) noexcept
Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position.
\inmodule QtCore\reentrant
constexpr bool isEmpty() const noexcept
Returns true if the rectangle is empty, otherwise returns false.
bool intersects(const QRect &r) const noexcept
Returns true if this rectangle intersects with the given rectangle (i.e., there is at least one pixel...
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr QPoint topLeft() const noexcept
Returns the position of the rectangle's top-left corner.
constexpr QRect adjusted(int x1, int y1, int x2, int y2) const noexcept
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr QSize size() const noexcept
Returns the size of the rectangle.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr QRect translated(int dx, int dy) const noexcept
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis,...
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
The QRegion class specifies a clip region for a painter.
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
QRegion translated(int dx, int dy) const
T * data() const noexcept
Returns the value of the pointer referenced by this object.
constexpr qreal height() const noexcept
Returns the height.
\macro QT_RESTRICTED_CAST_FROM_ASCII
QString & replace(qsizetype i, qsizetype len, QChar after)
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem.
\reentrant \inmodule QtGui
\reentrant \inmodule QtGui
QFont defaultFont
the default font used to display the document's text
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
QSizeF pageSize
the page size that should be used for laying out the document
void setDefaultFont(const QFont &font)
Sets the default font to use in the document layout.
QTextFrame * rootFrame() const
Returns the document's root frame.
QTextFrameFormat frameFormat() const
Returns the frame's format.
QPointF toPointF() const
Returns the variant as a QPointF if the variant has userType() \l QMetaType::QPoint or \l QMetaType::...
qreal toReal(bool *ok=nullptr) const
Returns the variant as a qreal if the variant has userType() \l QMetaType::Double,...
QString toString() const
Returns the variant as a QString if the variant has a userType() including, but not limited to:
bool toBool() const
Returns the variant as a bool if the variant has userType() Bool.
QRectF toRectF() const
Returns the variant as a QRectF if the variant has userType() \l QMetaType::QRect or \l QMetaType::QR...
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)
QMap< QString, QString > map
[6]
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static void formatQPoint(QDebug &debug, const Point &point)
@ IntersectsItemBoundingRect
constexpr Initialization Uninitialized
DBusConnection const char * rule
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
bool qFuzzyIsNull(qfloat16 f) noexcept
bool qIsNaN(qfloat16 f) noexcept
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
static void formatGraphicsItemHelper(QDebug debug, const QGraphicsItem *item)
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
static QRectF setupTextLayout(QTextLayout *layout)
static QT_BEGIN_NAMESPACE void _q_adjustRect(QRect *rect)
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)
QDebug operator<<(QDebug debug, const QGraphicsItem *item)
QPainterPath qt_regionToPath(const QRegion ®ion)
static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, const QGraphicsItem *other, const QRectF &rect)
void Q_WIDGETS_EXPORT qt_graphicsItem_highlightSelected(QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qBound(const T &min, const T &val, const T &max)
constexpr const T & qMax(const T &a, const T &b)
constexpr T qAbs(const T &t)
#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
static const QRectF boundingRect(const QPointF *points, int pointCount)
static QT_BEGIN_NAMESPACE qreal dpr(const QWindow *w)
const QQuickItem * rootItem(const I &item)
#define Q_ASSERT_X(cond, x, msg)
file open(QIODevice::ReadOnly)
QFileInfo info(fileName)
[8]
QFileInfo fi("c:/temp/foo")
[newstuff]
QGraphicsOpacityEffect * effect
the effect attached to this item
rect sceneTransform().map(QPointF(0
view viewport() -> scroll(dx, dy, deviceRect)
QNetworkAccessManager manager
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent