Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene. More...
#include <qgraphicswidget.h>
Public Slots | |
bool | close () |
Call this function to close the widget. | |
Public Slots inherited from QObject | |
void | deleteLater () |
\threadsafe | |
Signals | |
void | geometryChanged () |
This signal gets emitted whenever the geometry is changed in setGeometry(). | |
void | layoutChanged () |
This signal gets emitted whenever the layout of the item changes. | |
Signals inherited from QGraphicsObject | |
void | parentChanged () |
This signal gets emitted whenever the parent of the item changes. | |
void | opacityChanged () |
This signal gets emitted whenever the opacity of the item changes. | |
void | visibleChanged () |
This signal gets emitted whenever the visibility of the item changes. | |
void | enabledChanged () |
This signal gets emitted whenever the item gets enabled or disabled. | |
void | xChanged () |
This signal gets emitted whenever the x position of the item changes. | |
void | yChanged () |
This signal gets emitted whenever the y position of the item changes. | |
void | zChanged () |
This signal gets emitted whenever the z value of the item changes. | |
void | rotationChanged () |
This signal gets emitted whenever the rotation of the item changes. | |
void | scaleChanged () |
This signal is emitted when the scale of the item changes. | |
void | childrenChanged () |
This signal gets emitted whenever the children list changes. | |
void | widthChanged () |
void | heightChanged () |
Signals inherited from QObject | |
void | destroyed (QObject *=nullptr) |
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked. | |
void | objectNameChanged (const QString &objectName, QPrivateSignal) |
This signal is emitted after the object's name has been changed. | |
Public Member Functions | |
QGraphicsWidget (QGraphicsItem *parent=nullptr, Qt::WindowFlags wFlags=Qt::WindowFlags()) | |
Constructs a QGraphicsWidget instance. | |
~QGraphicsWidget () | |
Destroys the QGraphicsWidget instance. | |
QGraphicsLayout * | layout () const |
Returns this widget's layout, or \nullptr if no layout is currently managing this widget. | |
void | setLayout (QGraphicsLayout *layout) |
Sets the layout for this widget to layout. | |
void | adjustSize () |
Adjusts the size of the widget to its effective preferred size hint. | |
Qt::LayoutDirection | layoutDirection () const |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | unsetLayoutDirection () |
QStyle * | style () const |
Returns a pointer to the widget's style. | |
void | setStyle (QStyle *style) |
Sets the widget's style to style. | |
QFont | font () const |
void | setFont (const QFont &font) |
QPalette | palette () const |
void | setPalette (const QPalette &palette) |
bool | autoFillBackground () const |
void | setAutoFillBackground (bool enabled) |
void | resize (const QSizeF &size) |
void | resize (qreal w, qreal h) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a resize with the given width (w) and height (h). | |
QSizeF | size () const |
void | setGeometry (const QRectF &rect) override |
This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordinates (e.g., the top-left corner of rect is equivalent to the item's position in parent coordinates). | |
void | setGeometry (qreal x, qreal y, qreal w, qreal h) |
This convenience function is equivalent to calling setGeometry(QRectF( x, y, w, h)). | |
QRectF | rect () const |
Returns the item's local rect as a QRectF. | |
void | setContentsMargins (qreal left, qreal top, qreal right, qreal bottom) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the widget's contents margins to left, top, right and bottom. | |
void | setContentsMargins (QMarginsF margins) |
void | getContentsMargins (qreal *left, qreal *top, qreal *right, qreal *bottom) const override |
Gets the widget's contents margins. | |
void | setWindowFrameMargins (qreal left, qreal top, qreal right, qreal bottom) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the widget's window frame margins to left, top, right and bottom. | |
void | setWindowFrameMargins (QMarginsF margins) |
void | getWindowFrameMargins (qreal *left, qreal *top, qreal *right, qreal *bottom) const |
Gets the widget's window frame margins. | |
void | unsetWindowFrameMargins () |
Resets the window frame margins to the default value, provided by the style. | |
QRectF | windowFrameGeometry () const |
Returns the widget's geometry in parent coordinates including any window frame. | |
QRectF | windowFrameRect () const |
Returns the widget's local rect including any window frame. | |
Qt::WindowFlags | windowFlags () const |
Qt::WindowType | windowType () const |
Returns the widgets window type. | |
void | setWindowFlags (Qt::WindowFlags wFlags) |
bool | isActiveWindow () const |
Returns true if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e., a scene that currently has focus). | |
void | setWindowTitle (const QString &title) |
QString | windowTitle () const |
Qt::FocusPolicy | focusPolicy () const |
void | setFocusPolicy (Qt::FocusPolicy policy) |
QGraphicsWidget * | focusWidget () const |
If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget. | |
int | grabShortcut (const QKeySequence &sequence, Qt::ShortcutContext context=Qt::WindowShortcut) |
void | releaseShortcut (int id) |
void | setShortcutEnabled (int id, bool enabled=true) |
void | setShortcutAutoRepeat (int id, bool enabled=true) |
void | addAction (QAction *action) |
void | addActions (const QList< QAction * > &actions) |
void | insertActions (QAction *before, const QList< QAction * > &actions) |
void | insertAction (QAction *before, QAction *action) |
void | removeAction (QAction *action) |
QList< QAction * > | actions () const |
void | setAttribute (Qt::WidgetAttribute attribute, bool on=true) |
If on is true, this function enables attribute; otherwise attribute is disabled. | |
bool | testAttribute (Qt::WidgetAttribute attribute) const |
Returns true if attribute is enabled for this widget; otherwise, returns false . | |
int | type () const override |
\reimp | |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
\reimp | |
virtual void | paintWindowFrame (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) |
This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates. | |
QRectF | boundingRect () const override |
\reimp | |
QPainterPath | shape () const override |
\reimp | |
const QObjectList & | children () const |
Returns a list of child objects. | |
Public Member Functions inherited from QObject | |
Q_INVOKABLE | QObject (QObject *parent=nullptr) |
Constructs an object with parent object parent. | |
virtual | ~QObject () |
Destroys the object, deleting all its child objects. | |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
Filters events if this object has been installed as an event filter for the watched object. | |
QString | objectName () const |
Q_WEAK_OVERLOAD void | setObjectName (const QString &name) |
Sets the object's name to name. | |
void | setObjectName (QAnyStringView name) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
QBindable< QString > | bindableObjectName () |
bool | isWidgetType () const |
Returns true if the object is a widget; otherwise returns false . | |
bool | isWindowType () const |
Returns true if the object is a window; otherwise returns false . | |
bool | isQuickItemType () const |
Returns true if the object is a QQuickItem; otherwise returns false . | |
bool | signalsBlocked () const noexcept |
Returns true if signals are blocked; otherwise returns false . | |
bool | blockSignals (bool b) noexcept |
If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). | |
QThread * | thread () const |
Returns the thread in which the object lives. | |
bool | moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL) |
Changes the thread affinity for this object and its children and returns true on success. | |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds. | |
int | startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer) |
void | killTimer (int id) |
Kills the timer with timer identifier, id. | |
void | killTimer (Qt::TimerId id) |
template<typename T > | |
T | findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object. | |
template<typename T > | |
QList< T > | findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. | |
template<typename T > | |
T | findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
template<typename T > | |
QList< T > | findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
const QObjectList & | children () const |
Returns a list of child objects. | |
void | setParent (QObject *parent) |
Makes the object a child of parent. | |
void | installEventFilter (QObject *filterObj) |
Installs an event filter filterObj on this object. | |
void | removeEventFilter (QObject *obj) |
Removes an event filter object obj from this object. | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const |
bool | disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const |
bool | disconnect (const QObject *receiver, const char *member=nullptr) const |
void | dumpObjectTree () const |
Dumps a tree of children to the debug output. | |
void | dumpObjectInfo () const |
Dumps information about signal connections, etc. | |
bool | setProperty (const char *name, const QVariant &value) |
Sets the value of the object's name property to value. | |
bool | setProperty (const char *name, QVariant &&value) |
QVariant | property (const char *name) const |
Returns the value of the object's name property. | |
QList< QByteArray > | dynamicPropertyNames () const |
QBindingStorage * | bindingStorage () |
const QBindingStorage * | bindingStorage () const |
QObject * | parent () const |
Returns a pointer to the parent object. | |
bool | inherits (const char *classname) const |
Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false . | |
Public Member Functions inherited from QGraphicsItem | |
QGraphicsItem (QGraphicsItem *parent=nullptr) | |
Constructs a QGraphicsItem with the given parent item. | |
virtual | ~QGraphicsItem () |
Destroys the QGraphicsItem and all its children. | |
QGraphicsScene * | scene () const |
Returns the current scene for the item, or \nullptr if the item is not stored in a scene. | |
QGraphicsItem * | parentItem () const |
Returns a pointer to this item's parent item. | |
QGraphicsItem * | topLevelItem () const |
Returns this item's top-level item. | |
QGraphicsObject * | parentObject () const |
QGraphicsWidget * | parentWidget () const |
QGraphicsWidget * | topLevelWidget () const |
QGraphicsWidget * | window () const |
QGraphicsItem * | panel () const |
void | setParentItem (QGraphicsItem *parent) |
Sets this item's parent item to newParent. | |
QList< QGraphicsItem * > | childItems () const |
bool | isWidget () const |
bool | isWindow () const |
bool | isPanel () const |
QGraphicsObject * | toGraphicsObject () |
const QGraphicsObject * | toGraphicsObject () const |
QGraphicsItemGroup * | group () const |
Returns a pointer to this item's item group, or \nullptr if this item is not member of a group. | |
void | setGroup (QGraphicsItemGroup *group) |
Adds this item to the item group group. | |
GraphicsItemFlags | flags () const |
Returns this item's flags. | |
void | setFlag (GraphicsItemFlag flag, bool enabled=true) |
If enabled is true, the item flag flag is enabled; otherwise, it is disabled. | |
void | setFlags (GraphicsItemFlags flags) |
Sets the item flags to flags. | |
CacheMode | cacheMode () const |
void | setCacheMode (CacheMode mode, const QSize &cacheSize=QSize()) |
PanelModality | panelModality () const |
void | setPanelModality (PanelModality panelModality) |
bool | isBlockedByModalPanel (QGraphicsItem **blockingPanel=nullptr) const |
QCursor | cursor () const |
Returns the current cursor shape for the item. | |
void | setCursor (const QCursor &cursor) |
Sets the current cursor shape for the item to cursor. | |
bool | hasCursor () const |
Returns true if this item has a cursor set; otherwise, false is returned. | |
void | unsetCursor () |
Clears the cursor from this item. | |
bool | isVisible () const |
Returns true if the item is visible; otherwise, false is returned. | |
bool | isVisibleTo (const QGraphicsItem *parent) const |
void | setVisible (bool visible) |
If visible is true, the item is made visible. | |
void | hide () |
Hides the item (items are visible by default). | |
void | show () |
Shows the item (items are visible by default). | |
bool | isEnabled () const |
Returns true if the item is enabled; otherwise, false is returned. | |
void | setEnabled (bool enabled) |
If enabled is true, the item is enabled; otherwise, it is disabled. | |
bool | isSelected () const |
Returns true if this item is selected; otherwise, false is returned. | |
void | setSelected (bool selected) |
If selected is true and this item is selectable, this item is selected; otherwise, it is unselected. | |
bool | acceptDrops () const |
Returns true if this item can accept drag and drop events; otherwise, returns false . | |
void | setAcceptDrops (bool on) |
If on is true, this item will accept drag and drop events; otherwise, it is transparent for drag and drop events. | |
qreal | opacity () const |
qreal | effectiveOpacity () const |
void | setOpacity (qreal opacity) |
Qt::MouseButtons | acceptedMouseButtons () const |
Returns the mouse buttons that this item accepts mouse events for. | |
void | setAcceptedMouseButtons (Qt::MouseButtons buttons) |
Sets the mouse buttons that this item accepts mouse events for. | |
bool | acceptHoverEvents () const |
void | setAcceptHoverEvents (bool enabled) |
bool | acceptTouchEvents () const |
void | setAcceptTouchEvents (bool enabled) |
bool | filtersChildEvents () const |
void | setFiltersChildEvents (bool enabled) |
bool | handlesChildEvents () const |
void | setHandlesChildEvents (bool enabled) |
bool | isActive () const |
void | setActive (bool active) |
bool | hasFocus () const |
Returns true if this item is active, and it or its \l{focusProxy()}{focus proxy} has keyboard input focus; otherwise, returns false . | |
void | setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason) |
Gives keyboard input focus to this item. | |
void | clearFocus () |
Takes keyboard input focus from the item. | |
QGraphicsItem * | focusProxy () const |
void | setFocusProxy (QGraphicsItem *item) |
QGraphicsItem * | focusItem () const |
QGraphicsItem * | focusScopeItem () const |
void | grabMouse () |
void | ungrabMouse () |
void | grabKeyboard () |
void | ungrabKeyboard () |
QPointF | pos () const |
Returns the position of the item in parent coordinates. | |
qreal | x () const |
This convenience function is equivalent to calling pos().x(). | |
void | setX (qreal x) |
qreal | y () const |
This convenience function is equivalent to calling pos().y(). | |
void | setY (qreal y) |
QPointF | scenePos () const |
Returns the item's position in scene coordinates. | |
void | setPos (const QPointF &pos) |
Sets the position of the item to pos, which is in parent coordinates. | |
void | setPos (qreal x, qreal y) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling setPos(QPointF(x, y)). | |
void | moveBy (qreal dx, qreal dy) |
Moves the item by dx points horizontally, and dy point vertically. | |
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 attempt to scroll the view to ensure that rect is visible inside the view's viewport. | |
void | ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin=50, int ymargin=50) |
This convenience function is equivalent to calling ensureVisible(QRectF(x, y, w, h), xmargin, ymargin). | |
QTransform | transform () const |
QTransform | sceneTransform () const |
QTransform | deviceTransform (const QTransform &viewportTransform) const |
QTransform | itemTransform (const QGraphicsItem *other, bool *ok=nullptr) const |
void | setTransform (const QTransform &matrix, bool combine=false) |
void | resetTransform () |
void | setRotation (qreal angle) |
qreal | rotation () const |
void | setScale (qreal scale) |
qreal | scale () const |
QList< QGraphicsTransform * > | transformations () const |
void | setTransformations (const QList< QGraphicsTransform * > &transformations) |
QPointF | transformOriginPoint () const |
void | setTransformOriginPoint (const QPointF &origin) |
void | setTransformOriginPoint (qreal ax, qreal ay) |
virtual void | advance (int phase) |
This virtual function is called twice for all items by the QGraphicsScene::advance() slot. | |
qreal | zValue () const |
Returns the Z-value of the item. | |
void | setZValue (qreal z) |
Sets the Z-value of the item to z. | |
void | stackBefore (const QGraphicsItem *sibling) |
QRectF | childrenBoundingRect () const |
Returns the bounding rect of this item's descendants (i.e., its children, their children, etc.) in local coordinates. | |
QRectF | sceneBoundingRect () const |
Returns the bounding rect of this item in scene coordinates, by combining sceneTransform() with boundingRect(). | |
bool | isClipped () const |
Returns true if this item is clipped. | |
QPainterPath | clipPath () const |
virtual bool | contains (const QPointF &point) const |
Returns true if this item contains point, which is in local coordinates; otherwise, false is returned. | |
virtual bool | collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
Returns true if this item collides with other; otherwise returns false . | |
virtual bool | collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
Returns true if this item collides with path. | |
QList< QGraphicsItem * > | collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
Returns a list of all items that collide with this item. | |
bool | isObscured (const QRectF &rect=QRectF()) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
bool | isObscured (qreal x, qreal y, qreal w, qreal h) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
virtual bool | isObscuredBy (const QGraphicsItem *item) const |
Returns true if this item's bounding rect is completely obscured by the opaque shape of item. | |
virtual QPainterPath | opaqueArea () const |
This virtual function returns a shape representing the area where this item is opaque. | |
QRegion | boundingRegion (const QTransform &itemToDeviceTransform) const |
qreal | boundingRegionGranularity () const |
void | setBoundingRegionGranularity (qreal granularity) |
void | update (const QRectF &rect=QRectF()) |
Schedules a redraw of the area covered by rect in this item. | |
void | update (qreal x, qreal y, qreal width, qreal height) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling update(QRectF(x, y, width, height)). | |
void | scroll (qreal dx, qreal dy, const QRectF &rect=QRectF()) |
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, and returns the mapped coordinate. | |
QPointF | mapToParent (const QPointF &point) const |
Maps the point point, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped coordinate. | |
QPointF | mapToScene (const QPointF &point) const |
Maps the point point, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped coordinate. | |
QPolygonF | mapToItem (const QGraphicsItem *item, const QRectF &rect) const |
Maps the rectangle rect, which is in this item's coordinate system, to item's coordinate system, and returns the mapped rectangle as a polygon. | |
QPolygonF | mapToParent (const QRectF &rect) const |
Maps the rectangle rect, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped rectangle as a polygon. | |
QPolygonF | mapToScene (const QRectF &rect) const |
Maps the rectangle rect, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped rectangle as a polygon. | |
QRectF | mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectToParent (const QRectF &rect) const |
QRectF | mapRectToScene (const QRectF &rect) const |
QPolygonF | mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
Maps the polygon polygon, which is in this item's coordinate system, to item's coordinate system, and returns the mapped polygon. | |
QPolygonF | mapToParent (const QPolygonF &polygon) const |
Maps the polygon polygon, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped polygon. | |
QPolygonF | mapToScene (const QPolygonF &polygon) const |
Maps the polygon polygon, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped polygon. | |
QPainterPath | mapToItem (const QGraphicsItem *item, const QPainterPath &path) const |
Maps the path path, which is in this item's coordinate system, to item's coordinate system, and returns the mapped path. | |
QPainterPath | mapToParent (const QPainterPath &path) const |
Maps the path path, which is in this item's coordinate system, to its parent's coordinate system, and returns the mapped path. | |
QPainterPath | mapToScene (const QPainterPath &path) const |
Maps the path path, which is in this item's coordinate system, to the scene's coordinate system, and returns the mapped path. | |
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, and returns the mapped coordinate. | |
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 system, and returns the mapped coordinate. | |
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 system, and returns the mapped coordinate. | |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QRectF &rect) const |
Maps the rectangle rect, which is in item's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. | |
QPolygonF | mapFromParent (const QRectF &rect) const |
Maps the rectangle rect, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. | |
QPolygonF | mapFromScene (const QRectF &rect) const |
Maps the rectangle rect, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped rectangle as a polygon. | |
QRectF | mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectFromParent (const QRectF &rect) const |
QRectF | mapRectFromScene (const QRectF &rect) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
Maps the polygon polygon, which is in item's coordinate system, to this item's coordinate system, and returns the mapped polygon. | |
QPolygonF | mapFromParent (const QPolygonF &polygon) const |
Maps the polygon polygon, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped polygon. | |
QPolygonF | mapFromScene (const QPolygonF &polygon) const |
Maps the polygon polygon, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped polygon. | |
QPainterPath | mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const |
Maps the path path, which is in item's coordinate system, to this item's coordinate system, and returns the mapped path. | |
QPainterPath | mapFromParent (const QPainterPath &path) const |
Maps the path path, which is in this item's parent's coordinate system, to this item's coordinate system, and returns the mapped path. | |
QPainterPath | mapFromScene (const QPainterPath &path) const |
Maps the path path, which is in this item's scene's coordinate system, to this item's coordinate system, and returns the mapped path. | |
QPointF | mapToItem (const QGraphicsItem *item, qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToItem(item, QPointF(x, y)). | |
QPointF | mapToParent (qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToParent(QPointF(x, y)). | |
QPointF | mapToScene (qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapToScene(QPointF(x, y)). | |
QPolygonF | mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToScene (qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromItem(item, QPointF(x, y)). | |
QPointF | mapFromParent (qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromParent(QPointF(x, y)). | |
QPointF | mapFromScene (qreal x, qreal y) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This convenience function is equivalent to calling mapFromScene(QPointF(x, y)). | |
QPolygonF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapFromParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapFromScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const |
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). | |
QGraphicsItem * | commonAncestorItem (const QGraphicsItem *other) const |
bool | isUnderMouse () const |
QVariant | data (int key) const |
Returns this item's custom data for the key key as a QVariant. | |
void | setData (int key, const QVariant &value) |
Sets this item's custom data for the key key to value. | |
Qt::InputMethodHints | inputMethodHints () const |
Returns the current input method hints of this item. | |
void | setInputMethodHints (Qt::InputMethodHints hints) |
Sets the current input method hints of this item to hints. | |
void | installSceneEventFilter (QGraphicsItem *filterItem) |
Installs an event filter for this item on filterItem, causing all events for this item to first pass through filterItem's sceneEventFilter() function. | |
void | removeSceneEventFilter (QGraphicsItem *filterItem) |
Removes an event filter on this item from filterItem. | |
Public Member Functions inherited from QGraphicsLayoutItem | |
QGraphicsLayoutItem (QGraphicsLayoutItem *parent=nullptr, bool isLayout=false) | |
Constructs the QGraphicsLayoutItem object. | |
virtual | ~QGraphicsLayoutItem () |
Destroys the QGraphicsLayoutItem object. | |
void | setSizePolicy (const QSizePolicy &policy) |
Sets the size policy to policy. | |
void | setSizePolicy (QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy, QSizePolicy::ControlType controlType=QSizePolicy::DefaultType) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.This function is equivalent to calling setSizePolicy(QSizePolicy(hPolicy, vPolicy, controlType)). | |
QSizePolicy | sizePolicy () const |
Returns the current size policy. | |
void | setMinimumSize (const QSizeF &size) |
Sets the minimum size to size. | |
void | setMinimumSize (qreal w, qreal h) |
This convenience function is equivalent to calling setMinimumSize(QSizeF(w, h)). | |
QSizeF | minimumSize () const |
Returns the minimum size. | |
void | setMinimumWidth (qreal width) |
Sets the minimum width to width. | |
qreal | minimumWidth () const |
Returns the minimum width. | |
void | setMinimumHeight (qreal height) |
Sets the minimum height to height. | |
qreal | minimumHeight () const |
Returns the minimum height. | |
void | setPreferredSize (const QSizeF &size) |
Sets the preferred size to size. | |
void | setPreferredSize (qreal w, qreal h) |
This convenience function is equivalent to calling setPreferredSize(QSizeF(w, h)). | |
QSizeF | preferredSize () const |
Returns the preferred size. | |
void | setPreferredWidth (qreal width) |
Sets the preferred width to width. | |
qreal | preferredWidth () const |
Returns the preferred width. | |
void | setPreferredHeight (qreal height) |
Sets the preferred height to height. | |
qreal | preferredHeight () const |
Returns the preferred height. | |
void | setMaximumSize (const QSizeF &size) |
Sets the maximum size to size. | |
void | setMaximumSize (qreal w, qreal h) |
This convenience function is equivalent to calling setMaximumSize(QSizeF(w, h)). | |
QSizeF | maximumSize () const |
Returns the maximum size. | |
void | setMaximumWidth (qreal width) |
Sets the maximum width to width. | |
qreal | maximumWidth () const |
Returns the maximum width. | |
void | setMaximumHeight (qreal height) |
Sets the maximum height to height. | |
qreal | maximumHeight () const |
Returns the maximum height. | |
QRectF | geometry () const |
Returns the item's geometry (e.g., position and size) as a QRectF. | |
QRectF | contentsRect () const |
Returns the contents rect in local coordinates. | |
QSizeF | effectiveSizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const |
Returns the effective size hint for this QGraphicsLayoutItem. | |
virtual bool | isEmpty () const |
QGraphicsLayoutItem * | parentLayoutItem () const |
Returns the parent of this QGraphicsLayoutItem, or \nullptr if there is no parent, or if the parent does not inherit from QGraphicsLayoutItem (QGraphicsLayoutItem is often used through multiple inheritance with QObject-derived classes). | |
void | setParentLayoutItem (QGraphicsLayoutItem *parent) |
Sets the parent of this QGraphicsLayoutItem to parent. | |
bool | isLayout () const |
Returns true if this QGraphicsLayoutItem is a layout (e.g., is inherited by an object that arranges other QGraphicsLayoutItem objects); otherwise returns false . | |
QGraphicsItem * | graphicsItem () const |
Returns the QGraphicsItem that this layout item represents. | |
bool | ownedByLayout () const |
Static Public Member Functions | |
static void | setTabOrder (QGraphicsWidget *first, QGraphicsWidget *second) |
Moves the second widget around the ring of focus widgets so that keyboard focus moves from the first widget to the second widget when the Tab key is pressed. | |
Static Public Member Functions inherited from QObject | |
static QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection) |
\threadsafe | |
static QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection) |
template<typename Func1 , typename Func2 > | |
static QMetaObject::Connection | connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot) |
static bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member) |
\threadsafe | |
static bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member) |
static bool | disconnect (const QMetaObject::Connection &) |
Disconnect a connection. | |
template<typename Func1 , typename Func2 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot) |
template<typename Func1 > | |
static bool | disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero) |
Protected Member Functions | |
virtual void | initStyleOption (QStyleOption *option) const |
Populates a style option object for this widget based on its current state, and stores the output in option. | |
QSizeF | sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override |
\reimp | |
void | updateGeometry () override |
If this widget is currently managed by a layout, this function notifies the layout that the widget's size hints have changed and the layout may need to resize and reposition the widget accordingly. | |
QVariant | itemChange (GraphicsItemChange change, const QVariant &value) override |
\reimp | |
virtual QVariant | propertyChange (const QString &propertyName, const QVariant &value) |
bool | sceneEvent (QEvent *event) override |
QGraphicsWidget's implementation of sceneEvent() simply passes event to QGraphicsWidget::event(). | |
virtual bool | windowFrameEvent (QEvent *e) |
This event handler, for event, receives events for the window frame if this widget is a window. | |
virtual Qt::WindowFrameSection | windowFrameSectionAt (const QPointF &pos) const |
bool | event (QEvent *event) override |
\reimp | |
virtual void | changeEvent (QEvent *event) |
This event handler can be reimplemented to handle state changes. | |
virtual void | closeEvent (QCloseEvent *event) |
This event handler, for event, can be reimplemented in a subclass to receive widget close events. | |
void | focusInEvent (QFocusEvent *event) override |
\reimp | |
virtual 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; returns false otherwise. | |
void | focusOutEvent (QFocusEvent *event) override |
\reimp | |
virtual void | hideEvent (QHideEvent *event) |
This event handler, for \l{QEvent::Hide}{Hide} events, is delivered after the widget has been hidden, for example, setVisible(false) has been called for the widget or one of its ancestors when the widget was previously shown. | |
virtual void | moveEvent (QGraphicsSceneMoveEvent *event) |
This event handler, for \l{QEvent::GraphicsSceneMove}{GraphicsSceneMove} events, is delivered after the widget has moved (e.g., its local position has changed). | |
virtual void | polishEvent () |
This event is delivered to the item by the scene at some point after it has been constructed, but before it is shown or otherwise accessed through the scene. | |
virtual void | resizeEvent (QGraphicsSceneResizeEvent *event) |
This event handler, for \l{QEvent::GraphicsSceneResize}{GraphicsSceneResize} events, is delivered after the widget has been resized (i.e., its local size has changed). | |
virtual void | showEvent (QShowEvent *event) |
This event handler, for \l{QEvent::Show}{Show} events, is delivered before the widget has been shown, for example, setVisible(true) has been called for the widget or one of its ancestors when the widget was previously hidden. | |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) override |
\reimp | |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) override |
\reimp | |
virtual void | grabMouseEvent (QEvent *event) |
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabMouse events. | |
virtual void | ungrabMouseEvent (QEvent *event) |
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::UngrabMouse events. | |
virtual void | grabKeyboardEvent (QEvent *event) |
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabKeyboard events. | |
virtual void | ungrabKeyboardEvent (QEvent *event) |
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::UngrabKeyboard events. | |
QGraphicsWidget (QGraphicsWidgetPrivate &, QGraphicsItem *parent, Qt::WindowFlags wFlags=Qt::WindowFlags()) | |
Protected Member Functions inherited from QGraphicsObject | |
QGraphicsObject (QGraphicsItemPrivate &dd, QGraphicsItem *parent) | |
Constructs a QGraphicsObject with parent. | |
Protected Member Functions inherited from QObject | |
QObject * | sender () const |
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr. | |
int | senderSignalIndex () const |
int | receivers (const char *signal) const |
Returns the number of receivers connected to the signal. | |
bool | isSignalConnected (const QMetaMethod &signal) const |
virtual void | timerEvent (QTimerEvent *event) |
This event handler can be reimplemented in a subclass to receive timer events for the object. | |
virtual void | childEvent (QChildEvent *event) |
This event handler can be reimplemented in a subclass to receive child events. | |
virtual void | customEvent (QEvent *event) |
This event handler can be reimplemented in a subclass to receive custom events. | |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
QObject (QObjectPrivate &dd, QObject *parent=nullptr) | |
Protected Member Functions inherited from QGraphicsItem | |
void | updateMicroFocus () |
Updates the item's micro focus. | |
virtual bool | sceneEventFilter (QGraphicsItem *watched, QEvent *event) |
Filters events for the item watched. | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
This event handler can be reimplemented in a subclass to process context menu events. | |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
This event handler, for event event, can be reimplemented to receive drag enter events for this item. | |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
This event handler, for event event, can be reimplemented to receive drag leave events for this item. | |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
This event handler, for event event, can be reimplemented to receive drag move events for this item. | |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
This event handler, for event event, can be reimplemented to receive drop events for this item. | |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
This event handler, for event event, can be reimplemented to receive hover enter events for this item. | |
virtual void | keyPressEvent (QKeyEvent *event) |
This event handler, for event event, can be reimplemented to receive key press events for this item. | |
virtual void | keyReleaseEvent (QKeyEvent *event) |
This event handler, for event event, can be reimplemented to receive key release events for this item. | |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
This event handler, for event event, can be reimplemented to receive mouse press events for this item. | |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
This event handler, for event event, can be reimplemented to receive mouse move events for this item. | |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
This event handler, for event event, can be reimplemented to receive mouse release events for this item. | |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
This event handler, for event event, can be reimplemented to receive mouse double-click events for this item. | |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *event) |
This event handler, for event event, can be reimplemented to receive wheel events for this item. | |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
This event handler, for event event, can be reimplemented to receive input method events for this item. | |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
This method is only relevant for input items. | |
virtual bool | supportsExtension (Extension extension) const |
virtual void | setExtension (Extension extension, const QVariant &variant) |
virtual QVariant | extension (const QVariant &variant) const |
QGraphicsItem (QGraphicsItemPrivate &dd, QGraphicsItem *parent) | |
void | addToIndex () |
void | removeFromIndex () |
void | prepareGeometryChange () |
Prepares the item for a geometry change. | |
Protected Member Functions inherited from QGraphicsLayoutItem | |
void | setGraphicsItem (QGraphicsItem *item) |
If the QGraphicsLayoutItem represents a QGraphicsItem, and it wants to take advantage of the automatic reparenting capabilities of QGraphicsLayout it should set this value. | |
void | setOwnedByLayout (bool ownedByLayout) |
QGraphicsLayoutItem (QGraphicsLayoutItemPrivate &dd) | |
Properties | |
QPalette | palette |
the widget's palette | |
QFont | font |
the widgets' font | |
Qt::LayoutDirection | layoutDirection |
the layout direction for this widget. | |
QSizeF | size |
the size of the widget | |
QSizeF | minimumSize |
the minimum size of the widget | |
QSizeF | preferredSize |
the preferred size of the widget | |
QSizeF | maximumSize |
the maximum size of the widget | |
QSizePolicy | sizePolicy |
the size policy for the widget | |
Qt::FocusPolicy | focusPolicy |
the way the widget accepts keyboard focus | |
Qt::WindowFlags | windowFlags |
the widget's window flags | |
QString | windowTitle |
This property holds the window title (caption). | |
QRectF | geometry |
the geometry of the widget | |
bool | autoFillBackground |
whether the widget background is filled automatically | |
QGraphicsLayout * | layout |
The layout of the widget. | |
Properties inherited from QGraphicsObject | |
QGraphicsObject * | parent |
the parent of the item | |
qreal | opacity |
the opacity of the item | |
bool | enabled |
whether the item is enabled or not | |
bool | visible |
whether the item is visible or not | |
QPointF | pos |
the position of the item | |
qreal | x |
the x position of the item | |
qreal | y |
the y position of the item | |
qreal | z |
the z value of the item | |
qreal | rotation |
the rotation of the item in degrees. | |
qreal | scale |
the scale of the item. | |
QPointF | transformOriginPoint |
the transformation origin | |
Properties inherited from QObject | |
QString | objectName |
the name of this object | |
Friends | |
class | QGraphicsScene |
class | QGraphicsScenePrivate |
class | QGraphicsView |
class | QGraphicsItem |
class | QGraphicsItemPrivate |
class | QGraphicsLayout |
class | QWidget |
class | QApplication |
Additional Inherited Members | |
Protected Types inherited from QGraphicsItem | |
enum | Extension { UserExtension = 0x80000000 } |
Protected Slots inherited from QGraphicsObject | |
void | updateMicroFocus () |
Updates the item's micro focus. | |
Protected Attributes inherited from QObject | |
QScopedPointer< QObjectData > | d_ptr |
Protected Attributes inherited from QGraphicsItem | |
QScopedPointer< QGraphicsItemPrivate > | d_ptr |
Protected Attributes inherited from QGraphicsLayoutItem | |
QScopedPointer< QGraphicsLayoutItemPrivate > | d_ptr |
Related Symbols inherited from QObject | |
template< class T > T | qobject_cast (const QObject *object) |
Returns the given object cast to type T if the object is of type T (or of a subclass); otherwise returns \nullptr. | |
template< typename T > T | qFindChildqFindChildren (const QObject *obj, const QString &name)() |
template< typename T > QList< T > | qFindChildrenqFindChildren (const QObject *obj, const QString &name)() |
QObjectList | |
\macro Q_CLASSINFO(Name, Value) | |
Related Symbols inherited from QGraphicsItem | |
template< class T > | qgraphicsitem_cast (QGraphicsItem *item) |
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene.
\inmodule QtWidgets
QGraphicsWidget is an extended base item that provides extra functionality over QGraphicsItem. It is similar to QWidget in many ways:
\list
Unlike QGraphicsItem, QGraphicsWidget is not an abstract class; you can create instances of a QGraphicsWidget without having to subclass it. This approach is useful for widgets that only serve the purpose of organizing child widgets into a layout.
QGraphicsWidget can be used as a base item for your own custom item if you require advanced input focus handling, e.g., tab focus and activation, or layouts.
Since QGraphicsWidget resembles QWidget and has similar API, it is easier to port a widget from QWidget to QGraphicsWidget, instead of QGraphicsItem.
Noticeable differences between QGraphicsWidget and QWidget are:
\table \header
QGraphicsWidget supports a subset of Qt's widget attributes, (Qt::WidgetAttribute), as shown in the table below. Any attributes not listed in this table are unsupported, or otherwise unused.
\table \header
Although QGraphicsWidget inherits from both QObject and QGraphicsItem, you should use the functions provided by QGraphicsItem, not QObject, to manage the relationships between parent and child items. These functions control the stacking order of items as well as their ownership.
Definition at line 31 of file qgraphicswidget.h.
anonymous enum |
Enumerator | |
---|---|
Type |
Definition at line 126 of file qgraphicswidget.h.
QGraphicsWidget::QGraphicsWidget | ( | QGraphicsItem * | parent = nullptr, |
Qt::WindowFlags | wFlags = Qt::WindowFlags() ) |
Constructs a QGraphicsWidget instance.
The optional parent argument is passed to QGraphicsItem's constructor. The optional wFlags argument specifies the widget's window flags (e.g., whether the widget should be a window, a tool, a popup, etc).
Definition at line 142 of file qgraphicswidget.cpp.
QGraphicsWidget::~QGraphicsWidget | ( | ) |
Destroys the QGraphicsWidget instance.
Definition at line 197 of file qgraphicswidget.cpp.
|
protected |
Constructs a new QGraphicsWidget, using dd as parent.
Definition at line 154 of file qgraphicswidget.cpp.
Returns the (possibly empty) list of this widget's actions.
Definition at line 2063 of file qgraphicswidget.cpp.
Appends the action action to this widget's list of actions.
All QGraphicsWidgets have a list of \l{QAction}s, however they can be represented graphically in many different ways. The default use of the QAction list (as returned by actions()) is to create a context QMenu.
A QGraphicsWidget should only have one of each action and adding an action it already has will not cause the same action to be in the widget twice.
Definition at line 1957 of file qgraphicswidget.cpp.
Appends the actions actions to this widget's list of actions.
Definition at line 1969 of file qgraphicswidget.cpp.
void QGraphicsWidget::adjustSize | ( | ) |
Adjusts the size of the widget to its effective preferred size hint.
This function is called implicitly when the item is shown for the first time.
Definition at line 824 of file qgraphicswidget.cpp.
bool QGraphicsWidget::autoFillBackground | ( | ) | const |
Definition at line 1009 of file qgraphicswidget.cpp.
|
overridevirtual |
This event handler can be reimplemented to handle state changes.
The state being changed in this event can be retrieved through event.
Change events include: QEvent::ActivationChange, QEvent::EnabledChange, QEvent::FontChange, QEvent::StyleChange, QEvent::PaletteChange, QEvent::ParentChange, QEvent::LayoutDirectionChange, and QEvent::ContentsRectChange.
Definition at line 1450 of file qgraphicswidget.cpp.
|
inline |
Returns a list of child objects.
The QObjectList class is defined in the {<QObject>} header file as the following:
\quotefromfile kernel/qobject.h \skipto /typedef .*QObjectList/ \printuntil QObjectList
The first child added is the \l{QList::first()}{first} object in the list and the last child added is the \l{QList::last()}{last} object in the list, i.e. new children are appended at the end.
Note that the list order changes when QWidget children are \l{QWidget::raise()}{raised} or \l{QWidget::lower()}{lowered}. A widget that is raised becomes the last object in the list, and a widget that is lowered becomes the first object in the list.
|
slot |
Call this function to close the widget.
Returns true
if the widget was closed; otherwise returns false
. This slot will first send a QCloseEvent to the widget, which may or may not accept the event. If the event was ignored, nothing happens. If the event was accepted, it will hide() the widget.
If the widget has the Qt::WA_DeleteOnClose attribute set it will be deleted.
Definition at line 2341 of file qgraphicswidget.cpp.
|
protectedvirtual |
This event handler, for event, can be reimplemented in a subclass to receive widget close events.
The default implementation accepts the event.
Definition at line 1483 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
\reimp
Handles the event. QGraphicsWidget handles the following events:
\table \header
Reimplemented from QGraphicsObject.
Definition at line 1349 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
|
protectedvirtual |
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; returns false
otherwise.
If next is true, this function searches forward; if next is false, it searches backward.
Sometimes, you will want to reimplement this function to provide special focus handling for your widget and its subwidgets. For example, a web browser might reimplement it to move its current active link forward or backward, and call the base implementation only when it reaches the last or first link on the page.
Child widgets call focusNextPrevChild() on their parent widgets, but only the window that contains the child widgets decides where to redirect focus. By reimplementing this function for an object, you gain control of focus traversal for all child widgets.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1517 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
Qt::FocusPolicy QGraphicsWidget::focusPolicy | ( | ) | const |
Definition at line 1813 of file qgraphicswidget.cpp.
QGraphicsWidget * QGraphicsWidget::focusWidget | ( | ) | const |
If this widget, a child or descendant of this widget currently has input focus, this function will return a pointer to that widget.
If no descendant widget has input focus, \nullptr is returned.
Definition at line 1836 of file qgraphicswidget.cpp.
QFont QGraphicsWidget::font | ( | ) | const |
Definition at line 936 of file qgraphicswidget.cpp.
|
signal |
This signal gets emitted whenever the geometry is changed in setGeometry().
|
overridevirtual |
Gets the widget's contents margins.
The margins are stored in left, top, right and bottom, as pointers to qreals. Each argument can be {omitted} by passing \nullptr.
Reimplemented from QGraphicsLayoutItem.
Definition at line 492 of file qgraphicswidget.cpp.
void QGraphicsWidget::getWindowFrameMargins | ( | qreal * | left, |
qreal * | top, | ||
qreal * | right, | ||
qreal * | bottom ) const |
Gets the widget's window frame margins.
The margins are stored in left, top, right and bottom as pointers to qreals. Each argument can be {omitted} by passing \nullptr.
Definition at line 551 of file qgraphicswidget.cpp.
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabKeyboard events.
Definition at line 1680 of file qgraphicswidget.cpp.
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::GrabMouse events.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1658 of file qgraphicswidget.cpp.
int QGraphicsWidget::grabShortcut | ( | const QKeySequence & | sequence, |
Qt::ShortcutContext | context = Qt::WindowShortcut ) |
Adds a shortcut to Qt's shortcut system that watches for the given key sequence in the given context. If the context is Qt::ApplicationShortcut, the shortcut applies to the application as a whole. Otherwise, it is either local to this widget, Qt::WidgetShortcut, or to the window itself, Qt::WindowShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WindowShortcut shortcuts apply to the scene.
If the same key sequence has been grabbed by several widgets, when the key sequence occurs a QEvent::Shortcut event is sent to all the widgets to which it applies in a non-deterministic order, but with the `‘ambiguous’' flag set to true.
Definition at line 1872 of file qgraphicswidget.cpp.
|
protectedvirtual |
This event handler, for \l{QEvent::Hide}{Hide} events, is delivered after the widget has been hidden, for example, setVisible(false) has been called for the widget or one of its ancestors when the widget was previously shown.
You can reimplement this event handler to detect when your widget is hidden. Calling QEvent::accept() or QEvent::ignore() on event has no effect.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1558 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QGraphicsItem.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1647 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
\reimp
Reimplemented from QGraphicsItem.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1639 of file qgraphicswidget.cpp.
|
protectedvirtual |
Populates a style option object for this widget based on its current state, and stores the output in option.
The default implementation populates option with the following properties.
\table \header
Subclasses of QGraphicsWidget should call the base implementation, and then test the type of option using qstyleoption_cast<>() or test QStyleOption::Type before storing widget-specific options.
For example:
Definition at line 659 of file qgraphicswidget.cpp.
Inserts the action action to this widget's list of actions, before the action before. It appends the action if before is \nullptr or before is not a valid action for this widget.
A QGraphicsWidget should only have one of each action.
Definition at line 1987 of file qgraphicswidget.cpp.
Inserts the actions actions to this widget's list of actions, before the action before. It appends the action if before is \nullptr or before is not a valid action for this widget.
A QGraphicsWidget can have at most one of each action.
Definition at line 2026 of file qgraphicswidget.cpp.
bool QGraphicsWidget::isActiveWindow | ( | ) | const |
Returns true
if this widget's window is in the active window, or if the widget does not have a window but is in an active scene (i.e., a scene that currently has focus).
The active window is the window that either contains a child widget that currently has input focus, or that itself has input focus.
Definition at line 1767 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
\reimp
QGraphicsWidget uses the base implementation of this function to catch and deliver events related to state changes in the item. Because of this, it is very important that subclasses call the base implementation.
change specifies the type of change, and value is the new value.
For example, QGraphicsWidget uses ItemVisibleChange to deliver \l{QEvent::Show} {Show} and \l{QEvent::Hide}{Hide} events, ItemPositionHasChanged to deliver \l{QEvent::Move}{Move} events, and ItemParentChange both to deliver \l{QEvent::ParentChange} {ParentChange} events, and for managing the focus chain.
QGraphicsWidget enables the ItemSendsGeometryChanges flag by default in order to track position changes.
Reimplemented from QGraphicsItem.
Reimplemented in qdesigner_internal::ZoomProxyWidget.
Definition at line 1086 of file qgraphicswidget.cpp.
QGraphicsLayout * QGraphicsWidget::layout | ( | ) | const |
Returns this widget's layout, or \nullptr if no layout is currently managing this widget.
Definition at line 766 of file qgraphicswidget.cpp.
|
signal |
This signal gets emitted whenever the layout of the item changes.
Qt::LayoutDirection QGraphicsWidget::layoutDirection | ( | ) | const |
Definition at line 858 of file qgraphicswidget.cpp.
|
protectedvirtual |
This event handler, for \l{QEvent::GraphicsSceneMove}{GraphicsSceneMove} events, is delivered after the widget has moved (e.g., its local position has changed).
This event is only delivered when the item is moved locally. Calling setTransform() or moving any of the item's ancestors does not affect the item's local position.
You can reimplement this event handler to detect when your widget has moved. Calling QEvent::accept() or QEvent::ignore() on event has no effect.
Definition at line 1580 of file qgraphicswidget.cpp.
|
overridevirtual |
|
virtual |
This virtual function is called by QGraphicsScene to draw the window frame for windows using painter, option, and widget, in local coordinates.
The base implementation uses the current style to render the frame and title bar.
You can reimplement this function in a subclass of QGraphicsWidget to provide custom rendering of the widget's window frame.
Definition at line 2217 of file qgraphicswidget.cpp.
QPalette QGraphicsWidget::palette | ( | ) | const |
Definition at line 978 of file qgraphicswidget.cpp.
|
protectedvirtual |
This event is delivered to the item by the scene at some point after it has been constructed, but before it is shown or otherwise accessed through the scene.
You can use this event handler to do last-minute initializations of the widget which require the item to be fully constructed.
The base implementation does nothing.
Definition at line 1594 of file qgraphicswidget.cpp.
|
protectedvirtual |
This virtual function is used to notify changes to any property (both dynamic properties, and registered with Q_PROPERTY) in the widget. Depending on the property itself, the notification can be delivered before or after the value has changed.
propertyName is the name of the property (e.g., "size" or "font"), and value is the (proposed) new value of the property. The function returns the new value, which may be different from value if the notification supports adjusting the property value. The base implementation simply returns value for any propertyName.
QGraphicsWidget delivers notifications for the following properties:
\table \header
Definition at line 1178 of file qgraphicswidget.cpp.
|
inline |
Returns the item's local rect as a QRectF.
This function is equivalent to QRectF(QPointF(), size()).
Definition at line 79 of file qgraphicswidget.h.
void QGraphicsWidget::releaseShortcut | ( | int | id | ) |
Removes the shortcut with the given id from Qt's shortcut system. The widget will no longer receive QEvent::Shortcut events for the shortcut's key sequence (unless it has other shortcuts with the same key sequence).
Definition at line 1898 of file qgraphicswidget.cpp.
Removes the action action from this widget's list of actions.
Definition at line 2039 of file qgraphicswidget.cpp.
Definition at line 278 of file qgraphicswidget.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Constructs a resize with the given width
(w) and height
(h).
This convenience function is equivalent to calling resize(QSizeF(w, h)).
Definition at line 74 of file qgraphicswidget.h.
|
protectedvirtual |
This event handler, for \l{QEvent::GraphicsSceneResize}{GraphicsSceneResize} events, is delivered after the widget has been resized (i.e., its local size has changed).
event contains both the old and the new size.
This event is only delivered when the widget is resized locally; calling setTransform() on the widget or any of its ancestors or view, does not affect the widget's local size.
You can reimplement this event handler to detect when your widget has been resized. Calling QEvent::accept() or QEvent::ignore() on event has no effect.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1614 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
QGraphicsWidget's implementation of sceneEvent() simply passes event to QGraphicsWidget::event().
You can handle all events for your widget in event() or in any of the convenience functions; you should not have to reimplement this function in a subclass of QGraphicsWidget.
Returns true
if event has been recognized and processed; otherwise, returns false
.
Reimplemented from QGraphicsItem.
Definition at line 1195 of file qgraphicswidget.cpp.
void QGraphicsWidget::setAttribute | ( | Qt::WidgetAttribute | attribute, |
bool | on = true ) |
If on is true, this function enables attribute; otherwise attribute is disabled.
See the class documentation for QGraphicsWidget for a complete list of which attributes are supported, and what they are for.
Definition at line 2159 of file qgraphicswidget.cpp.
void QGraphicsWidget::setAutoFillBackground | ( | bool | enabled | ) |
Definition at line 1014 of file qgraphicswidget.cpp.
Sets the widget's contents margins to margins.
Contents margins are used by the assigned layout to define the placement of subwidgets and layouts. Margins are particularly useful for widgets that constrain subwidgets to only a section of its own geometry. For example, a group box with a layout will place subwidgets inside its frame, but below the title.
Changing a widget's contents margins will always trigger an update(), and any assigned layout will be activated automatically. The widget will then receive a \l{QEvent::ContentsRectChange}{ContentsRectChange} event.
Definition at line 453 of file qgraphicswidget.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the widget's contents margins to left, top, right and bottom.
Definition at line 480 of file qgraphicswidget.cpp.
void QGraphicsWidget::setFocusPolicy | ( | Qt::FocusPolicy | policy | ) |
Definition at line 1818 of file qgraphicswidget.cpp.
Definition at line 943 of file qgraphicswidget.cpp.
This virtual function sets the geometry of the QGraphicsLayoutItem to rect, which is in parent coordinates (e.g., the top-left corner of rect is equivalent to the item's position in parent coordinates).
You must reimplement this function in a subclass of QGraphicsLayoutItem to receive geometry updates. The layout will call this function when it does a rearrangement.
If rect is outside of the bounds of minimumSize and maximumSize, it will be adjusted to its closest size so that it is within the legal bounds.
Reimplemented from QGraphicsLayoutItem.
Definition at line 319 of file qgraphicswidget.cpp.
This convenience function is equivalent to calling setGeometry(QRectF( x, y, w, h)).
Definition at line 203 of file qgraphicswidget.h.
void QGraphicsWidget::setLayout | ( | QGraphicsLayout * | layout | ) |
Sets the layout for this widget to layout.
Any existing layout manager is deleted before the new layout is assigned. If layout is \nullptr, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.
All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.
QGraphicsWidget takes ownership of layout.
Definition at line 791 of file qgraphicswidget.cpp.
void QGraphicsWidget::setLayoutDirection | ( | Qt::LayoutDirection | direction | ) |
Definition at line 862 of file qgraphicswidget.cpp.
Definition at line 983 of file qgraphicswidget.cpp.
void QGraphicsWidget::setShortcutAutoRepeat | ( | int | id, |
bool | enabled = true ) |
If enabled is true, auto repeat of the shortcut with the given id is enabled; otherwise it is disabled.
Definition at line 1934 of file qgraphicswidget.cpp.
void QGraphicsWidget::setShortcutEnabled | ( | int | id, |
bool | enabled = true ) |
If enabled is true, the shortcut with the given id is enabled; otherwise the shortcut is disabled.
Definition at line 1919 of file qgraphicswidget.cpp.
Sets the widget's style to style.
QGraphicsWidget does not take ownership of style.
If no style is assigned, or style is \nullptr, the widget will use QGraphicsScene::style() (if this has been set). Otherwise the widget will use QApplication::style().
This function sets the Qt::WA_SetStyle attribute if style is not \nullptr; otherwise it clears the attribute.
Definition at line 904 of file qgraphicswidget.cpp.
|
static |
Moves the second widget around the ring of focus widgets so that keyboard focus moves from the first widget to the second widget when the Tab key is pressed.
Note that since the tab order of the second widget is changed, you should order a chain like this:
not like this:
If first is \nullptr, this indicates that second should be the first widget to receive input focus should the scene gain Tab focus (i.e., the user hits Tab so that focus passes into the scene). If second is \nullptr, this indicates that first should be the first widget to gain focus if the scene gained BackTab focus.
By default, tab order is defined implicitly using widget creation order.
Definition at line 2094 of file qgraphicswidget.cpp.
void QGraphicsWidget::setWindowFlags | ( | Qt::WindowFlags | wFlags | ) |
Definition at line 1728 of file qgraphicswidget.cpp.
If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.
Definition at line 518 of file qgraphicswidget.cpp.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Sets the widget's window frame margins to left, top, right and bottom.
Definition at line 539 of file qgraphicswidget.cpp.
Definition at line 1781 of file qgraphicswidget.cpp.
|
overridevirtual |
|
protectedvirtual |
This event handler, for \l{QEvent::Show}{Show} events, is delivered before the widget has been shown, for example, setVisible(true) has been called for the widget or one of its ancestors when the widget was previously hidden.
You can reimplement this event handler to detect when your widget is shown. Calling QEvent::accept() or QEvent::ignore() on event has no effect.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1631 of file qgraphicswidget.cpp.
QSizeF QGraphicsWidget::size | ( | ) | const |
Definition at line 273 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
QStyle * QGraphicsWidget::style | ( | ) | const |
Returns a pointer to the widget's style.
If this widget does not have any explicitly assigned style, the scene's style is returned instead. In turn, if the scene does not have any assigned style, this function returns QApplication::style().
Definition at line 883 of file qgraphicswidget.cpp.
bool QGraphicsWidget::testAttribute | ( | Qt::WidgetAttribute | attribute | ) | const |
Returns true
if attribute is enabled for this widget; otherwise, returns false
.
Definition at line 2174 of file qgraphicswidget.cpp.
|
overridevirtual |
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::UngrabKeyboard events.
Definition at line 1691 of file qgraphicswidget.cpp.
This event handler, for event, can be reimplemented in a subclass to receive notifications for QEvent::UngrabMouse events.
Reimplemented in QGraphicsProxyWidget.
Definition at line 1669 of file qgraphicswidget.cpp.
void QGraphicsWidget::unsetLayoutDirection | ( | ) |
Definition at line 868 of file qgraphicswidget.cpp.
void QGraphicsWidget::unsetWindowFrameMargins | ( | ) |
Resets the window frame margins to the default value, provided by the style.
Definition at line 571 of file qgraphicswidget.cpp.
|
overrideprotectedvirtual |
If this widget is currently managed by a layout, this function notifies the layout that the widget's size hints have changed and the layout may need to resize and reposition the widget accordingly.
Call this function if the widget's sizeHint() has changed.
If this is the topmost widget, post a LayoutRequest event to the widget. When the event is received, it will start flowing all the way down to the leaf widgets in one go. This will make a relayout flicker-free.
Reimplemented from QGraphicsLayoutItem.
Definition at line 1032 of file qgraphicswidget.cpp.
Qt::WindowFlags QGraphicsWidget::windowFlags | ( | ) | const |
Definition at line 1723 of file qgraphicswidget.cpp.
|
protectedvirtual |
This event handler, for event, receives events for the window frame if this widget is a window.
Its base implementation provides support for default window frame interaction such as moving, resizing, etc.
You can reimplement this handler in a subclass of QGraphicsWidget to provide your own custom window frame interaction support.
Returns true
if event has been recognized and processed; otherwise, returns false
.
Definition at line 1213 of file qgraphicswidget.cpp.
QRectF QGraphicsWidget::windowFrameGeometry | ( | ) | const |
Returns the widget's geometry in parent coordinates including any window frame.
Definition at line 594 of file qgraphicswidget.cpp.
QRectF QGraphicsWidget::windowFrameRect | ( | ) | const |
Returns the widget's local rect including any window frame.
Definition at line 608 of file qgraphicswidget.cpp.
|
protectedvirtual |
Returns the window frame section at position pos, or Qt::NoSection if there is no window frame section at this position.
This function is used in QGraphicsWidget's base implementation for window frame interaction.
You can reimplement this function if you want to customize how a window can be interactively moved or resized. For instance, if you only want to allow a window to be resized by the bottom right corner, you can reimplement this function to return Qt::NoSection for all sections except Qt::BottomRightSection.
Definition at line 1260 of file qgraphicswidget.cpp.
QString QGraphicsWidget::windowTitle | ( | ) | const |
Definition at line 1787 of file qgraphicswidget.cpp.
Qt::WindowType QGraphicsWidget::windowType | ( | ) | const |
Returns the widgets window type.
Definition at line 1701 of file qgraphicswidget.cpp.
|
friend |
Definition at line 200 of file qgraphicswidget.h.
|
friend |
Definition at line 196 of file qgraphicswidget.h.
|
friend |
Definition at line 197 of file qgraphicswidget.h.
|
friend |
Definition at line 198 of file qgraphicswidget.h.
|
friend |
Definition at line 193 of file qgraphicswidget.h.
|
friend |
Definition at line 194 of file qgraphicswidget.h.
|
friend |
Definition at line 195 of file qgraphicswidget.h.
|
friend |
Definition at line 199 of file qgraphicswidget.h.
|
readwrite |
whether the widget background is filled automatically
If enabled, this property will cause Qt to fill the background of the widget before invoking the paint() method. The color used is defined by the QPalette::Window color role from the widget's \l{QPalette}{palette}.
In addition, Windows are always filled with QPalette::Window, unless the WA_OpaquePaintEvent or WA_NoSystemBackground attributes are set.
By default, this property is false
.
Definition at line 48 of file qgraphicswidget.h.
|
readwrite |
the way the widget accepts keyboard focus
The focus policy is Qt::TabFocus if the widget accepts keyboard focus by tabbing, Qt::ClickFocus if the widget accepts focus by clicking, Qt::StrongFocus if it accepts both, and Qt::NoFocus (the default) if it does not accept focus at all.
You must enable keyboard focus for a widget if it processes keyboard events. This is normally done from the widget's constructor. For instance, the QLineEdit constructor calls setFocusPolicy(Qt::StrongFocus).
If you enable a focus policy (i.e., not Qt::NoFocus), QGraphicsWidget will automatically enable the ItemIsFocusable flag. Setting Qt::NoFocus on a widget will clear the ItemIsFocusable flag. If the widget currently has keyboard focus, the widget will automatically lose focus.
Definition at line 44 of file qgraphicswidget.h.
|
readwrite |
the widgets' font
This property provides the widget's font.
QFont consists of font properties that have been explicitly defined and properties implicitly inherited from the widget's parent. Hence, font() can return a different font compared to the one set with setFont(). This scheme allows you to define single entries in a font without affecting the font's inherited entries.
When a widget's font changes, it resolves its entries against its parent widget. If the widget does not have a parent widget, it resolves its entries against the scene. The widget then sends itself a \l{QEvent::FontChange}{FontChange} event and notifies all its descendants so that they can resolve their fonts as well.
By default, this property contains the application's default font.
Definition at line 36 of file qgraphicswidget.h.
|
readwrite |
the geometry of the widget
Sets the item's geometry to rect. The item's position and size are modified as a result of calling this function. The item is first moved, then resized.
A side effect of calling this function is that the widget will receive a move event and a resize event. Also, if the widget has a layout assigned, the layout will activate.
Definition at line 47 of file qgraphicswidget.h.
|
readwrite |
The layout of the widget.
Any existing layout manager is deleted before the new layout is assigned. If layout is \nullptr, the widget is left without a layout. Existing subwidgets' geometries will remain unaffected.
QGraphicsWidget takes ownership of layout.
All widgets that are currently managed by layout or all of its sublayouts, are automatically reparented to this item. The layout is then invalidated, and the child widget geometries are adjusted according to this item's geometry() and contentsMargins(). Children who are not explicitly managed by layout remain unaffected by the layout after it has been assigned to this widget.
If no layout is currently managing this widget, layout() will return \nullptr.
Definition at line 49 of file qgraphicswidget.h.
|
readwrite |
the layout direction for this widget.
This property modifies this widget's and all of its descendants' Qt::WA_RightToLeft attribute. It also sets this widget's Qt::WA_SetLayoutDirection attribute.
The widget's layout direction determines the order in which the layout manager horizontally arranges subwidgets of this widget. The default value depends on the language and locale of the application, and is typically in the same direction as words are read and written. With Qt::LeftToRight, the layout starts placing subwidgets from the left side of this widget towards the right. Qt::RightToLeft does the opposite - the layout will place widgets starting from the right edge moving towards the left.
Subwidgets inherit their layout direction from the parent. Top-level widget items inherit their layout direction from QGraphicsScene::layoutDirection. If you change a widget's layout direction by calling setLayoutDirection(), the widget will send itself a \l{QEvent::LayoutDirectionChange}{LayoutDirectionChange} event, and then propagate the new layout direction to all its descendants.
Definition at line 37 of file qgraphicswidget.h.
|
readwrite |
the maximum size of the widget
Definition at line 42 of file qgraphicswidget.h.
|
readwrite |
the minimum size of the widget
Definition at line 40 of file qgraphicswidget.h.
|
readwrite |
the widget's palette
This property provides the widget's palette. The palette provides colors and brushes for color groups (e.g., QPalette::Button) and states (e.g., QPalette::Inactive), loosely defining the general look of the widget and its children.
QPalette consists of color groups that have been explicitly defined, and groups that are implicitly inherited from the widget's parent. Because of this, palette() can return a different palette than what has been set with setPalette(). This scheme allows you to define single entries in a palette without affecting the palette's inherited entries.
When a widget's palette changes, it resolves its entries against its parent widget, or if it doesn't have a parent widget, it resolves against the scene. It then sends itself a \l{QEvent::PaletteChange}{PaletteChange} event, and notifies all its descendants so they can resolve their palettes as well.
By default, this property contains the application's default palette.
Definition at line 35 of file qgraphicswidget.h.
|
readwrite |
the preferred size of the widget
Definition at line 41 of file qgraphicswidget.h.
|
readwrite |
the size of the widget
Calling resize() resizes the widget to a size bounded by minimumSize() and maximumSize(). This property only affects the widget's width and height (e.g., its right and bottom edges); the widget's position and top-left corner remains unaffected.
Resizing a widget triggers the widget to immediately receive a \l{QEvent::GraphicsSceneResize}{GraphicsSceneResize} event with the widget's old and new size. If the widget has a layout assigned when this event arrives, the layout will be activated and it will automatically update any child widgets's geometry.
This property does not affect any layout of the parent widget. If the widget itself is managed by a parent layout; e.g., it has a parent widget with a layout assigned, that layout will not activate.
By default, this property contains a size with zero width and height.
Definition at line 39 of file qgraphicswidget.h.
|
readwrite |
the size policy for the widget
Definition at line 43 of file qgraphicswidget.h.
|
readwrite |
the widget's window flags
Window flags are a combination of a window type (e.g., Qt::Dialog) and several flags giving hints on the behavior of the window. The behavior is platform-dependent.
By default, this property contains no window flags.
Windows are panels. If you set the Qt::Window flag, the ItemIsPanel flag will be set automatically. If you clear the Qt::Window flag, the ItemIsPanel flag is also cleared. Note that the ItemIsPanel flag can be set independently of Qt::Window.
Definition at line 45 of file qgraphicswidget.h.
|
readwrite |
This property holds the window title (caption).
This property is only used for windows.
By default, if no title has been set, this property contains an empty string.
Definition at line 46 of file qgraphicswidget.h.