745 #ifndef QT_NO_GRAPHICSVIEW 754 #include <QtCore/qbitarray.h> 755 #include <QtCore/qdebug.h> 756 #include <QtCore/qpoint.h> 757 #include <QtCore/qstack.h> 758 #include <QtCore/qtimer.h> 759 #include <QtCore/qvariant.h> 760 #include <QtCore/qvarlengtharray.h> 761 #include <QtCore/qnumeric.h> 762 #include <QtGui/qapplication.h> 763 #include <QtGui/qbitmap.h> 764 #include <QtGui/qpainter.h> 765 #include <QtGui/qpainterpath.h> 766 #include <QtGui/qpixmapcache.h> 767 #include <QtGui/qstyleoption.h> 768 #include <QtGui/qevent.h> 769 #include <QtGui/qinputcontext.h> 770 #include <QtGui/qgraphicseffect.h> 771 #ifndef QT_NO_ACCESSIBILITY 775 #include <private/qgraphicsitem_p.h> 776 #include <private/qgraphicswidget_p.h> 777 #include <private/qtextcontrol_p.h> 778 #include <private/qtextdocumentlayout_p.h> 779 #include <private/qtextengine_p.h> 780 #include <private/qwidget_p.h> 781 #include <private/qapplication_p.h> 784 #include <private/qt_x11_p.h> 785 #include <private/qpixmap_x11_p.h> 788 #include <private/qgesturemanager_p.h> 832 if (pen.widthF() <= 0.0)
860 switch (
int(childFlag)) {
862 flag = AncestorFiltersChildEvents;
863 enabled = q->filtersChildEvents();
866 flag = AncestorHandlesChildEvents;
867 enabled = q->handlesChildEvents();
870 flag = AncestorClipsChildren;
874 flag = AncestorIgnoresTransformations;
883 if ((parent->d_ptr->ancestorFlags & flag)
884 || (
int(parent->d_ptr->flags & childFlag) == childFlag)
885 || (childFlag == -1 && parent->d_ptr->handlesChildEvents)
886 || (childFlag == -2 && parent->d_ptr->filtersDescendantEvents)) {
888 ancestorFlags |= flag;
890 ancestorFlags &= ~flag;
899 if (((ancestorFlags & flag) && enabled) || (!(ancestorFlags & flag) && !enabled))
904 ancestorFlags |= flag;
906 ancestorFlags &= ~flag;
909 if ((childFlag != -1 &&
int(flags & childFlag) == childFlag)
910 || (
int(childFlag) == -1 && handlesChildEvents)
911 || (
int(childFlag) == -2 && filtersDescendantEvents))
915 for (
int i = 0; i < children.size(); ++i)
916 children.at(i)->d_ptr->updateAncestorFlag(childFlag, flag, enabled,
false);
929 flags |= AncestorFiltersChildEvents;
931 flags |= AncestorHandlesChildEvents;
933 flags |= AncestorClipsChildren;
935 flags |= AncestorIgnoresTransformations;
938 if (ancestorFlags == flags)
940 ancestorFlags = flags;
943 for (
int i = 0; i < children.size(); ++i)
944 children.at(i)->d_ptr->updateAncestorFlags();
959 if (!qgraphicsitem_cast<QGraphicsItemGroup *>(q)) {
961 child->d_func()->setIsMemberOfGroup(enabled);
976 switch (event->
type()) {
984 for (
int i = 0x1; i <= 0x10; i <<= 1) {
985 if (mouseEvent->
buttons() & i) {
1023 const QWidget *viewport)
const 1026 if (!itemIsUntransformable())
1027 return q->mapFromScene(pos);
1051 if (viewTransform && itemIsUntransformable()) {
1052 *x = q_ptr->deviceTransform(*viewTransform);
1055 *x *= transformData->computedFullTransform();
1076 if (viewTransform && itemIsUntransformable()) {
1077 *x = q_ptr->deviceTransform(*viewTransform);
1081 *x = transformData->computedFullTransform(x);
1088 Q_ASSERT(!parent->d_ptr->dirtySceneTransform);
1089 if (parent->d_ptr->sceneTransformTranslateOnly) {
1091 parent->d_ptr->sceneTransform.dy() + pos.y());
1093 sceneTransform = parent->d_ptr->sceneTransform;
1094 sceneTransform.
translate(pos.x(), pos.y());
1096 if (transformData) {
1097 sceneTransform = transformData->computedFullTransform(&sceneTransform);
1100 sceneTransformTranslateOnly = parent->d_ptr->sceneTransformTranslateOnly;
1102 }
else if (!transformData) {
1104 sceneTransformTranslateOnly = 1;
1105 }
else if (transformData->onlyTransform) {
1106 sceneTransform = transformData->transform;
1110 }
else if (pos.isNull()) {
1111 sceneTransform = transformData->computedFullTransform();
1115 sceneTransform = transformData->computedFullTransform(&sceneTransform);
1118 dirtySceneTransform = 0;
1151 const QVariant *thisPointerVariant)
1154 if (newParent == parent)
1159 newParent->
isWidget()) ? static_cast<QGraphicsWidget *>(newParent) : 0,
1168 scene->d_func()->setScenePosItemEnabled(q,
false);
1171 if (subFocusItem && parent) {
1173 subFocusItem->d_ptr->clearSubFocus(parent);
1180 q_ptr->prepareGeometryChange();
1184 parent->d_ptr->removeChild(q);
1185 if (thisPointerVariant)
1191 if (scene && !inDestructor) {
1192 if (parent && !newParent) {
1193 scene->d_func()->registerTopLevelItem(q);
1194 }
else if (!parent && newParent) {
1195 scene->d_func()->unregisterTopLevelItem(q);
1209 parentFocusScopeItem = fsi;
1218 if (newParent && (graphicsEffect || mayHaveChildWithGraphicsEffect))
1222 QGraphicsItem *newFocusScopeItem = subFocusItem ? subFocusItem : parentFocusScopeItem;
1223 if (newFocusScopeItem && newParent) {
1227 if (subFocusItem && subFocusItem != q_ptr) {
1231 while (p2 && p2 != p) {
1241 newFocusScopeItem = ancestorScope;
1250 subFocusItem->d_ptr->clearSubFocus();
1258 invalidateDepthRecursively();
1260 if ((parent = newParent)) {
1261 if (parent->d_func()->scene && parent->d_func()->scene != scene) {
1263 parent->d_func()->scene->addItem(q);
1264 }
else if (!parent->d_func()->scene && scene) {
1266 scene->removeItem(q);
1269 parent->d_ptr->addChild(q);
1270 if (thisPointerVariant)
1275 scene->d_func()->setScenePosItemEnabled(q,
true);
1279 markParentDirty(
true);
1282 updateAncestorFlags();
1285 if (parent->d_ptr->visible != visible) {
1286 if (!parent->d_ptr->visible || !explicitlyHidden)
1287 setVisibleHelper(parent->d_ptr->visible,
false,
false);
1289 if (parent->isEnabled() !=
enabled) {
1290 if (!parent->d_ptr->enabled || !explicitlyDisabled)
1291 setEnabledHelper(parent->d_ptr->enabled,
false,
false);
1295 if (visible && parent->isActive())
1299 updateAncestorFlags();
1301 if (!inDestructor) {
1303 if (!visible && !explicitlyHidden)
1304 setVisibleHelper(
true,
false);
1305 if (!
enabled && !explicitlyDisabled)
1306 setEnabledHelper(
true,
false);
1310 dirtySceneTransform = 1;
1311 if (!inDestructor && (transformData || (newParent && newParent->
d_ptr->
transformData)))
1315 if (parentFocusScopeItem)
1320 subFocusItem->d_ptr->setSubFocus(newParent);
1321 if (parent && parent->isActive())
1322 subFocusItem->setFocus();
1326 if (newParentVariant)
1347 rect = &childrenRect;
1348 const bool setTopMostEffectItem = !topMostEffectItem;
1350 for (
int i = 0; i < children.size(); ++i) {
1353 if (setTopMostEffectItem)
1354 topMostEffectItem = child;
1376 *rect &= x->
mapRect(q->boundingRect());
1378 *rect &= q->boundingRect();
1385 const QRegion &exposedRegion,
bool allItems)
const 1391 const QRectF brect = q->boundingRect();
1403 if (scene->d_func()->hoverItems.contains(q_ptr))
1405 if (q == scene->mouseGrabberItem())
1420 for (
int i = 0; i < exposedRects.size(); ++i) {
1441 QMutableMapIterator<QPaintDevice *, DeviceData>
it(deviceData);
1442 while (it.hasNext()) {
1472 if (
scene && parent && parent->scene() !=
scene) {
1473 qWarning(
"QGraphicsItem::QGraphicsItem: ignoring scene (%p), which is" 1474 " different from parent's scene (%p)",
1475 scene, parent->scene());
1478 if (
scene && !parent)
1492 if (scene && parent && parent->
scene() !=
scene) {
1493 qWarning(
"QGraphicsItem::QGraphicsItem: ignoring scene (%p), which is" 1494 " different from parent's scene (%p)",
1495 scene, parent->
scene());
1498 if (scene && !parent)
1525 #ifndef QT_NO_GESTURES 1530 manager->cleanupCachedGestures(o, type);
1555 d_ptr->
scene->d_func()->removeItemHelper(
this);
1561 #ifndef QT_NO_GRAPHICSEFFECT 1563 #endif //QT_NO_GRAPHICSEFFECT 1574 dataStore->data.remove(
this);
1684 return (p && p->
isWidget()) ? static_cast<QGraphicsWidget *>(p) : 0;
1721 return static_cast<QGraphicsWidget *>(p);
1788 if (newParent ==
this) {
1789 qWarning(
"QGraphicsItem::setParentItem: cannot assign %p as a parent of itself",
this);
1796 QVariant::fromValue<QGraphicsItem *>(newParent)));
1801 const QVariant thisPointerVariant(QVariant::fromValue<QGraphicsItem *>(
this));
1920 if (item->
flags() & flag) {
1958 bool fullUpdate = (
quint32(flags) & geomChangeFlagsMask) != (
d_ptr->
flags & geomChangeFlagsMask);
1963 GraphicsItemFlags oldFlags = GraphicsItemFlags(
d_ptr->
flags);
2017 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
2023 d_ptr->
scene->d_func()->updateInputMethodSensitivityInViews();
2029 && (flags &
ItemIsPanel) != (oldFlags & ItemIsPanel)) {
2031 if (flags & ItemIsPanel)
2039 if (flags & ItemSendsScenePositionChanges)
2040 d_ptr->
scene->d_func()->registerScenePosItem(
this);
2042 d_ptr->
scene->d_func()->unregisterScenePosItem(
this);
2115 if (lastMode == mode && cache->
fixedSize == logicalCacheSize)
2116 noVisualChange =
true;
2120 if (!noVisualChange)
2154 if (enterLeaveModal && panelModality ==
NonModal)
2158 d_ptr->
scene->d_func()->enterModal(
this, previousModality);
2183 blockingPanel = &dummy;
2197 if (modalPanel !=
this && !modalPanel->
isAncestorOf(
this)) {
2198 *blockingPanel = modalPanel;
2203 if (modalPanel !=
this 2206 *blockingPanel = modalPanel;
2214 #ifndef QT_NO_TOOLTIP 2238 #endif // QT_NO_TOOLTIP 2240 #ifndef QT_NO_CURSOR 2282 d_ptr->
scene->d_func()->allItemsUseDefaultCursor =
false;
2333 #endif // QT_NO_CURSOR 2393 explicitlyHidden = newVisible ? 0 : 1;
2396 if (visible ==
quint32(newVisible))
2400 if (parent && newVisible && !parent->d_ptr->visible)
2406 newVisible = newVisibleVariant.
toBool();
2407 if (visible ==
quint32(newVisible))
2409 visible = newVisible;
2417 #ifndef QT_NO_GRAPHICSEFFECT 2418 invalidateParentGraphicsEffectsRecursively();
2419 #endif //QT_NO_GRAPHICSEFFECT 2420 scene->d_func()->markDirty(q_ptr,
QRectF(),
false,
true);
2428 if (
scene->d_func()->mouseGrabberItems.contains(q))
2430 if (
scene->d_func()->keyboardGrabberItems.contains(q))
2431 q->ungrabKeyboard();
2433 scene->d_func()->leaveModal(q_ptr);
2435 if (hasFocus &&
scene) {
2440 if (focusItem == q_ptr) {
2447 if (q_ptr->hasFocus())
2448 clearFocusHelper(
false);
2450 if (q_ptr->isSelected())
2453 geometryChanged = 1;
2454 paintedViewBoundingRectsNeedRepaint = 1;
2459 scene->d_func()->addPopup(widget);
2462 scene->d_func()->enterModal(q_ptr);
2476 if (
scene && q->isPanel()) {
2478 if (parent && parent->isActive())
2622 explicitlyDisabled = newEnabled ? 0 : 1;
2631 q_ptr->ungrabMouse();
2632 if (q_ptr->hasFocus()) {
2636 if (
isWidget && !focusItem->
isPanel() && q_ptr->isAncestorOf(focusItem)) {
2638 if (focusItem == q_ptr) {
2645 if (q_ptr->hasFocus())
2648 if (q_ptr->isSelected())
2649 q_ptr->setSelected(
false);
2655 enabled = newEnabledVariant.toBool();
2757 bool newSelected = newSelectedVariant.
toBool();
2869 #ifndef QT_NO_GRAPHICSEFFECT 2873 #endif //QT_NO_GRAPHICSEFFECT 2878 if (wasFullyTransparent)
2891 #ifndef QT_NO_GRAPHICSEFFECT 2928 effect->d_func()->setGraphicsEffectSource(source);
2932 #endif //QT_NO_GRAPHICSEFFECT 2936 #ifndef QT_NO_GRAPHICSEFFECT 2962 #ifndef QT_NO_GRAPHICSEFFECT 2968 QRectF sceneRect = q->mapRectToScene(rect);
2971 QRectF deviceRect = view->d_func()->mapRectFromScene(sceneRect);
2973 sceneEffectRect |= view->d_func()->mapRectToScene(deviceEffectRect);
2975 return q->mapRectFromScene(sceneEffectRect);
2977 #endif //QT_NO_GRAPHICSEFFECT 2996 #ifndef QT_NO_GRAPHICSEFFECT 2998 QRectF brect = effectiveBoundingRect(q_ptr->boundingRect());
3003 while (effectParent) {
3006 const QRectF brectInParentSpace = q->mapRectToItem(effectParent, brect);
3008 brect = effectParent->
mapRectToItem(q, effectRectInParentSpace);
3011 || topMostEffectItem == effectParent) {
3018 #else //QT_NO_GRAPHICSEFFECT 3019 return q_ptr->boundingRect();
3020 #endif //QT_NO_GRAPHICSEFFECT 3049 offset += itemd->
pos;
3050 }
while ((parentItem = itemd->
parent));
3052 QRectF br = effectiveBoundingRect();
3116 &&
d_ptr->
scene->d_func()->lastMouseGrabberItemHasImplicitMouseGrab) {
3193 d_ptr->
scene->d_func()->allItemsIgnoreHoverEvents =
false;
3194 d_ptr->
scene->d_func()->enableMouseTrackingOnViews();
3242 d_ptr->
scene->d_func()->allItemsIgnoreTouchEvents =
false;
3243 d_ptr->
scene->d_func()->enableTouchEventsOnViews();
3471 if (oldFocusScopeItem)
3473 focusScopeItemChange(
true);
3474 if (!p->
focusItem() && !focusFromHide) {
3505 scene->d_func()->setFocusItemHelper(f, focusReason);
3537 if (giveFocusToParent) {
3539 if (!inDestructor) {
3546 focusScopeItemChange(
false);
3560 clearSubFocus(q_ptr);
3610 qWarning(
"QGraphicsItem::setFocusProxy: cannot assign self as focus proxy");
3615 qWarning(
"QGraphicsItem::setFocusProxy: focus proxy must be in same scene");
3620 qWarning(
"QGraphicsItem::setFocusProxy: %p is already in the focus proxy chain", item);
3704 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse without scene");
3708 qWarning(
"QGraphicsItem::grabMouse: cannot grab mouse while invisible");
3726 qWarning(
"QGraphicsItem::ungrabMouse: cannot ungrab mouse without scene");
3772 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard without scene");
3776 qWarning(
"QGraphicsItem::grabKeyboard: cannot grab keyboard while invisible");
3794 qWarning(
"QGraphicsItem::ungrabKeyboard: cannot ungrab keyboard without scene");
3797 d_ptr->
scene->d_func()->ungrabKeyboard(
this);
3908 q->prepareGeometryChange();
3911 dirtySceneTransform = 1;
3914 if (pos.
x() != oldPos.
x())
3915 emit static_cast<QGraphicsObject *>(q_ptr)->xChanged();
3916 if (pos.
y() != oldPos.
y())
3917 emit static_cast<QGraphicsObject *>(q_ptr)->yChanged();
3931 q_ptr->prepareGeometryChange();
3933 dirtySceneTransform = 1;
3959 static_cast<QGraphicsWidget *
>(
this)->d_func()->setGeometryFromSetPos();
4128 newRotation = newRotationVariant.
toReal();
4195 qreal newScale = factor;
4200 newScale = newScaleVariant.
toReal();
4278 for (
int i = 0; i < transformations.
size(); ++i)
4279 transformations.
at(i)->d_func()->setItem(
this);
4292 if (!transformData->graphicsTransforms.contains(t))
4296 t->d_func()->setItem(q);
4297 transformData->onlyTransform =
false;
4298 dirtySceneTransform = 1;
4309 if (!transformData->graphicsTransforms.contains(t))
4313 t->d_func()->setItem(q);
4314 transformData->onlyTransform =
false;
4315 dirtySceneTransform = 1;
4356 QVariant::fromValue<QPointF>(origin)));
4357 newOrigin = newOriginVariant.
toPointF();
4476 parents.
prepend(untransformedAncestor);
4477 untransformedAncestor = untransformedAncestor->
parentItem();
4480 if (!untransformedAncestor) {
4482 Q_ASSERT_X(untransformedAncestor,
"QGraphicsItem::deviceTransform",
4483 "Invalid object structure!");
4492 if (parentOfUntransformedAncestor)
4493 inheritedMatrix = parentOfUntransformedAncestor->
sceneTransform();
4494 QPointF mappedPoint = (inheritedMatrix * viewportTransform).
map(untransformedAncestor->
pos());
4502 for (
int i = 0; i < parents.
size(); ++i) {
4534 qWarning(
"QGraphicsItem::itemTransform: null pointer passed");
4537 if (other ==
this) {
4547 if (parent == other) {
4556 if (otherParent ==
this) {
4569 if (parent == otherParent) {
4574 QPointF delta = itemPos - otherPos;
4584 return itemToParent * otherToParent.
inverted(ok);
4590 if (!commonAncestor) {
4598 bool cousins = other != commonAncestor &&
this != commonAncestor;
4610 return thisToScene * otherToScene.
inverted(ok);
4660 const QVariant newMatrixVariant = QVariant::fromValue<QMatrix>(newTransform.
toAffine());
4715 QVariant::fromValue<QTransform>(newTransform)));
4930 d_ptr->
scene->d_func()->needSortTopLevelItems = 1;
4958 if (!sequentialOrdering) {
4960 sequentialOrdering = 1;
4961 needSortChildren = 1;
4963 if (holesInSiblingIndex) {
4964 holesInSiblingIndex = 0;
4979 if (scenePosDescendants) {
4981 if (q->isAncestorOf(item))
5009 if (sibling ==
this)
5012 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
5019 qWarning(
"QGraphicsItem::stackUnder: cannot stack under %p, which must be a sibling", sibling);
5028 d_ptr->
scene->d_func()->ensureSequentialTopLevelSiblingIndexes();
5033 if (myIndex >= siblingIndex) {
5034 siblings->
move(myIndex, siblingIndex);
5036 for (
int i = 0; i < siblings->
size(); ++i) {
5038 if (i != siblingIndex && index >= siblingIndex && index <= myIndex)
5042 for (
int i = 0; i < siblings->
size(); ++i) {
5044 if (i != siblingIndex && index >= siblingIndex && index <= myIndex)
5132 offset += itemd->
pos;
5133 }
while ((parentItem = itemd->
parent));
5222 if (thisBoundingRect.
isEmpty())
5227 clip.
addRect(thisBoundingRect);
5241 lastParent = parent;
5248 if (lastParent !=
this) {
5317 if (clips || otherClips) {
5320 closestClipper = closestClipper->
parentItem();
5323 otherClosestClipper = otherClosestClipper->
parentItem();
5324 if (closestClipper == otherClosestClipper) {
5558 if (granularity == 0.0)
5562 QSize bitmapSize(
qMax(1,
int(deviceRect.
width() * granularity) + pad * 2),
5563 qMax(1,
int(deviceRect.
height() * granularity) + pad * 2));
5573 p.
scale(granularity, granularity);
5590 r += xrect.
adjusted(-1, -1, 1, 1) & deviceRect;
5642 if (granularity < 0.0 || granularity > 1.0) {
5643 qWarning(
"QGraphicsItem::setBoundingRegionGranularity: invalid granularity %g", granularity);
5646 if (granularity == 0.0) {
5653 QVariant::fromValue<qreal>(granularity));
5698 bool ignoreOpacity)
const 5703 || (!visible && !ignoreVisibleBit && !this->ignoreVisible)
5704 || (!ignoreDirtyBit && fullUpdatePending)
5705 || (!ignoreOpacity && !this->ignoreOpacity && childrenCombineOpacity() && isFullyTransparent());
5713 if (itemDepth == -1)
5722 #ifndef QT_NO_GRAPHICSEFFECT 5736 if (!mayHaveChildWithGraphicsEffect)
5751 #endif //QT_NO_GRAPHICSEFFECT 5758 if (itemDepth == -1)
5779 if (parent->d_ptr->itemDepth == -1)
5780 parent->d_ptr->resolveDepth();
5781 itemDepth = parent->d_ptr->itemDepth + 1;
5798 ensureSequentialSiblingIndex();
5799 needSortChildren = 1;
5819 if (!holesInSiblingIndex)
5821 if (sequentialOrdering && !holesInSiblingIndex)
5850 that->
setExtra(ExtraCacheData, QVariant::fromValue<void *>(c));
5865 unsetExtra(ExtraCacheData);
5875 QRect rect = paintedViewBoundingRects.value(viewPrivate->
viewport);
5880 if (updateChildren) {
5895 if (dirtySceneTransform)
5896 *topMostDirtyItem = q_ptr;
5901 if (*topMostDirtyItem == q_ptr) {
5902 if (!dirtySceneTransform)
5904 *topMostDirtyItem = 0;
5905 }
else if (*topMostDirtyItem) {
5913 invalidateChildrenSceneTransform();
5916 updateSceneTransformFromParent();
5943 scene->d_func()->passiveFocusItem = subFocusItem;
5944 scene->d_func()->lastFocusItem = subFocusItem;
5959 if (parent != stopItem && !parent->
isAncestorOf(stopItem))
5975 for (
int i = 0; i < focusProxyRefs.size(); ++i)
5976 *focusProxyRefs.at(i) = 0;
5977 focusProxyRefs.clear();
6054 #ifndef QT_NO_GRAPHICSEFFECT 6056 #endif //QT_NO_GRAPHICSEFFECT 6058 #ifndef QT_NO_GRAPHICSEFFECT 6076 #ifndef QT_NO_GRAPHICSEFFECT 6081 d_ptr->
scene->d_func()->markDirty(
this, rect);
6117 if (dx == 0.0 && dy == 0.0)
6180 for (
int i = 0; i < exposedRects.
size(); ++i)
6185 d->scene->d_func()->markDirty(
this, rect);
6874 if (!child || child ==
this)
6880 if (ancestor ==
this)
6907 while (thisDepth > otherDepth) {
6911 while (otherDepth > thisDepth) {
6915 while (thisw && thisw != otherw) {
6964 return store->
data.
value(
this).value(key);
6978 qt_dataStore()->data[
this][
key] = value;
7040 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed" 7041 " on items in a scene.");
7045 qWarning(
"QGraphicsItem::installSceneEventFilter: event filters can only be installed" 7046 " on items in the same scene.");
7049 d_ptr->
scene->d_func()->installSceneEventFilter(
this, filterItem);
7061 d_ptr->
scene->d_func()->removeSceneEventFilter(
this, filterItem);
7134 switch (event->
type()) {
7142 dragEnterEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));
7145 dragMoveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));
7148 dragLeaveEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));
7151 dropEvent(static_cast<QGraphicsSceneDragDropEvent *>(event));
7175 wheelEvent(static_cast<QGraphicsSceneWheelEvent *>(event));
7185 res =
static_cast<QGraphicsWidget *
>(
this)->focusNextPrevChild(
false);
7280 if (
d->isProxyWidget())
7281 static_cast<QGraphicsProxyWidget*>(
this)->dragEnterEvent(event);
7304 if (
d->isProxyWidget())
7305 static_cast<QGraphicsProxyWidget*>(
this)->dragLeaveEvent(event);
7331 if (
d->isProxyWidget())
7332 static_cast<QGraphicsProxyWidget*>(
this)->dragMoveEvent(event);
7353 if (
d->isProxyWidget())
7354 static_cast<QGraphicsProxyWidget*>(
this)->dropEvent(event);
7499 ++
scene->d_func()->selectionChanging;
7501 --
scene->d_func()->selectionChanging;
7564 initialPositions =
d_ptr->
scene->d_func()->movingItemsInitialPositions;
7565 if (initialPositions.
isEmpty()) {
7567 initialPositions[item] = item->
pos();
7568 initialPositions[
this] =
pos();
7570 d_ptr->
scene->d_func()->movingItemsInitialPositions = initialPositions;
7580 bool movedMe =
false;
7581 while (i <= selectedItems.
size()) {
7583 if (i < selectedItems.
size())
7584 item = selectedItems.
at(i);
7616 QTransform viewToParentTransform = itemTransform
7626 item->
setPos(initialPositions.
value(item) + currentParentPos - buttonDownParentPos);
7667 bool selectionChanged =
false;
7669 ++
scene->d_func()->selectionChanging;
7677 selectionChanged =
true;
7685 --
scene->d_func()->selectionChanging;
7686 if (selectionChanged)
7812 d->scene->d_func()->updateInputMethodSensitivityInViews();
7813 #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) 7820 inputContext->update();
7833 #if !defined(QT_NO_IM) && (defined(Q_WS_X11) || defined(Q_WS_QWS) || defined(Q_OS_SYMBIAN)) 7839 inputContext->update();
7840 #ifndef QT_NO_ACCESSIBILITY 7984 d_ptr->
scene->d_func()->dirtyGrowingItemsBoundingRect =
true;
8036 switch (item->
type()) {
8058 const qreal pad = itemPenWidth / 2;
8060 const qreal penWidth = 0;
8064 fgcolor.
red() > 127 ? 0 : 255,
8065 fgcolor.
green() > 127 ? 0 : 255,
8066 fgcolor.
blue() > 127 ? 0 : 255);
8125 #ifndef QT_NO_GESTURES 8149 #endif // QT_NO_GESTURES 8216 children_count, children_at, children_clear);
8682 if (
d->brush == brush)
8702 if (
d->brush.isOpaque())
8803 if (
d->path == path)
8817 if (
d->boundingRect.isNull()) {
8820 d->boundingRect =
d->path.controlPointRect();
8825 return d->boundingRect;
9040 if (
d->rect == rect)
9070 if (
d->boundingRect.isNull()) {
9072 d->boundingRect =
d->rect;
9074 d->boundingRect.adjust(-halfpw, -halfpw, halfpw, halfpw);
9076 return d->boundingRect;
9204 : startAngle(0), spanAngle(360 * 16)
9298 if (
d->rect == rect)
9316 return d->startAngle;
9329 if (angle !=
d->startAngle) {
9348 return d->spanAngle;
9362 if (angle !=
d->spanAngle) {
9376 if (
d->boundingRect.isNull()) {
9378 if (pw == 0.0 &&
d->spanAngle == 360 * 16)
9379 d->boundingRect =
d->rect;
9383 return d->boundingRect;
9393 if (
d->rect.isNull())
9395 if (
d->spanAngle != 360 * 16) {
9396 path.
moveTo(
d->rect.center());
9423 if ((
d->spanAngle != 0) && (
qAbs(
d->spanAngle) % (360 * 16) == 0))
9426 painter->
drawPie(
d->rect,
d->startAngle,
d->spanAngle);
9584 if (
d->polygon == polygon)
9613 if (rule !=
d->fillRule) {
9625 if (
d->boundingRect.isNull()) {
9628 d->boundingRect =
d->polygon.boundingRect();
9632 return d->boundingRect;
9861 if (
d->line == line)
9887 if (
d->pen.widthF() == 0.0) {
9888 const qreal x1 =
d->line.p1().x();
9889 const qreal x2 =
d->line.p2().x();
9890 const qreal y1 =
d->line.p1().y();
9891 const qreal y2 =
d->line.p2().y();
9896 return QRectF(lx, ty, rx - lx, by - ty);
10070 switch (shapeMode) {
10083 #ifndef QT_NO_IMAGE_HEURISTIC_MASK 10144 d->hasShape =
false;
10170 return d->transformationMode;
10187 if (mode !=
d->transformationMode) {
10188 d->transformationMode = mode;
10214 if (
d->offset == offset)
10218 d->hasShape =
false;
10238 if (
d->pixmap.isNull())
10242 return QRectF(
d->offset,
d->pixmap.size()).adjusted(-pw/2, -pw/2, pw/2, pw/2);
10244 return QRectF(
d->offset,
d->pixmap.size());
10254 if (!
d->hasShape) {
10259 return d_func()->shape;
10320 return d_func()->shapeMode;
10332 if (
d->shapeMode == mode)
10334 d->shapeMode = mode;
10335 d->hasShape =
false;
10407 : control(0), pageNumber(0), useDefaultImpl(false), tabChangesFocus(false), clickCausedFocus(0)
10416 {
if (control) control->
processEvent(e, controlOffset()); }
10418 void _q_updateBoundingRect(
const QSizeF &);
10420 void _q_ensureVisible(
QRectF);
10491 #ifndef QT_NO_TEXTHTMLPARSER 10741 switch (event->
type()) {
10791 }
else if (event->
buttons() ==
event->button()
10827 && !
event->buttons()) {
11037 if (!control)
return;
11038 const QSizeF pageSize = control->document()->pageSize();
11042 qq->prepareGeometryChange();
11052 if (qq->hasFocus()) {
11054 qq->ensureVisible(rect, 0, 0);
11076 const QSizeF pgSize = control->document()->pageSize();
11077 if (pgSize.
height() != -1) {
11078 qq->prepareGeometryChange();
11094 path.
addRect(qq->boundingRect());
11099 qq->boundingRect().adjusted(
11266 void updateBoundingRect();
11276 qreal maxWidth = 0;
11278 for (
int i = 0; i < layout->
lineCount(); ++i) {
11284 return QRectF(0, 0, maxWidth, y);
11291 if (
text.isEmpty()) {
11301 q->prepareGeometryChange();
11393 if (
d->text == text)
11396 d->updateBoundingRect();
11416 d->updateBoundingRect();
11434 return d->boundingRect;
11454 return d->boundingRect.contains(point);
11647 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add null item");
11650 if (item ==
this) {
11651 qWarning(
"QGraphicsItemGroup::addToGroup: cannot add a group to itself");
11660 qWarning(
"QGraphicsItemGroup::addToGroup: could not find a valid transformation from item to group coordinates");
11676 for (
int i = 0; i < transformList.
size(); ++i)
11679 newItemTransform.
translate(origin.
x(), origin.
y());
11682 newItemTransform.
translate(-origin.
x(), -origin.
y());
11687 item->d_func()->setIsMemberOfGroup(
true);
11705 qWarning(
"QGraphicsItemGroup::removeFromGroup: cannot remove null item");
11732 for (
int i = 0; i < transformList.
size(); ++i)
11738 itemTransform.
translate(-origin.
x(), -origin.
y());
11743 item->d_func()->setIsMemberOfGroup(item->
group() != 0);
11761 return d->itemsBoundingRect;
11774 painter->
drawRect(
d->itemsBoundingRect);
11802 #ifndef QT_NO_GRAPHICSEFFECT 11806 if (!
info && deviceCoordinates) {
11808 qWarning(
"QGraphicsEffectSource::boundingRect: Not yet implemented, lacking device context");
11812 QRectF rect = item->boundingRect();
11813 if (!item->d_ptr->children.isEmpty())
11814 rect |= item->childrenBoundingRect();
11816 if (deviceCoordinates) {
11818 rect =
info->painter->worldTransform().mapRect(rect);
11827 qWarning(
"QGraphicsEffectSource::draw: Can only begin as a result of QGraphicsEffect::draw");
11833 if (painter ==
info->painter) {
11834 scened->
draw(item, painter,
info->viewTransform,
info->transformPtr,
info->exposedRegion,
11835 info->widget,
info->opacity,
info->effectTransform,
info->wasDirtySceneTransform,
11838 QTransform effectTransform =
info->painter->worldTransform().inverted();
11840 scened->
draw(item, painter,
info->viewTransform,
info->transformPtr,
info->exposedRegion,
11841 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11857 effectRectF = item->graphicsEffect()->boundingRectFor(deviceRect);
11859 *unpadded = (effectRectF.
size() == sourceRect.
size());
11861 effectRectF =
info->painter->worldTransform().inverted().mapRect(effectRectF);
11864 effectRectF = item->graphicsEffect()->boundingRectFor(sourceRect);
11868 effectRectF = sourceRect.
adjusted(-1.5, -1.5, 1.5, 1.5);
11870 effectRectF = sourceRect;
11882 if (!
info && deviceCoordinates) {
11884 qWarning(
"QGraphicsEffectSource::pixmap: Not yet implemented, lacking device context");
11887 if (!item->d_ptr->scene)
11893 QRect effectRect = paddedEffectRect(system, mode, sourceRect, &unpadded);
11896 *offset = effectRect.
topLeft();
11898 bool untransformed = !deviceCoordinates
11900 if (untransformed && unpadded && isPixmap()) {
11915 if (deviceCoordinates &&
info->effectTransform)
11916 effectTransform *= *
info->effectTransform;
11922 newEffectTransform *= effectTransform;
11923 scened->
draw(item, &pixmapPainter, 0, &sceneTransform, 0, 0,
qreal(1.0),
11924 &newEffectTransform,
false,
true);
11925 }
else if (deviceCoordinates) {
11927 scened->
draw(item, &pixmapPainter,
info->viewTransform,
info->transformPtr, 0,
11928 info->widget,
info->opacity, &effectTransform,
info->wasDirtySceneTransform,
11933 newEffectTransform *= effectTransform;
11934 scened->
draw(item, &pixmapPainter,
info->viewTransform,
info->transformPtr, 0,
11935 info->widget,
info->opacity, &newEffectTransform,
info->wasDirtySceneTransform,
11939 pixmapPainter.
end();
11943 #endif //QT_NO_GRAPHICSEFFECT 11945 #ifndef QT_NO_DEBUG_STREAM 11949 debug <<
"QGraphicsItem(0)";
11954 debug << o->metaObject()->className();
11956 debug <<
"QGraphicsItem";
11957 debug <<
"(this =" << (
void*)item
11958 <<
", parent =" << (
void*)item->
parentItem()
11959 <<
", pos =" << item->
pos()
11960 <<
", z =" << item->
zValue() <<
", flags = " 11961 << item->
flags() <<
")";
11968 debug <<
"QGraphicsObject(0)";
11976 <<
", pos = " << item->
pos()
11977 <<
", z = " << item->
zValue() <<
", flags = " 11978 << item->
flags() <<
')';
11979 return debug.
space();
11984 const char *str =
"UnknownChange";
11987 str =
"ItemChildAddedChange";
11990 str =
"ItemChildRemovedChange";
11993 str =
"ItemCursorChange";
11996 str =
"ItemCursorHasChanged";
11999 str =
"ItemEnabledChange";
12002 str =
"ItemEnabledHasChanged";
12005 str =
"ItemFlagsChange";
12008 str =
"ItemFlagsHaveChanged";
12011 str =
"ItemMatrixChange";
12014 str =
"ItemParentChange";
12017 str =
"ItemParentHasChanged";
12020 str =
"ItemPositionChange";
12023 str =
"ItemPositionHasChanged";
12026 str =
"ItemSceneChange";
12029 str =
"ItemSceneHasChanged";
12032 str =
"ItemSelectedChange";
12035 str =
"ItemSelectedHasChanged";
12038 str =
"ItemToolTipChange";
12041 str =
"ItemToolTipHasChanged";
12044 str =
"ItemTransformChange";
12047 str =
"ItemTransformHasChanged";
12050 str =
"ItemVisibleChange";
12053 str =
"ItemVisibleHasChanged";
12056 str =
"ItemZValueChange";
12059 str =
"ItemZValueHasChanged";
12062 str =
"ItemOpacityChange";
12065 str =
"ItemOpacityHasChanged";
12068 str =
"ItemScenePositionHasChanged";
12071 str =
"ItemRotationChange";
12074 str =
"ItemRotationHasChanged";
12077 str =
"ItemScaleChange";
12080 str =
"ItemScaleHasChanged";
12083 str =
"ItemTransformOriginPointChange";
12086 str =
"ItemTransformOriginPointHasChanged";
12095 const char *str =
"UnknownFlag";
12098 str =
"ItemIsMovable";
12101 str =
"ItemIsSelectable";
12104 str =
"ItemIsFocusable";
12107 str =
"ItemClipsToShape";
12110 str =
"ItemClipsChildrenToShape";
12113 str =
"ItemIgnoresTransformations";
12116 str =
"ItemIgnoresParentOpacity";
12119 str =
"ItemDoesntPropagateOpacityToChildren";
12122 str =
"ItemStacksBehindParent";
12125 str =
"ItemUsesExtendedStyleOption";
12128 str =
"ItemHasNoContents";
12131 str =
"ItemSendsGeometryChanges";
12134 str =
"ItemAcceptsInputMethod";
12137 str =
"ItemNegativeZStacksBehindParent";
12140 str =
"ItemIsPanel";
12143 str =
"ItemIsFocusScope";
12146 str =
"ItemSendsScenePositionChanges";
12149 str =
"ItemStopsClickFocusPropagation";
12152 str =
"ItemStopsFocusHandling";
12163 for (
int i = 0; i < 17; ++i) {
12164 if (flags & (1 << i)) {
12179 #include "moc_qgraphicsitem.cpp" 12181 #endif // QT_NO_GRAPHICSVIEW The QVariant class acts like a union for the most common Qt data types.
friend class QGraphicsItemEffectSourcePrivate
void unsetExtra(Extra type)
bool contains(const QPointF &point) const
Reimplemented Function
T qobject_cast(QObject *object)
The QPainter class performs low-level painting on widgets and other paint devices.
void updateMicroFocus()
Updates the item's micro focus.
The QDebug class provides an output stream for debugging information.
The QColor class provides colors based on RGB, HSV or CMYK values.
bool filtersChildEvents() const
Returns true if this item filters child events (i.
QSizeF pageSize
the page size that should be used for laying out the document
void setAdditionalFormats(const QList< FormatRange > &overrides)
Sets the additional formats supported by the text layout to formatList.
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
bool isClipped() const
Returns true if this item is clipped.
void setFocusProxy(QGraphicsItem *item)
Sets the item's focus proxy to item.
void setFont(const QFont &font)
Sets the font that is used to draw the item's text to font.
QRectF effectiveBoundingRect(QGraphicsItem *topMostEffectItem=0) const
Returns the effective bounding rect of the item.
quint32 explicitlyDisabled
QGraphicsPixmapItem::ShapeMode shapeMode
void appendGraphicsTransform(QGraphicsTransform *t)
void clear()
Removes and deletes all items from the scene, but otherwise leaves the state of the scene unchanged...
QPointF transformOriginPoint() const
Returns the origin point for the transformation in item coordinates.
Qt::TextInteractionFlags textInteractionFlags() const
Returns the current text interaction flags.
bool isEmpty() const
Returns true if either there are no elements in this path, or if the only element is a MoveToElement;...
static void updateAccessibility(QObject *, int who, Event reason)
Notifies accessibility clients about a change in object's accessibility information.
void setShapeMode(ShapeMode mode)
Sets the item's shape mode to mode.
The QTextLayout::FormatRange structure is used to apply extra formatting information for a specified ...
quint32 sendParentChangeNotification
void setParentItemHelper(QGraphicsItem *parent, const QVariant *newParentVariant, const QVariant *thisPointerVariant)
Make sure not to trigger any pure virtual function calls (e.
The QGraphicsScene class provides a surface for managing a large number of 2D graphical items...
QRectF sceneEffectiveBoundingRect() const
Returns the effective bounding rect of this item in scene coordinates, by combining sceneTransform() ...
void setPen(const QPen &pen)
Sets the item's pen to pen.
bool hasFocus() const
Returns true if this item is active, and it or its focus proxy has keyboard input focus; otherwise...
void drawPath(const QPainterPath &path)
Draws the given painter path using the current pen for outline and the current brush for filling...
void setExtension(Extension extension, const QVariant &variant)
void setStartAngle(int angle)
Sets the start angle for an ellipse segment to angle, which is in 16ths of a degree.
The QKeyEvent class describes a key event.
void addPath(const QPainterPath &path)
Adds the given path to this path as a closed subpath.
void setTextOutline(const QPen &pen)
Sets the pen used to draw the outlines of characters to the given pen.
QGraphicsItem * subFocusItem
void setPlainText(const QString &text)
QPoint screenPos() const
Returns the mouse cursor position in screen coordinates.
virtual bool sceneEvent(QEvent *event)
This virtual function receives events to this item.
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QGraphicsItem * focusScopeItem() const
Returns this item's focus scope item.
quint32 handlesChildEvents
void drawPie(const QRectF &rect, int a, int alen)
Draws a pie defined by the given rectangle, startAngle and and spanAngle.
void invalidateParentGraphicsEffectsRecursively()
void sendControlEvent(QEvent *e)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
void setSpanAngle(int angle)
Sets the span angle for an ellipse segment to angle, which is in 16ths of a degree.
QGraphicsItem * focusItem() const
If this item, a child or descendant of this item currently has input focus, this function will return...
The QCursor class provides a mouse cursor with an arbitrary shape.
static mach_timebase_info_data_t info
QGraphicsItem * commonAncestorItem(const QGraphicsItem *other) const
Returns the closest common ancestor item of this item and other, or 0 if either other is 0...
static void children_clear(QDeclarativeListProperty< QGraphicsObject > *list)
QGraphicsPolygonItem(QGraphicsItem *parent=0)
Constructs a QGraphicsPolygonItem.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
QPointF mapToScene(const QPoint &point) const
Returns the viewport coordinate point mapped to scene coordinates.
QGraphicsWidget * parentWidget() const
Returns a pointer to the item's parent widget.
const QTransform & transform() const
Returns the world transformation matrix.
QPainterPath shape() const
Reimplemented Function
#define QT_END_NAMESPACE
This macro expands to.
~QGraphicsSimpleTextItem()
Destroys the QGraphicsSimpleTextItem.
QGraphicsEffect * graphicsEffect() const
Returns a pointer to this item's effect if it has one; otherwise 0.
const QColor & color() const
Returns the brush color.
The QGraphicsRectItem class provides a rectangle item that you can add to a QGraphicsScene.
QRectF childrenBoundingRect() const
Returns the bounding rect of this item's descendants (i.e., its children, their children, etc.) in local coordinates.
void resolveDepth()
Resolves the stacking depth of this object and all its ancestors.
QPointF toPointF() const
Returns the variant as a QPointF if the variant has type() Point or PointF ; otherwise returns a null...
void setLine(const QLineF &line)
Sets the item's line to be the given line.
void setBoundingRegionGranularity(qreal granularity)
Sets the bounding region granularity to granularity; a value between and including 0 and 1...
void setPosition(const QPointF &pos)
Moves the line to position pos.
void setExtension(Extension extension, const QVariant &variant)
bool acceptDrops() const
Returns true if this item can accept drag and drop events; otherwise, returns false.
int width() const
Returns the width of the pixmap.
QGraphicsItem::PanelModality panelModality
bool isWindow() const
Returns true if the item is a QGraphicsWidget window, otherwise returns false.
QPointer< QWidget > widget
void setExtension(Extension extension, const QVariant &variant)
virtual void advance(int phase)
This virtual function is called twice for all items by the QGraphicsScene::advance() slot...
void removeFromGroup(QGraphicsItem *item)
Removes the specified item from this group.
QGraphicsSimpleTextItemPrivate()
void setBrush(const QBrush &brush)
Sets the brush used to fill strokes generated with this pen to the given brush.
QList< QGraphicsItem * > childItems() const
Returns a list of this item's children.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
void resetFocusProxy()
Sets the focusProxy pointer to 0 for all items that have this item as their focusProxy.
void setExtension(Extension extension, const QVariant &variant)
QScopedPointer< QGraphicsItemPrivate > d_ptr
QPainterPath path() const
Returns the item's path as a QPainterPath.
void setLastPos(const QPointF &pos)
void setTextCursor(const QTextCursor &cursor)
void setSelected(bool selected)
If selected is true and this item is selectable, this item is selected; otherwise, it is unselected.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
void removeChild(QGraphicsItem *child)
QGraphicsScenePrivate::unregisterTopLevelItem().
T * data() const
Returns the value of the pointer referenced by this object.
QTransform itemTransform(const QGraphicsItem *other, bool *ok=0) const
Returns a QTransform that maps coordinates from this item to other.
int type() const
Reimplemented Function
int spanAngle() const
Returns the span angle of an ellipse segment in 16ths of a degree.
void setFont(const QFont &font)
Sets the font used to render the text item to font.
QPainterPath opaqueArea() const
Reimplemented Function
bool hasTranslateOnlySceneTransform()
The QMatrix class specifies 2D transformations of a coordinate system.
QRectF boundingRect() const
Reimplemented Function
QStyle::State state
the style flags that are used when drawing the control
#define it(className, varName)
void setTransform(const QTransform &matrix, bool combine=false)
Sets the item's current transformation matrix to matrix.
QGraphicsLineItem(QGraphicsItem *parent=0)
Constructs a QGraphicsLineItem.
void setMatrix(const QMatrix &matrix, bool combine=false)
Sets the item's affine transformation matrix.
void scale(qreal sx, qreal sy)
Use.
void setTransformationMode(Qt::TransformationMode mode)
Sets the pixmap item's transformation mode to mode, and toggles an update of the item.
QTransform sceneTransform() const
Returns this item's scene transformation matrix.
virtual qreal height() const
The QPainterPath class provides a container for painting operations, enabling graphical shapes to be ...
QFont font() const
Returns the font that is used to draw the item's text.
bool contains(const QPointF &point) const
Reimplemented Function
void setExtension(Extension extension, const QVariant &variant)
bool supportsExtension(Extension extension) const
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
~QAbstractGraphicsShapeItem()
Destroys a QAbstractGraphicsShapeItem.
void setActive(bool active)
If active is true, and the scene is active, this item's panel will be activated.
QGraphicsObject(QGraphicsItem *parent=0)
Constructs a QGraphicsObject with parent.
bool openExternalLinks() const
Specifies whether QGraphicsTextItem should automatically open links using QDesktopServices::openUrl()...
void setDocument(QTextDocument *document)
QDebug & nospace()
Clears the stream's internal flag that records whether the last character was a space and returns a r...
virtual QRectF boundingRect() const =0
This pure virtual function defines the outer bounds of the item as a rectangle; all painting must be ...
void remapItemPos(QEvent *event, QGraphicsItem *item)
Maps any item pos properties of event to item's coordinate system.
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...
virtual void inputMethodEvent(QInputMethodEvent *event)
This event handler, for event event, can be reimplemented to receive input method events for this ite...
QString & replace(int i, int len, QChar after)
QList< QGraphicsItem ** > focusProxyRefs
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
QString text() const
Returns the item's text.
void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
Reimplemented Function
void clearFocus()
Takes keyboard input focus from the item.
void adjustSize()
Adjusts the text item to a reasonable size.
virtual void updateSceneTransformFromParent()
void setPalette(const QPalette &pal)
QTransform transform() const
Returns this item's transformation matrix.
int length() const
Returns the number of characters in this string.
void setParentItem(QGraphicsItem *parent)
Sets this item's parent item to newParent.
void setCapStyle(Qt::PenCapStyle style)
Sets the cap style of the generated outlines to style.
QGraphicsItemGroup * group() const
Returns a pointer to this item's item group, or 0 if this item is not member of a group...
virtual bool collidesWithPath(const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns true if this item collides with path.
void setToolTip(const QString &toolTip)
Sets the item's tool tip to toolTip.
The lowest permitted type value for custom items (subclasses of QGraphicsItem or any of the standard ...
The QPointF class defines a point in the plane using floating point precision.
The QGraphicsItem class is the base class for all graphical items in a QGraphicsScene.
qreal height() const
Returns the height.
The QGraphicsSceneMouseEvent class provides mouse events in the graphics view framework.
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 ...
The QTextLine class represents a line of text inside a QTextLayout.
static Qt::MouseButtons buttons
bool isVisible() const
Returns true if the item is visible; otherwise, false is returned.
QPainterPath subtracted(const QPainterPath &r) const
Returns a path which is p's fill area subtracted from this path's fill area.
void restore()
Restores the current painter state (pops a saved state off the stack).
Qt::TextInteractionFlags textInteractionFlags
QPainterPath intersected(const QPainterPath &r) const
Returns a path which is the intersection of this path's fill area and p's fill area.
QTextCursor textCursor() const
This property represents the visible text cursor in an editable text item.
void setTransformHelper(const QTransform &transform)
Sets the transform transform.
iterator begin()
Returns an STL-style iterator pointing to the first item in the list.
QString toString() const
Returns the variant as a QString if the variant has type() String , Bool , ByteArray ...
QList< QGraphicsItem * > modalPanels
int type() const
Reimplemented Function
Qt::MouseButton button() const
Returns the mouse button (if any) that caused the event.
The QGraphicsEllipseItem class provides an ellipse item that you can add to a QGraphicsScene.
QPointF topLeft() const
Returns the position of the rectangle's top-left corner.
quint32 notifyInvalidated
QRectF boundingRect() const
Reimplemented Function
QRect translated(int dx, int dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Reimplemented Function
int width() const
Returns the width of the rectangle.
QPointF genericMapFromScene(const QPointF &pos, const QWidget *viewport) const
Maps the point pos from scene to item coordinates.
bool isBlockedByModalPanel(QGraphicsItem **blockingPanel=0) const
Returns true if this item is blocked by a modal panel, false otherwise.
QGraphicsEllipseItemPrivate()
void ensureSortedChildren()
void insert(int i, const T &t)
Inserts value at index position i in the list.
QMatrix sceneMatrix() const
Use sceneTransform() instead.
virtual bool isObscuredBy(const QGraphicsItem *item) const
Returns true if this item's bounding rect is completely obscured by the opaque shape of item...
The QGraphicsEffectSource class represents the source on which a QGraphicsEffect is installed on...
void setButtonDownPos(Qt::MouseButton button, const QPointF &pos)
#define Q_ARG(type, data)
void mousePressEvent(QGraphicsSceneMouseEvent *event)
Reimplemented Function
void updateAncestorFlag(QGraphicsItem::GraphicsItemFlag childFlag, AncestorFlag flag=NoFlag, bool enabled=false, bool root=true)
Propagates the ancestor flag flag with value enabled to all this item's children. ...
void linkHovered(const QString &)
This signal is emitted when the user hovers over a link on a text item that enables Qt::LinksAccessib...
bool toBool() const
Returns the variant as a bool if the variant has type() Bool.
GraphicsItemFlag
This enum describes different flags that you can set on an item to toggle different features in the i...
QRectF rect() const
Returns the item's rectangle.
void setEnabledHelper(bool newEnabled, bool explicitly, bool update=true)
Sets this item's visibility to newEnabled.
QWidget * widget() const
Returns the widget where the event originated, or 0 if the event originates from another application...
QGraphicsItem * focusProxy() const
Returns this item's focus proxy, or 0 if this item has no focus proxy.
QPointF pos() const
Returns the position of the item in parent coordinates.
int count(const T &t) const
Returns the number of occurrences of value in the list.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Reimplemented Function
GraphicsItemChange
This enum describes the state changes that are notified by QGraphicsItem::itemChange().
bool contains(const QPointF &point) const
Reimplemented Function
bool intersects(const QRectF &rect) const
Returns true if any point in the given rectangle intersects the path; otherwise returns false...
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse doubleclick events for thi...
void setTabChangesFocus(bool b)
If b is true, the Tab key will cause the widget to change focus; otherwise, the tab key will insert a...
void addItem(QGraphicsItem *item)
Adds or moves the item and all its childen to this scene.
bool isOpacityNull() const
void addChild(QGraphicsItem *child)
QGraphicsScenePrivate::registerTopLevelItem().
qreal levelOfDetail
Use QStyleOptionGraphicsItem::levelOfDetailFromTransform() together with QPainter::worldTransform() i...
void addPolygon(const QPolygonF &polygon)
Adds the given polygon to the path as an (unclosed) subpath.
void dropEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented Function
QGraphicsSceneIndex * index
static QRectF setupTextLayout(QTextLayout *layout)
void drawLine(const QLineF &line)
Draws a line defined by line.
int start
Specifies the beginning of the format range within the text layout's text.
ushort red
Returns the red color component of this color.
void _q_ensureVisible(QRectF)
void updateMicroFocus()
Updates the item's micro focus.
qreal leftMargin() const
Returns the width of the frame's left margin in pixels.
QGraphicsItem(QGraphicsItem *parent=0)
Constructs a QGraphicsItem with the given parent item.
int height() const
Returns the height of the rectangle.
bool intersects(const QRectF &r) const
Returns true if this rectangle intersects with the given rectangle (i.
QRectF mapRectToScene(const QRectF &rect) const
Maps the rectangle rect, which is in this item's coordinate system, to the scene coordinate system...
void combineTransformToParent(QTransform *x, const QTransform *viewTransform=0) const
Combines this item's position and transform onto transform.
void _q_updateBoundingRect(const QSizeF &)
virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const
This method is only relevant for input items.
The QString class provides a Unicode character string.
bool contains(const QPointF &pt) const
Returns true if the given point is inside the path, otherwise returns false.
T * qobject_cast(QObject *object)
QRectF toRectF() const
Returns the variant as a QRectF if the variant has type() Rect or RectF ; otherwise returns an invali...
void updateBoundingRect()
QRectF boundingRect() const
Reimplemented Function
QRectF boundingRect() const
Reimplemented Function
void keyPressEvent(QKeyEvent *event)
Reimplemented Function
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse press events for this item...
QGraphicsItem * mouseGrabberItem() const
Returns the current mouse grabber item, or 0 if no item is currently grabbing the mouse...
PanelModality panelModality() const
Returns the modality for this item.
virtual void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag enter events for this item...
QString toHtml() const
Returns the item's text converted to HTML, or an empty QString if no text has been set...
QFont defaultFont
the default font used to display the document's text
bool isEnabled() const
Returns true if the item is enabled; otherwise, false is returned.
void update(const QRectF &rect=QRectF())
Schedules a redraw of the area covered by rect in this item.
The QGraphicsTextItem class provides a text item that you can add to a QGraphicsScene to display form...
~QGraphicsLineItem()
Destroys the QGraphicsLineItem.
void setText(const QString &text)
Sets the item's text to text.
virtual void wheelEvent(QGraphicsSceneWheelEvent *event)
This event handler, for event event, can be reimplemented to receive wheel events for this item...
qreal effectiveOpacity() const
Returns this item's effective opacity, which is between 0.
ShapeMode shapeMode() const
Returns the item's shape mode.
QGraphicsItemCache * maybeExtraItemCache() const
Q_DECL_CONSTEXPR T qAbs(const T &t)
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
void setPos(const QPointF &pos)
Sets the position of the item to pos, which is in parent coordinates.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
QPolygonF polygon() const
Returns the item's polygon, or an empty polygon if no polygon has been set.
bool isSelected() const
Returns true if this item is selected; otherwise, false is returned.
QVariant inputMethodQuery(Qt::InputMethodQuery query) const
Reimplemented Function
The QGraphicsPolygonItem class provides a polygon item that you can add to a QGraphicsScene.
void setTextCursor(const QTextCursor &cursor)
QTextControl * textControl() const
bool focusNextPrevChild(bool next)
Finds a new widget to give the keyboard focus to, as appropriate for Tab and Shift+Tab, and returns true if it can find a new widget, or false if it cannot.
void shear(qreal sh, qreal sv)
Use.
virtual void keyPressEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented to receive key press events for this item...
const QColor & color(ColorGroup cg, ColorRole cr) const
Returns the color in the specified color group, used for the given color role.
void removeFromIndex()
Removes this item from the scene's index.
The QPen class defines how a QPainter should draw lines and outlines of shapes.
bool _q_mouseOnEdge(QGraphicsSceneMouseEvent *)
bool supportsExtension(Extension extension) const
quint32 dirtySceneTransform
void setAcceptDrops(bool on)
If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and ...
bool isValid() const
Returns true if this text line is valid; otherwise returns false.
void removeExtraItemCache()
void focusInEvent(QFocusEvent *event)
Reimplemented Function
virtual QVariant inputMethodQuery(Qt::InputMethodQuery property) const
The QSizeF class defines the size of a two-dimensional object using floating point precision...
static QObjectPrivate * get(QObject *o)
quint32 dirtyChildrenBoundingRect
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
virtual void processEvent(QEvent *e, const QMatrix &matrix, QWidget *contextWidget=0)
void setVisible(bool visible)
If visible is true, the item is made visible.
void setMiterLimit(qreal length)
Sets the miter limit of the generated outlines to limit.
virtual void setPosHelper(const QPointF &pos)
Sets the position pos.
void moveTo(const QPointF &p)
Moves the current point to the given point, implicitly starting a new subpath and closing the previou...
static QGestureManager * instance()
virtual QPainterPath shape() const
Returns the shape of this item as a QPainterPath in local coordinates.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
QTextCursor textCursor() const
void focusOutEvent(QFocusEvent *event)
Reimplemented Function
void setFlags(GraphicsItemFlags flags)
Sets the item flags to flags.
void save()
Saves the current painter state (pushes the state onto a stack).
bool sendEvent(QGraphicsItem *item, QEvent *event)
Sends event event to item item through possible event filters.
void ensureSceneTransformRecursive(QGraphicsItem **topMostDirtyItem)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
~QGraphicsPathItem()
Destroys the QGraphicsPathItem.
QMap< const QGraphicsItem *, QMap< int, QVariant > > data
QSet< QGraphicsItem * > selectedItems
static QPixmap * find(const QString &key)
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
qreal scale() const
Returns the scale factor of the item.
qreal x() const
Returns the x-coordinate of this point.
void grabGesture(Qt::GestureType type, Qt::GestureFlags flags=Qt::GestureFlags())
Subscribes the graphics object to the given gesture with specific flags.
void setGraphicsEffect(QGraphicsEffect *effect)
Sets effect as the item's effect.
quint32 acceptedMouseButtons
virtual void focusInEvent(QFocusEvent *event)
This event handler, for event event, can be reimplemented to receive focus in events for this item...
QPainterPath shape() const
Reimplemented Function
QTransform viewportTransform() const
Returns a matrix that maps viewport coordinates to scene coordinates.
void setAcceptTouchEvents(bool enabled)
If enabled is true, this item will accept touch events; otherwise, it will ignore them...
The QLineF class provides a two-dimensional vector using floating point precision.
void keyReleaseEvent(QKeyEvent *event)
Reimplemented Function
QColor defaultTextColor() const
Returns the default text color that is used to for unformatted text.
QList< QGraphicsView * > views
qreal zValue() const
Returns the Z-value of the item.
QRectF childrenBoundingRect
virtual void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover leave events for this item...
void ensureVisible(const QRectF &rect, int xmargin=50, int ymargin=50)
Scrolls the contents of the viewport so that the scene rectangle rect is visible, with margins specif...
QCursor cursor() const
Returns the current cursor shape for the item.
QVariant extension(const QVariant &variant) const
QPointF pos() const
Returns the position of the cursor in item coordinates when the wheel event occurred.
QVariant extension(const QVariant &variant) const
virtual void setWidth(qreal)
virtual ~QGraphicsItem()
Destroys the QGraphicsItem and all its children.
void ungrabKeyboard()
Releases the keyboard grab.
QRectF boundingRect() const
Reimplemented Function
QPointF buttonDownScenePos(Qt::MouseButton button) const
Returns the mouse cursor position in scene coordinates where the specified button was clicked...
QGraphicsObject * toGraphicsObject()
Return the graphics item cast to a QGraphicsObject, if the class is actually a graphics object...
void lineTo(const QPointF &p)
Adds a straight line from the current position to the given endPoint.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
void move(int from, int to)
Moves the item at index position from to index position to.
QPolygonF translated(qreal dx, qreal dy) const
Returns a copy of the polygon that is translated by ({dx}, {dy}).
bool supportsExtension(Extension extension) const
bool contains(const QPointF &p) const
Returns true if the given point is inside or on the edge of the rectangle; otherwise returns false...
bool removeOne(const T &t)
Removes the first occurrence of value in the list and returns true on success; otherwise returns fals...
QVariant extension(const QVariant &variant) const
Qt::KeyboardModifiers modifiers() const
Returns the keyboard modifier flags that existed immediately after the event occurred.
quint32 localCollisionHack
int key() const
Returns the code of the key that was pressed or released.
QMatrix matrix() const
Returns the item's affine transformation matrix.
quint32 hasBoundingRegionGranularity
void setFocusHelper(Qt::FocusReason focusReason, bool climb, bool focusFromHide)
The QBitmap class provides monochrome (1-bit depth) pixmaps.
QRectF boundingRect(Qt::CoordinateSystem system) const
~QGraphicsPolygonItem()
Destroys the QGraphicsPolygonItem.
int startAngle() const
Returns the start angle for an ellipse segment in 16ths of a degree.
static QPainterPath qt_graphicsItem_shapeFromPath(const QPainterPath &path, const QPen &pen)
Returns a QPainterPath of path when stroked with the pen.
void setCursor(const QCursor &cursor)
Sets the current cursor shape for the item to cursor.
void append(const T &t)
Inserts value at the end of the list.
void setRenderHint(RenderHint hint, bool on=true)
Sets the given render hint on the painter if on is true; otherwise clears the render hint...
static void _q_adjustRect(QRect *rect)
void inputMethodEvent(QInputMethodEvent *event)
Reimplemented Function
void setPlainText(const QString &text)
Sets the item's text to text.
QFuture< void > map(Sequence &sequence, MapFunction function)
QString text() const
Returns the layout's text.
#define QT_BEGIN_NAMESPACE
This macro expands to.
QPainterPath opaqueArea() const
Reimplemented Function
void setZValue(qreal z)
Sets the Z-value of the item to z.
QLineF line() const
Returns the item's line, or a null line if no line has been set.
void drawEllipse(const QRectF &r)
Draws the ellipse defined by the given rectangle.
QGraphicsPolygonItemPrivate()
The QRectF class defines a rectangle in the plane using floating point precision. ...
int type() const
Reimplemented Function
QPainterPath opaqueArea() const
Reimplemented Function
qreal topMargin() const
Returns the width of the frame's top margin in pixels.
void setFillRule(Qt::FillRule rule)
Sets the fill rule of the polygon to rule.
void markDirty(QGraphicsItem *item, const QRectF &rect=QRectF(), bool invalidateChildren=false, bool force=false, bool ignoreOpacity=false, bool removingItemFromScene=false, bool updateBoundingRect=false)
QPainterPath createStroke(const QPainterPath &path) const
Generates a new path that is a fillable area representing the outline of the given path...
QGraphicsItem * focusItem() const
When the scene is active, this functions returns the scene's current focus item, or 0 if no item curr...
QRectF mapRectFromScene(const QRectF &rect) const
Maps the rectangle rect, which is in scene coordinates, to this item's coordinate system...
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
Reimplemented Function
void setPos(const QPointF &pos)
bool isUnderMouse() const
Returns true if this item is currently under the mouse cursor in one of the views; otherwise...
qreal bottomMargin() const
Returns the width of the frame's bottom margin in pixels.
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
Reimplemented Function
void setAcceptsHoverEvents(bool enabled)
Use setAcceptHoverEvents(enabled) instead.
void purge()
Empty all cached pixmaps from the pixmap cache.
QList< QGraphicsView * > views() const
Returns a list of all the views that display this scene.
void setCacheMode(CacheMode mode, const QSize &cacheSize=QSize())
Sets the item's cache mode to mode.
virtual bool isProxyWidget() const
void setFiltersChildEvents(bool enabled)
If enabled is true, this item is set to filter all events for all its children (i.
void clear()
Removes all the elements from the vector and releases the memory used by the vector.
QPointF scenePos() const
Returns the item's position in scene coordinates.
~QGraphicsTextItem()
Destroys the QGraphicsTextItem.
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse move events for this item...
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
bool contains(const QPointF &point) const
Reimplemented Function
void setHandlesChildEvents(bool enabled)
If enabled is true, this item is set to handle all events for all its children (i.
void removeItem(QGraphicsItem *item)
Removes the item item and all its children from the scene.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
void resetMatrix()
Use resetTransform() instead.
~QGraphicsPixmapItem()
Destroys the QGraphicsPixmapItem.
~QGraphicsItemGroup()
Destroys the QGraphicsItemGroup.
QVariant data(int key) const
Returns this item's custom data for the key key as a QVariant.
The QTextCursor class offers an API to access and modify QTextDocuments.
bool itemIsUntransformable() const
QAbstractGraphicsShapeItem(QGraphicsItem *parent=0)
Constructs a QAbstractGraphicsShapeItem.
virtual void resetWidth()
void initStyleOption(QStyleOptionGraphicsItem *option, const QTransform &worldTransform, const QRegion &exposedRegion, bool allItems=false) const
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the list...
void setOpenExternalLinks(bool open)
quint32 fullUpdatePending
quint32 paintedViewBoundingRectsNeedRepaint
qreal height() const
Returns the height of the rectangle.
qreal textWidth() const
Returns the text width.
virtual bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns true if this item collides with other; otherwise returns false.
const T value(const Key &key) const
Returns the value associated with the key key.
#define Q_GLOBAL_STATIC(TYPE, NAME)
Declares a global static variable with the given type and name.
static void children_append(QDeclarativeListProperty< QGraphicsObject > *list, QGraphicsObject *item)
QGraphicsItem * panel() const
Returns the item's panel, or 0 if this item does not have a panel.
void rotate(qreal angle)
Use.
void prepend(const T &t)
Inserts value at the beginning of the list.
QSize size() const
Returns the size of the rectangle.
QGraphicsObject * parentObject() const
Returns a pointer to the item's parent, cast to a QGraphicsObject.
static bool movableAncestorIsSelected(const QGraphicsItem *item)
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
const T & at(int i) const
Returns the item at index position i in the list.
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
virtual void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover move events for this item...
void setPos(const QPointF &pos)
void scroll(int dx, int dy, int x, int y, int width, int height, QRegion *exposed=0)
void setHtml(const QString &text)
QGraphicsEffect * graphicsEffect
QBrush brush() const
Returns the item's brush, or an empty brush if no brush has been set.
int type() const
Reimplemented Function
The QPolygonF class provides a vector of points using floating point precision.
QRectF rect() const
Returns the item's ellipse geometry as a QRectF.
virtual int type() const
Returns the type of an item as an int.
void setData(int key, const QVariant &value)
Sets this item's custom data for the key key to value.
void setPen(const QPen &pen)
Sets the pen for this item to pen.
void append(const T &t)
Inserts value at the end of the vector.
void setPath(const QPainterPath &path)
Sets the item's path to be the given path.
int type() const
Reimplemented Function
virtual void prepareBoundingRectChange(const QGraphicsItem *item)
Notify the index for a geometry change of an item.
QGraphicsItem * itemAt(const QPoint &pos) const
Returns the item at position pos, which is in viewport coordinates.
ShapeMode
This enum describes how QGraphicsPixmapItem calculates its shape and opaque area. ...
Q_CORE_EXPORT void qWarning(const char *,...)
bool supportsExtension(Extension extension) const
QPen pen() const
Returns the item's pen, or a black solid 0-width pen if no pen has been set.
int type() const
Reimplemented Function
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
quint32 filtersDescendantEvents
bool acceptTouchEvents() const
Returns true if an item accepts touch events; otherwise, returns false.
The QImage class provides a hardware-independent image representation that allows direct access to th...
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...
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...
bool contains(const QPointF &point) const
Reimplemented Function
QList< QGraphicsTransform * > transformations() const
Returns a list of graphics transforms that currently apply to this item.
void addRect(const QRectF &rect)
Adds the given rectangle to this path as a closed subpath.
bool isActive() const
Returns true if this item is active; otherwise returns false.
bool supportsExtension(Extension extension) const
void invalidateDepthRecursively()
qreal width() const
Returns the width of the rectangle.
QGraphicsTextItemPrivate()
QRectF mapRectToParent(const QRectF &rect) const
Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system...
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...
The QRegion class specifies a clip region for a painter.
The QPainterPathStroker class is used to generate fillable outlines for a given painter path...
qreal rotation() const
Returns the clockwise rotation, in degrees, around the Z axis.
QList< Key > keys() const
Returns a list containing all the keys in the map in ascending order.
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented Function
QGraphicsItem * topLevelItem() const
Returns this item's top-level item.
void clearFocusHelper(bool giveFocusToParent)
void setIsMemberOfGroup(bool enabled)
Propagates item group membership.
Qt::InputMethodHints inputMethodHints() const
Returns the current input method hints of this item.
void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented Function
QGraphicsPathItem(QGraphicsItem *parent=0)
Constructs a QGraphicsPath.
void draw(QPainter *p, const QPointF &pos, const QVector< FormatRange > &selections=QVector< FormatRange >(), const QRectF &clip=QRectF()) const
Draws the whole layout on the painter p at the position specified by pos.
virtual bool supportsExtension(Extension extension) const
Note: This is provided as a hook to avoid future problems related to adding virtual functions...
virtual void dragLeaveEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag leave events for this item...
QPainterPath opaqueArea() const
Reimplemented Function
void setDocument(QTextDocument *document)
Sets the text document document on the item.
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
QVariant extension(const QVariant &variant) const
void setX(qreal x)
Set's the x coordinate of the item's position.
QPainterPath opaqueArea() const
Reimplemented Function
GraphicsItemFlags flags() const
Returns this item's flags.
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
This event handler can be reimplemented in a subclass to process context menu events.
bool contains(const QPointF &point) const
Reimplemented Function
QGraphicsItem * activePanel() const
Returns the current active panel, or 0 if no panel is currently active.
int type() const
Reimplemented Function
PixmapPadMode
This enum describes how the pixmap returned from sourcePixmap should be padded.
virtual QPainterPath opaqueArea() const
This virtual function returns a shape representing the area where this item is opaque.
QPainterPath opaqueArea() const
Reimplemented Function
QVariant extra(Extra type) const
QAbstractDeclarativeData * declarativeData
void translate(qreal dx, qreal dy)
Moves the rectangle dx along the x-axis and dy along the y-axis, relative to the current position...
QTextLine lineAt(int i) const
Returns the {i}-th line of text in this text layout.
QList< QGraphicsItem * > selectedItems() const
Returns a list of all currently selected items.
QPixmap pixmap() const
Returns the item's pixmap, or an invalid QPixmap if no pixmap has been set.
qreal boundingRegionGranularity() const
Returns the item's bounding region granularity; a value between and including 0 and 1...
QRect toRect() const
Returns a QRect based on the values of this rectangle.
void resetTransform()
Resets this item's transformation matrix to the identity matrix or all the transformation properties ...
void qSort(RandomAccessIterator start, RandomAccessIterator end)
void sendScenePosChange()
Q_CORE_EXPORT bool qIsNaN(double d)
Returns true if the double {d} is not a number (NaN).
quint32 mayHaveChildWithGraphicsEffect
void setSize(const QSizeF &s)
Sets the size of the rectangle to the given size.
quint32 updateDueToGraphicsEffect
QPen pen() const
Returns the item's pen.
QGraphicsWidget * topLevelWidget() const
Returns a pointer to the item's top level widget (i.
QPointF controlOffset() const
void clearSubFocus(QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
void setPixmap(const QPixmap &pixmap)
Sets the item's pixmap to pixmap.
const T & at(int i) const
Returns the item at index position i in the vector.
void unsetCursor()
Clears the cursor from this item.
QTextDocument * document() const
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
QTransform toTransform() const
Returns the conventional Qt 2D transformation matrix that corresponds to this matrix.
void setTransformations(const QList< QGraphicsTransform *> &transformations)
Sets a list of graphics transformations (QGraphicsTransform) that currently apply to this item...
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, or one of child's parent's ancestors).
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...
void hoverMoveEvent(QGraphicsSceneHoverEvent *event)
Reimplemented Function
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
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...
QTransform deviceTransform(const QTransform &viewportTransform) const
Returns this item's device transformation matrix, using viewportTransform to map from scene to device...
QFont font() const
Returns the item's font, which is used to render the text.
void setTransformOriginPoint(const QPointF &origin)
Sets the origin point for the transformation in item coordinates.
~QGraphicsEllipseItem()
Destroys the QGraphicsEllipseItem.
void updateAncestorFlags()
T & first()
Returns a reference to the first item in the list.
void fill(const QColor &fillColor=Qt::white)
Fills the pixmap with the given color.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
QPalette palette
the palette that should be used when painting the control
void setRenderHints(RenderHints hints, bool on=true)
Sets the given render hints on the painter if on is true; otherwise clears the render hints...
QRectF mapRectToItem(const QGraphicsItem *item, const QRectF &rect) const
Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system...
The QBrush class defines the fill pattern of shapes drawn by QPainter.
void installSceneEventFilter(QGraphicsItem *filterItem)
Installs an event filter for this item on filterItem, causing all events for this item to first pass ...
void setInputMethodHints(Qt::InputMethodHints hints)
Sets the current input method hints of this item to hints.
QPointF pos
the position of the item
QPoint mapFromScene(const QPointF &point) const
Returns the scene coordinate point to viewport coordinates.
bool isActive() const
Returns true if the scene is active (e.
const QBrush & windowText() const
Returns the window text (general foreground) brush of the current color group.
void setActivePanel(QGraphicsItem *item)
Activates item, which must be an item in this scene.
void grabKeyboard()
Grabs the keyboard input.
void ensureSequentialSiblingIndex()
Ensures that the list of children is sorted by insertion order, and that the siblingIndexes are packe...
void setDefaultFont(const QFont &font)
Sets the default font to use in the document layout.
QTransform sceneTransform
virtual void dragMoveEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drag move events for this item...
bool hasCursor() const
Returns true if this item has a cursor set; otherwise, false is returned.
The QGraphicsSimpleTextItem class provides a simple text path item that you can add to a QGraphicsSce...
QGraphicsRectItem(QGraphicsItem *parent=0)
Constructs a QGraphicsRectItem.
The QGraphicsLineItem class provides a line item that you can add to a QGraphicsScene.
#define Q_ASSERT_X(cond, where, what)
QGraphicsTextItem(QGraphicsItem *parent=0)
Constructs a QGraphicsTextItem.
QGraphicsItemGroup(QGraphicsItem *parent=0)
Constructs a QGraphicsItemGroup.
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...
QGraphicsItem * parentItem() const
Returns a pointer to this item's parent item.
bool isSignalConnected(uint signalIdx) const
Returns true if the signal with index signal_index from object sender is connected.
qreal angle(const QPointF &p1, const QPointF &p2)
The QTextLayout class is used to lay out and render text.
void selectionChanged()
This signal is emitted by QGraphicsScene whenever the selection changes.
bool handlesChildEvents() const
Returns true if this item handles child events (i.
CacheMode
This enum describes QGraphicsItem's cache modes.
void setExtension(Extension extension, const QVariant &variant)
#define Q_DECLARE_PUBLIC(Class)
QString toPlainText() const
QRegion boundingRegion(const QTransform &itemToDeviceTransform) const
Returns the bounding region for this item.
static bool qt_QGraphicsItem_isObscured(const QGraphicsItem *item, const QGraphicsItem *other, const QRectF &rect)
Item obscurity helper function.
void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Reimplemented Function
ushort blue
Returns the blue color component of this color.
QDeclarativeListProperty< QGraphicsObject > childrenList()
Returns a list of this item's children.
QPainterPath shape() const
Reimplemented Function
qreal y() const
This convenience function is equivalent to calling pos().
const QTransform & worldTransform() const
Returns the world transformation matrix.
The QAbstractGraphicsShapeItem class provides a common base for all path items.
quint32 notifyBoundingRectChanged
void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Reimplemented Function
virtual void hoverEnterEvent(QGraphicsSceneHoverEvent *event)
This event handler, for event event, can be reimplemented to receive hover enter events for this item...
The QGraphicsSceneDragDropEvent class provides events for drag and drop in the graphics view framewor...
Type
This enum type defines the valid event types in Qt.
QBitmap mask() const
Extracts a bitmap mask from the pixmap's alpha channel.
virtual QVariant extension(const QVariant &variant) const
Note: This is provided as a hook to avoid future problems related to adding virtual functions...
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
void ensureSceneTransform()
void prepareGeometryChange()
Prepares the item for a geometry change.
QPointF scenePos() const
Returns the mouse cursor position in scene coordinates.
The QFont class specifies a font used for drawing text.
int y() const
Returns the y-coordinate of the rectangle's top edge.
void setVisibleHelper(bool newVisible, bool explicitly, bool update=true)
Sets this item's visibility to newVisible.
void stackBefore(const QGraphicsItem *sibling)
Stacks this item before sibling, which must be a sibling item (i.
bool isPanel() const
Returns true if the item is a panel; otherwise returns false.
QMatrix matrix
the complete transformation matrix for the item
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
virtual void dropEvent(QGraphicsSceneDragDropEvent *event)
This event handler, for event event, can be reimplemented to receive drop events for this item...
QPoint toPoint() const
Rounds the coordinates of this point to the nearest integer, and returns a QPoint object with the rou...
virtual qreal width() const
QTextLine createLine()
Returns a new text line to be laid out if there is text to be inserted into the layout; otherwise ret...
qreal naturalTextWidth() const
Returns the width of the line that is occupied by text.
QString toolTip() const
Returns the item's tool tip, or an empty QString if no tool tip has been set.
virtual void transformChanged()
Type type() const
Returns the storage type of the value stored in the variant.
bool updateRect(const QRect &rect)
void arcTo(const QRectF &rect, qreal startAngle, qreal arcLength)
Creates an arc that occupies the given rectangle, beginning at the specified startAngle and extending...
void clearSelection()
Clears the current selection.
void prependGraphicsTransform(QGraphicsTransform *t)
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
QGraphicsItem * focusScopeItem
int x() const
Returns the x-coordinate of the rectangle's left edge.
QObject * parent() const
Returns a pointer to the parent object.
void setPolygon(const QPolygonF &polygon)
Sets the item's polygon to be the given polygon.
void setAcceptHoverEvents(bool enabled)
If enabled is true, this item will accept hover events; otherwise, it will ignore them...
qreal x() const
This convenience function is equivalent to calling pos().
void setPanelModality(PanelModality panelModality)
Sets the modality for this item to panelModality.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
void setY(qreal y)
Set's the y coordinate of the item's position.
static bool insert(const QString &key, const QPixmap &pixmap)
Inserts a copy of the pixmap pixmap associated with the key into the cache.
The QPoint class defines a point in the plane using integer precision.
void setJoinStyle(Qt::PenJoinStyle style)
Sets the join style of the generated outlines to style.
QAbstractTextDocumentLayout * documentLayout() const
Returns the document layout for this document.
void dragEnterEvent(QGraphicsSceneDragDropEvent *event)
Reimplemented Function
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...
void setExtension(Extension extension, const QVariant &variant)
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
quint32 acceptTouchEvents
Q_DECL_CONSTEXPR const T & qBound(const T &min, const T &val, const T &max)
static int children_count(QDeclarativeListProperty< QGraphicsObject > *list)
void setBrush(const QBrush &brush)
Sets the painter's brush to the given brush.
qreal rightMargin() const
Returns the width of the frame's right margin in pixels.
void setGroup(QGraphicsItemGroup *group)
Adds this item to the item group group.
The QTextFrameFormat class provides formatting information for frames in a QTextDocument.
void setExtension(Extension extension, const QVariant &variant)
int size() const
Returns the number of items in the list.
Qt::TransformationMode transformationMode() const
Returns the transformation mode of the pixmap.
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented Function
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Reimplemented Function
bool sceneEvent(QEvent *event)
Reimplemented Function
void setSubFocus(QGraphicsItem *rootItem=0, QGraphicsItem *stopItem=0)
QGraphicsPixmapItem(QGraphicsItem *parent=0)
Constructs a QGraphicsPixmapItem.
void setPen(const QColor &color)
Sets the painter's pen to have style Qt::SolidLine, width 0 and the specified color.
virtual QRectF boundingRectFor(const QRectF &sourceRect) const
Returns the effective bounding rectangle for this effect, given the provided rect in the device coord...
QGraphicsWidget * window() const
Returns the item's window, or 0 if this item does not have a window.
void addToGroup(QGraphicsItem *item)
Adds the given item and item's child items to this item group.
static void(* destroyed)(QAbstractDeclarativeData *, QObject *)
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
QString objectName() const
void setExtra(Extra type, const QVariant &value)
qreal widthF() const
Returns the pen width with floating point precision.
if(void) toggleToolbarShown
QPointF pos() const
Returns the position of the mouse cursor in item coordinates at the moment the hover event was sent...
bool acceptsHoverEvents() const
Call acceptHoverEvents() instead.
The QRect class defines a rectangle in the plane using integer precision.
void childrenBoundingRectHelper(QTransform *x, QRectF *rect, QGraphicsItem *topMostEffectItem)
Returns the bounding rect of this item's children (excluding itself).
void setTextInteractionFlags(Qt::TextInteractionFlags flags)
Sets the flags flags to specify how the text item should react to user input.
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
QRect paddedEffectRect(Qt::CoordinateSystem system, QGraphicsEffect::PixmapPadMode mode, const QRectF &sourceRect, bool *unpadded=0) const
#define Q_AUTOTEST_EXPORT
bool isWidget() const
Returns true if this item is a widget (i.
QPainterPath opaqueArea() const
Reimplemented Function
QPainterPath clipPath() const
Returns this item's clip path, or an empty QPainterPath if this item is not clipped.
QPoint buttonDownScreenPos(Qt::MouseButton button) const
Returns the mouse cursor position in screen coordinates where the specified button was clicked...
virtual bool contains(const QPointF &point) const
Returns true if this item contains point, which is in local coordinates; otherwise, false is returned.
bool isNull() const
Returns true if both the x and y coordinates are set to +0.
void setRect(const QRectF &rect)
Sets the item's rectangle to be the given rectangle.
const QObjectList & children() const
Returns a list of child objects.
bool contains(const Key &key) const
Returns true if the map contains an item with key key; otherwise returns false.
void setWorldTransform(const QTransform &matrix, bool combine=false)
Sets the world transformation matrix.
virtual void subFocusItemChange()
Subclasses can reimplement this function to be notified when subFocusItem changes.
void setDefaultTextColor(const QColor &c)
Sets the color for unformatted text to col.
T qvariant_cast(const QVariant &)
QVector< QRectF > exposed
static void mouseEvent(MouseAction action, QWidget *widget, Qt::MouseButton button, Qt::KeyboardModifiers stateKey, QPoint pos, int delay=-1)
QSizeF size() const
Returns the size of the rectangle.
void setPos(const QPointF &pos)
Sets the position associated with the hover event to the given point in item coordinates.
QPainterPath opaqueArea() const
Reimplemented Function
void drawRect(const QRectF &rect)
Draws the current rectangle with the current pen and brush.
QGraphicsEllipseItem(QGraphicsItem *parent=0)
Constructs a QGraphicsEllipseItem.
static const QGraphicsItemPrivate * get(const QGraphicsItem *item)
qreal y() const
Returns the y-coordinate of this point.
The QGraphicsItemGroup class provides a container that treats a group of items as a single item...
void combineTransformFromParent(QTransform *x, const QTransform *viewTransform=0) const
Combines this item's position and transform onto transform.
The QPixmap class is an off-screen image representation that can be used as a paint device...
void scroll(qreal dx, qreal dy, const QRectF &rect=QRectF())
Scrolls the contents of rect by dx, dy.
QPainterPath shape() const
Reimplemented Function
The QTextDocument class holds formatted text that can be viewed and edited using a QTextEdit...
void drawContents(QPainter *painter, const QRectF &rect=QRectF(), QWidget *widget=0)
Q_AUTOTEST_EXPORT QPainterPath qt_regionToPath(const QRegion ®ion)
QScopedPointer< QObjectData > d_ptr
The QGraphicsView class provides a widget for displaying the contents of a QGraphicsScene.
QVariant extension(const QVariant &variant) const
QPointF pos() const
Returns the mouse cursor position in item coordinates.
QPointF buttonDownPos(Qt::MouseButton button) const
Returns the mouse cursor position in item coordinates where the specified button was clicked...
void scale(qreal sx, qreal sy)
Scales the coordinate system by ({sx}, {sy}).
QVariant extension(const QVariant &variant) const
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...
int height() const
Returns the height of the pixmap.
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...
QPainterPath shape() const
Reimplemented Function
int length
Specifies the numer of characters the format range spans.
void setAcceptedMouseButtons(Qt::MouseButtons buttons)
Sets the mouse buttons that this item accepts mouse events for.
Qt::FillRule fillRule() const
Returns the fill rule of the polygon.
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)=0
This function, which is usually called by QGraphicsView, paints the contents of an item in local coor...
TransformData * transformData
bool contains(const QPointF &point) const
Reimplemented Function
bool contains(const QPointF &point) const
Reimplemented Function
bool isVisibleTo(const QGraphicsItem *parent) const
Returns true if the item is visible to parent; otherwise, false is returned.
QPixmap pixmap(Qt::CoordinateSystem system, QPoint *offset, QGraphicsEffect::PixmapPadMode mode) const
friend bool qt_closestItemFirst(const QGraphicsItem *, const QGraphicsItem *)
Returns true if item1 is on top of item2.
QRectF mapRectFromItem(const QGraphicsItem *item, const QRectF &rect) const
Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system...
QTextCharFormat format
Specifies the format to apply.
static Q_DECL_CONSTEXPR bool qFuzzyIsNull(double d)
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
void setScale(qreal scale)
Sets the scale factor of the item.
static void remove(const QString &key)
Removes the pixmap associated with key from the cache.
The QSize class defines the size of a two-dimensional object using integer point precision.
void setTextWidth(qreal width)
Sets the preferred width for the item's text.
void setFont(const QFont &f)
Sets the painter's font to the given font.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
quint32 scenePosDescendants
QGraphicsScene * scene() const
Returns the current scene for the item, or 0 if the item is not stored in a scene.
void setEnabled(bool enabled)
If enabled is true, the item is enabled; otherwise, it is disabled.
bool intersects(const QRect &r) const
Returns true if this rectangle intersects with the given rectangle (i.
void setCacheEnabled(bool enable)
Enables caching of the complete layout information if enable is true; otherwise disables layout cachi...
bool acceptHoverEvents() const
Returns true if an item accepts hover events (QGraphicsSceneHoverEvent); otherwise, returns false.
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
void setTextWidth(qreal width)
virtual void setExtension(Extension extension, const QVariant &variant)
Note: This is provided as a hook to avoid future problems related to adding virtual functions...
qreal opacity() const
Returns this item's local opacity, which is between 0.
~QGraphicsRectItem()
Destroys the QGraphicsRectItem.
void ungrabMouse()
Releases the mouse grab.
bool _qt_movableAncestorIsSelected(const QGraphicsItem *item)
obsolete
QGraphicsItemCache * extraItemCache() const
void endLayout()
Ends the layout process.
QTransform transformToParent() const
virtual QVariant inputMethodQueryHelper(Qt::InputMethodQuery query) const
This helper function helped us add input method query support in Qt 4.
QRectF boundingRect() const
Reimplemented Function
The QGraphicsSceneWheelEvent class provides wheel events in the graphics view framework.
QList< QGraphicsItem * > items() const
Returns a list of all the items in the associated scene, in descending stacking order (i...
QRectF boundingRect() const
Reimplemented Function
Qt::TransformationMode transformationMode
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
Reimplemented Function
Extension
Note: This is provided as a hook to avoid future problems related to adding virtual functions...
The QInputContext class abstracts the input method dependent data and composing state.
static QGraphicsObject * children_at(QDeclarativeListProperty< QGraphicsObject > *list, int)
bool supportsExtension(Extension extension) const
void translate(qreal dx, qreal dy)
Use setPos() or setTransformOriginPoint() instead.
virtual void keyReleaseEvent(QKeyEvent *event)
This event handler, for event event, can be reimplemented to receive key release events for this item...
bool isObscuredBy(const QGraphicsItem *item) const
Reimplemented Function
QList< QGraphicsItem * > children
void setViewport(const QRectF &viewport)
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...
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
QRectF translated(qreal dx, qreal dy) const
Returns a copy of the rectangle that is translated dx along the x axis and dy along the y axis...
void setRotation(qreal angle)
Sets the clockwise rotation angle, in degrees, around the Z axis.
void setOpacity(qreal opacity)
Sets this item's local opacity, between 0.
QString toPlainText() const
Returns the item's text converted to plain text, or an empty QString if no text has been set...
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
QDebug operator<<(QDebug debug, QGraphicsItem *item)
QRectF exposedRect
the exposed rectangle, in item coordinates
virtual void siblingOrderChange()
Subclasses can reimplement this function to be notified when its siblingIndex order is changed...
QGraphicsSimpleTextItem(QGraphicsItem *parent=0)
Constructs a QGraphicsSimpleTextItem.
QGraphicsTextItemPrivate * dd
QGraphicsItem * focusProxy
QImageIOHandler * handler
PanelModality
This enum specifies the behavior of a modal panel.
QTextDocument * document() const
Returns the item's text document.
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
void ungrabGesture(Qt::GestureType type)
Unsubscribes the graphics object from the given gesture.
QPointF offset() const
Returns the pixmap item's offset, which defines the point of the top-left corner of the pixmap...
The QGraphicsObject class provides a base class for all graphics items that require signals...
void markParentDirty(bool updateBoundingRect=false)
QDebug & space()
Writes a space character to the debug stream and returns a reference to the stream.
QList< QGraphicsItem * > collidingItems(const QGraphicsItem *item, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns a list of all items that collide with item.
QBitmap createHeuristicMask(bool clipTight=true) const
Creates and returns a heuristic mask for this pixmap.
void draw(QGraphicsItem *, QPainter *, const QTransform *const, const QTransform *const, QRegion *, QWidget *, qreal, const QTransform *const, bool, bool)
QPainterPath shape() const
Reimplemented Function
void setFlag(GraphicsItemFlag flag, bool enabled=true)
If enabled is true, the item flag flag is enabled; otherwise, it is disabled.
The QEvent class is the base class of all event classes.
virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event)
Filters events for the item watched.
virtual void focusScopeItemChange(bool isSubFocusItem)
Subclasses can reimplement this function to be notified when an item becomes a focusScopeItem (or is ...
Type type() const
Returns the event type.
QGraphicsEffectSource * source() const
Returns a pointer to the source, which provides extra context information that can be useful for the ...
The QGraphicsPixmapItem class provides a pixmap item that you can add to a QGraphicsScene.
static void qt_graphicsItem_highlightSelected(QGraphicsItem *item, QPainter *painter, const QStyleOptionGraphicsItem *option)
Highlights item as selected.
QPointF mapToScene(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system...
void setOffset(const QPointF &offset)
Sets the pixmap item's offset to offset.
virtual void resetHeight()
virtual void focusOutEvent(QFocusEvent *event)
This event handler, for event event, can be reimplemented to receive focus out events for this item...
static QWidget * focusWidget()
Returns the application widget that has the keyboard input focus, or 0 if no widget in this applicati...
The QStyleOptionGraphicsItem class is used to describe the parameters needed to draw a QGraphicsItem...
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
ushort green
Returns the green color component of this color.
QRectF boundingRect() const
Reimplemented Function
void setRect(const QRectF &rect)
Sets the item's ellipse geometry to rect.
int size() const
Returns the number of items in the vector.
void updateChildWithGraphicsEffectFlagRecursively()
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
QRectF sceneBoundingRect() const
Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with bound...
static void _q_qgraphicsItemSetFlag(QGraphicsItem *item, QGraphicsItem::GraphicsItemFlag flag, bool enabled)
Sets the flag flag on item and all its children, to enabled.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QPainterPath opaqueArea() const
Reimplemented Function
QRect rect
the area that should be used for various calculations and painting
QPainterPath shape() const
Reimplemented Function
qreal height() const
Returns the line's height.
virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
This event handler, for event event, can be reimplemented to receive mouse release events for this it...
void linkActivated(const QString &)
This signal is emitted when the user clicks on a link on a text item that enables Qt::LinksAccessible...
int type() const
Reimplemented Function
QRectF boundingRect() const
Returns the bounding rect of this group item, and all its children.
QVariant extension(const QVariant &variant) const
QList< QGraphicsItem * > children() const
Use childItems() instead.
The QFocusEvent class contains event parameters for widget focus events.
void updatePaintedViewBoundingRects(bool updateChildren)
void setBrush(const QBrush &brush)
Sets the item's brush to brush.
QPoint toPoint() const
Returns the variant as a QPoint if the variant has type() Point or PointF ; otherwise returns a null ...
bool supportsExtension(Extension extension) const
bool isObscured() const
Returns true if this item's bounding rect is completely obscured by the opaque shape of any of collid...
CacheMode cacheMode() const
Returns the cache mode for this item.
void beginLayout()
Begins the layout process.
virtual const QMetaObject * metaObject() const
Returns a pointer to the meta-object of this object.
bool discardUpdateRequest(bool ignoreVisibleBit=false, bool ignoreDirtyBit=false, bool ignoreOpacity=false) const
Returns true if we can discard an update request; otherwise false.
virtual void setHeight(qreal)
int type() const
Reimplemented Function
The QMap class is a template class that provides a skip-list-based dictionary.
void removeSceneEventFilter(QGraphicsItem *filterItem)
Removes an event filter on this item from filterItem.
void grabMouse()
Grabs the mouse input.
void addEllipse(const QRectF &rect)
Creates an ellipse within the specified boundingRectangle and adds it to the painter path as a closed...
qreal toReal(bool *ok=0) const
Returns the variant as a qreal if the variant has type() Double , QMetaType::Float ...
QPainterPath opaqueArea() const
Reimplemented Function
int open(const char *, int,...)
Qt::MouseButtons buttons() const
Returns the combination of mouse buttons that were pressed at the time the event was sent...
QVariant extension(const QVariant &variant) const
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
int lineCount() const
Returns the number of lines in this text layout.
QGraphicsPixmapItemPrivate()
QPointF mapToParent(const QPointF &point) const
Maps the point point, which is in this item's coordinate system, to its parent's coordinate system...
QPainterPath shape() const
Reimplemented Function
void invalidateChildGraphicsEffectsRecursively(InvalidateReason reason)
The QGraphicsEffect class is the base class for all graphics effects.
QRectF mapRectFromParent(const QRectF &rect) const
Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinat...
The QList class is a template class that provides lists.
qreal effectiveOpacity() const
void addToIndex()
Adds this item to the scene's index.
void setWidth(qreal width)
Sets the width of the generated outline painter path to width.
The QGraphicsPathItem class provides a path item that you can add to a QGraphicsScene.
QList< QGraphicsWidget * > popupWidgets
The QGraphicsSceneHoverEvent class provides hover events in the graphics view framework.
void setHtml(const QString &html)
Sets the item's text to text, assuming that text is HTML formatted.
QPainterPath translated(qreal dx, qreal dy) const
Returns a copy of the path that is translated by ({dx}, {dy}).
QPoint topLeft() const
Returns the position of the rectangle's top-left corner.
Qt::MouseButtons acceptedMouseButtons() const
Returns the mouse buttons that this item accepts mouse events for.
bool tabChangesFocus() const
Returns true if the Tab key will cause the widget to change focus; otherwise, false is returned...
void setFocus(Qt::FocusReason focusReason=Qt::OtherFocusReason)
Gives keyboard input focus to this item.
void translate(const QPointF &offset)
Translates the coordinate system by the given offset; i.e.
void setOpenExternalLinks(bool open)
The QPalette class contains color groups for each widget state.
QList< QGraphicsItem * > collidingItems(Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const
Returns a list of all items that collide with this item.
void removeAt(int i)
Removes the item at index position i.
bool supportsExtension(Extension extension) const