CopperSpice API
1.9.2
|
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene. More...
Public Signals | |
void | geometryChanged () |
Public Signals inherited from QGraphicsObject | |
void | enabledChanged () |
void | opacityChanged () |
void | parentChanged () |
void | rotationChanged () |
void | scaleChanged () |
void | visibleChanged () |
void | xChanged () |
void | yChanged () |
void | zChanged () |
Public Signals inherited from QObject | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots | |
bool | close () |
Public Slots inherited from QObject | |
void | deleteLater () |
Public Methods | |
QGraphicsWidget (QGraphicsItem *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) | |
~QGraphicsWidget () | |
QList< QAction * > | actions () const |
void | addAction (QAction *action) |
void | addActions (const QList< QAction * > &actions) |
void | adjustSize () |
bool | autoFillBackground () const |
QRectF | boundingRect () const override |
const QList< QObject * > & | children () const |
Qt::FocusPolicy | focusPolicy () const |
QGraphicsWidget * | focusWidget () const |
QFont | font () const |
void | getContentsMargins (qreal *left, qreal *top, qreal *right, qreal *bottom) const override |
void | getWindowFrameMargins (qreal *left, qreal *top, qreal *right, qreal *bottom) const |
int | grabShortcut (const QKeySequence &sequence, Qt::ShortcutContext context=Qt::WindowShortcut) |
void | insertAction (QAction *before, QAction *action) |
void | insertActions (QAction *before, QList< QAction * > actions) |
bool | isActiveWindow () const |
QGraphicsLayout * | layout () const |
Qt::LayoutDirection | layoutDirection () const |
void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
virtual void | paintWindowFrame (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) |
QPalette | palette () const |
QRectF | rect () const |
void | releaseShortcut (int id) |
void | removeAction (QAction *action) |
void | resize (const QSizeF &size) |
void | resize (qreal width, qreal height) |
void | setAttribute (Qt::WidgetAttribute attribute, bool on=true) |
void | setAutoFillBackground (bool enabled) |
void | setContentsMargins (qreal left, qreal top, qreal right, qreal bottom) |
void | setFocusPolicy (Qt::FocusPolicy policy) |
void | setFont (const QFont &font) |
void | setGeometry (const QRectF &rect) override |
void | setGeometry (const QRectF &size) |
void | setGeometry (qreal x, qreal y, qreal width, qreal height) |
void | setLayout (QGraphicsLayout *layout) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setPalette (const QPalette &palette) |
void | setShortcutAutoRepeat (int id, bool enabled=true) |
void | setShortcutEnabled (int id, bool enabled=true) |
void | setStyle (QStyle *style) |
void | setWindowFlags (Qt::WindowFlags flags) |
void | setWindowFrameMargins (qreal left, qreal top, qreal right, qreal bottom) |
void | setWindowTitle (const QString &title) |
QPainterPath | shape () const override |
QSizeF | size () const |
QStyle * | style () const |
bool | testAttribute (Qt::WidgetAttribute attribute) const |
int | type () const override |
void | unsetLayoutDirection () |
void | unsetWindowFrameMargins () |
Qt::WindowFlags | windowFlags () const |
QRectF | windowFrameGeometry () const |
QRectF | windowFrameRect () const |
QString | windowTitle () const |
Qt::WindowType | windowType () const |
Public Methods inherited from QGraphicsObject | |
QGraphicsObject (QGraphicsItem *parent=nullptr) | |
const QList< QObject * > & | children () const |
void | grabGesture (Qt::GestureType gesture, Qt::GestureFlags flags=Qt::GestureFlags ()) |
void | ungrabGesture (Qt::GestureType gesture) |
Public Methods inherited from QObject | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Public Methods inherited from QGraphicsItem | |
QGraphicsItem (QGraphicsItem *parent=nullptr) | |
virtual | ~QGraphicsItem () |
bool | acceptDrops () const |
Qt::MouseButtons | acceptedMouseButtons () const |
bool | acceptHoverEvents () const |
bool | acceptTouchEvents () const |
virtual void | advance (int phase) |
virtual QRectF | boundingRect () const = 0 |
QRegion | boundingRegion (const QTransform &itemToDeviceTransform) const |
qreal | boundingRegionGranularity () const |
CacheMode | cacheMode () const |
QList< QGraphicsItem * > | childItems () const |
QRectF | childrenBoundingRect () const |
void | clearFocus () |
QPainterPath | clipPath () const |
virtual bool | collidesWithItem (const QGraphicsItem *graphicsItem, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
virtual bool | collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
QList< QGraphicsItem * > | collidingItems (Qt::ItemSelectionMode mode=Qt::IntersectsItemShape) const |
QGraphicsItem * | commonAncestorItem (const QGraphicsItem *graphicsItem) const |
virtual bool | contains (const QPointF &point) const |
QCursor | cursor () const |
QVariant | data (int key) const |
QTransform | deviceTransform (const QTransform &viewportTransform) const |
qreal | effectiveOpacity () const |
void | ensureVisible (const QRectF &rectF=QRectF (), int xmargin=50, int ymargin=50) |
void | ensureVisible (qreal x, qreal y, qreal width, qreal height, int xmargin=50, int ymargin=50) |
bool | filtersChildEvents () const |
GraphicsItemFlags | flags () const |
QGraphicsItem * | focusItem () const |
QGraphicsItem * | focusProxy () const |
void | grabKeyboard () |
void | grabMouse () |
QGraphicsEffect * | graphicsEffect () const |
QGraphicsItemGroup * | group () const |
bool | handlesChildEvents () const |
bool | hasCursor () const |
bool | hasFocus () const |
void | hide () |
Qt::InputMethodHints | inputMethodHints () const |
void | installSceneEventFilter (QGraphicsItem *filterItem) |
bool | isActive () const |
bool | isAncestorOf (const QGraphicsItem *graphicsItem) const |
bool | isBlockedByModalPanel (QGraphicsItem **blockingPanel=nullptr) const |
bool | isClipped () const |
bool | isEnabled () const |
bool | isObscured (const QRectF &rectF=QRectF ()) const |
bool | isObscured (qreal x, qreal y, qreal width, qreal height) const |
virtual bool | isObscuredBy (const QGraphicsItem *graphicsItem) const |
bool | isPanel () const |
bool | isSelected () const |
bool | isUnderMouse () const |
bool | isVisible () const |
bool | isVisibleTo (const QGraphicsItem *graphicsItem) const |
bool | isWidget () const |
bool | isWindow () const |
QTransform | itemTransform (const QGraphicsItem *graphicsItem, bool *ok=nullptr) const |
QPainterPath | mapFromItem (const QGraphicsItem *graphicsItem, const QPainterPath &path) const |
QPointF | mapFromItem (const QGraphicsItem *graphicsItem, const QPointF &point) const |
QPolygonF | mapFromItem (const QGraphicsItem *graphicsItem, const QPolygonF &polygon) const |
QPolygonF | mapFromItem (const QGraphicsItem *graphicsItem, const QRectF &rectF) const |
QPointF | mapFromItem (const QGraphicsItem *graphicsItem, qreal x, qreal y) const |
QPolygonF | mapFromItem (const QGraphicsItem *graphicsItem, qreal x, qreal y, qreal width, qreal height) const |
QPainterPath | mapFromParent (const QPainterPath &path) const |
QPointF | mapFromParent (const QPointF &point) const |
QPolygonF | mapFromParent (const QPolygonF &polygon) const |
QPolygonF | mapFromParent (const QRectF &rectF) const |
QPointF | mapFromParent (qreal x, qreal y) const |
QPolygonF | mapFromParent (qreal x, qreal y, qreal width, qreal height) const |
QPainterPath | mapFromScene (const QPainterPath &path) const |
QPointF | mapFromScene (const QPointF &point) const |
QPolygonF | mapFromScene (const QPolygonF &polygon) const |
QPolygonF | mapFromScene (const QRectF &rectF) const |
QPointF | mapFromScene (qreal x, qreal y) const |
QPolygonF | mapFromScene (qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectFromItem (const QGraphicsItem *graphicsItem, const QRectF &rectF) const |
QRectF | mapRectFromItem (const QGraphicsItem *graphicsItem, qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectFromParent (const QRectF &rectF) const |
QRectF | mapRectFromParent (qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectFromScene (const QRectF &rectF) const |
QRectF | mapRectFromScene (qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectToItem (const QGraphicsItem *graphicsItem, const QRectF &rectF) const |
QRectF | mapRectToItem (const QGraphicsItem *graphicsItem, qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectToParent (const QRectF &rectF) const |
QRectF | mapRectToParent (qreal x, qreal y, qreal width, qreal height) const |
QRectF | mapRectToScene (const QRectF &rectF) const |
QRectF | mapRectToScene (qreal x, qreal y, qreal width, qreal height) const |
QPainterPath | mapToItem (const QGraphicsItem *graphicsItem, const QPainterPath &path) const |
QPointF | mapToItem (const QGraphicsItem *graphicsItem, const QPointF &point) const |
QPolygonF | mapToItem (const QGraphicsItem *graphicsItem, const QPolygonF &polygon) const |
QPolygonF | mapToItem (const QGraphicsItem *graphicsItem, const QRectF &rectF) const |
QPointF | mapToItem (const QGraphicsItem *graphicsItem, qreal x, qreal y) const |
QPolygonF | mapToItem (const QGraphicsItem *graphicsItem, qreal x, qreal y, qreal width, qreal height) const |
QPainterPath | mapToParent (const QPainterPath &path) const |
QPointF | mapToParent (const QPointF &point) const |
QPolygonF | mapToParent (const QPolygonF &polygon) const |
QPolygonF | mapToParent (const QRectF &rectF) const |
QPointF | mapToParent (qreal x, qreal y) const |
QPolygonF | mapToParent (qreal x, qreal y, qreal width, qreal height) const |
QPainterPath | mapToScene (const QPainterPath &path) const |
QPointF | mapToScene (const QPointF &point) const |
QPolygonF | mapToScene (const QPolygonF &polygon) const |
QPolygonF | mapToScene (const QRectF &rectF) const |
QPointF | mapToScene (qreal x, qreal y) const |
QPolygonF | mapToScene (qreal x, qreal y, qreal width, qreal height) const |
QMatrix | matrix () const |
void | moveBy (qreal dx, qreal dy) |
qreal | opacity () const |
virtual QPainterPath | opaqueArea () const |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) = 0 |
QGraphicsItem * | panel () const |
PanelModality | panelModality () const |
QGraphicsItem * | parentItem () const |
QGraphicsObject * | parentObject () const |
QGraphicsWidget * | parentWidget () const |
QPointF | pos () const |
void | removeSceneEventFilter (QGraphicsItem *filterItem) |
void | resetMatrix () |
void | resetTransform () |
qreal | rotation () const |
qreal | scale () const |
QGraphicsScene * | scene () const |
QRectF | sceneBoundingRect () const |
QMatrix | sceneMatrix () const |
QPointF | scenePos () const |
QTransform | sceneTransform () const |
void | scroll (qreal dx, qreal dy, const QRectF &rectF=QRectF ()) |
void | setAcceptDrops (bool on) |
void | setAcceptedMouseButtons (Qt::MouseButtons buttons) |
void | setAcceptHoverEvents (bool enabled) |
void | setAcceptTouchEvents (bool enabled) |
void | setActive (bool active) |
void | setBoundingRegionGranularity (qreal granularity) |
void | setCacheMode (CacheMode mode, const QSize &cacheSize=QSize ()) |
void | setCursor (const QCursor &cursor) |
void | setData (int key, const QVariant &value) |
void | setEnabled (bool enabled) |
void | setFiltersChildEvents (bool enabled) |
void | setFlag (GraphicsItemFlag flag, bool enabled=true) |
void | setFlags (GraphicsItemFlags flags) |
void | setFocus (Qt::FocusReason focusReason=Qt::OtherFocusReason) |
void | setFocusProxy (QGraphicsItem *graphicsItem) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setGroup (QGraphicsItemGroup *group) |
void | setHandlesChildEvents (bool enabled) |
void | setInputMethodHints (Qt::InputMethodHints hints) |
void | setMatrix (const QMatrix &matrix, bool combine=false) |
void | setOpacity (qreal opacity) |
void | setPanelModality (PanelModality panelModality) |
void | setParentItem (QGraphicsItem *parent) |
void | setPos (const QPointF &pos) |
void | setPos (qreal x, qreal y) |
void | setRotation (qreal angle) |
void | setScale (qreal factor) |
void | setSelected (bool selected) |
void | setToolTip (const QString &toolTip) |
void | setTransform (const QTransform &matrix, bool combine=false) |
void | setTransformations (const QList< QGraphicsTransform * > &transformations) |
void | setTransformOriginPoint (const QPointF &origin) |
void | setTransformOriginPoint (qreal x, qreal y) |
void | setVisible (bool visible) |
void | setX (qreal x) |
void | setY (qreal y) |
void | setZValue (qreal z) |
virtual QPainterPath | shape () const |
void | show () |
void | stackBefore (const QGraphicsItem *graphicsItem) |
QGraphicsObject * | toGraphicsObject () |
const QGraphicsObject * | toGraphicsObject () const |
QString | toolTip () const |
QGraphicsItem * | topLevelItem () const |
QGraphicsWidget * | topLevelWidget () const |
QTransform | transform () const |
QList< QGraphicsTransform * > | transformations () const |
QPointF | transformOriginPoint () const |
virtual int | type () const |
void | ungrabKeyboard () |
void | ungrabMouse () |
void | unsetCursor () |
void | update (const QRectF &rectF=QRectF ()) |
void | update (qreal x, qreal y, qreal width, qreal height) |
QGraphicsWidget * | window () const |
qreal | x () const |
qreal | y () const |
qreal | zValue () const |
Public Methods inherited from QGraphicsLayoutItem | |
QGraphicsLayoutItem (QGraphicsLayoutItem *parent=nullptr, bool isLayout=false) | |
virtual | ~QGraphicsLayoutItem () |
QRectF | contentsRect () const |
QSizeF | effectiveSizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF ()) const |
QRectF | geometry () const |
QGraphicsItem * | graphicsItem () const |
bool | isLayout () const |
qreal | maximumHeight () const |
QSizeF | maximumSize () const |
qreal | maximumWidth () const |
qreal | minimumHeight () const |
QSizeF | minimumSize () const |
qreal | minimumWidth () const |
bool | ownedByLayout () const |
QGraphicsLayoutItem * | parentLayoutItem () const |
qreal | preferredHeight () const |
QSizeF | preferredSize () const |
qreal | preferredWidth () const |
void | setMaximumHeight (qreal height) |
void | setMaximumSize (const QSizeF &size) |
void | setMaximumSize (qreal w, qreal h) |
void | setMaximumWidth (qreal width) |
void | setMinimumHeight (qreal height) |
void | setMinimumSize (const QSizeF &size) |
void | setMinimumSize (qreal w, qreal h) |
void | setMinimumWidth (qreal width) |
void | setParentLayoutItem (QGraphicsLayoutItem *parent) |
void | setPreferredHeight (qreal height) |
void | setPreferredSize (const QSizeF &size) |
void | setPreferredSize (qreal w, qreal h) |
void | setPreferredWidth (qreal width) |
void | setSizePolicy (const QSizePolicy &policy) |
void | setSizePolicy (QSizePolicy::Policy hPolicy, QSizePolicy::Policy vPolicy, QSizePolicy::ControlType controlType=QSizePolicy::DefaultType) |
QSizePolicy | sizePolicy () const |
Static Public Methods | |
static void | setTabOrder (QGraphicsWidget *first, QGraphicsWidget *second) |
Static Public Methods inherited from QObject | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Properties | |
autoFillBackground | |
focusPolicy | |
font | |
geometry | |
layout | |
layoutDirection | |
maximumSize | |
minimumSize | |
palette | |
preferredSize | |
size | |
sizePolicy | |
windowFlags | |
windowTitle | |
Properties inherited from QGraphicsObject | |
effect | |
enabled | |
opacity | |
parent | |
pos | |
rotation | |
scale | |
transformOriginPoint | |
visible | |
x | |
y | |
z | |
Properties inherited from QObject | |
objectName | |
Friends | |
class | QApplication |
class | QGraphicsItem |
class | QGraphicsLayout |
class | QGraphicsScene |
class | QGraphicsView |
class | QWidget |
Additional Inherited Members | |
Public Typedefs inherited from QGraphicsItem | |
using | GraphicsItemFlags = QFlags< GraphicsItemFlag > |
Public Types inherited from QGraphicsItem | |
enum | CacheMode |
enum | GraphicsItemChange |
enum | GraphicsItemFlag |
enum | PanelModality |
Static Public Members inherited from QGraphicsItem | |
static constexpr const int | UserType = 65536 |
Protected Slots inherited from QGraphicsObject | |
void | updateMicroFocus () |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
Related Functions inherited from QGraphicsItem | |
T | qgraphicsitem_cast (QGraphicsItem *item) |
The QGraphicsWidget class is the base class for all widget items in a QGraphicsScene. This class extends QGraphicsItem and provides extra functionality. Unlike QGraphicsItem this class is not an abstract class. Creating an instance of QGraphicsWidget is possible without needing to inherit. Using QGraphicsWidget directly is useful for widgets which only serve the purpose of organizing child widgets into a layout.
Since QGraphicsWidget is similar to the API of QWidget it is easier to port a widget from QWidget to QGraphicsWidget instead of QGraphicsItem. QWidget based widgets can be directly embedded into a QGraphicsScene using QGraphicsProxyWidget. The following is a list of the major differences between QWidget and QGraphicsWidget.
QGraphicsWidget | QWidget |
---|---|
Coordinates and geometry are defined with qreals (doubles or floats, depending on the platform). | QWidget uses integer geometry like QPoint and QRect. |
The widget is already visible by default; you do not have to call show() to display the widget. | QWidget is hidden by default until you call show(). |
A subset of widget attributes are supported. | All widget attributes are supported. |
A top-level item's style defaults to QGraphicsScene::style | A top-level widget's style defaults to QApplication::style |
Graphics View provides a custom drag and drop system which is different from QWidget. | Standard drag and drop. |
Widget items do not support modality. | Full modality support. |
QGraphicsWidget only supports a subset of the attributes supported by QWidget. Any attributes not listed in this table are unsupported or otherwise unused.
Widget Attribute | Usage |
---|---|
Qt::WA_SetLayoutDirection | Set by setLayoutDirection(), cleared by unsetLayoutDirection(). You can test this attribute to check if the widget has been explicitly assigned a layoutDirection. If the attribute is not set, the layoutDirection() is inherited. |
Qt::WA_RightToLeft | Toggled by setLayoutDirection(). Inherited from the parent/scene. If set the widget's layout will order horizontally arranged widgets from right to left. |
Qt::WA_SetStyle | Set and cleared by setStyle(). If this attribute is set the widget has been explicitly assigned a style. If it is unset the widget will use the scene's or the application's style. |
Qt::WA_Resized | Set by setGeometry() and resize(). |
Qt::WA_SetPalette | Set by setPalette(). |
Qt::WA_SetFont | Set by setFont(). |
Qt::WA_WindowPropagation | Enables propagation to window widgets. |
Although QGraphicsWidget inherits from both QObject and QGraphicsItem, use the methods provided by QGraphicsItem and not QObject to manage the relationships between parent and child items. The QObject::parent() should always return a nullptr for QGraphicsWidgets.
QGraphicsWidget::QGraphicsWidget | ( | QGraphicsItem * | parent = nullptr , |
Qt::WindowFlags | flags = Qt::EmptyFlag |
||
) |
Constructs a QGraphicsWidget instance. The parent argument is passed to QGraphicsItem's constructor and the flags argument specifies the widget's window flags. The flags are used to specify if the widget should be a window, a tool, a popup, etc.
QGraphicsWidget::~QGraphicsWidget | ( | ) |
Destroys the QGraphicsWidget instance.
Returns the list of this widget's actions.
void QGraphicsWidget::addAction | ( | QAction * | action | ) |
Appends the givenaction to this widget's list of actions. All QGraphicsWidgets have a list of QActions, 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.
Appends the given actions to this widget's list of actions.
void QGraphicsWidget::adjustSize | ( | ) |
Adjusts the size of the widget to its effective preferred size hint. This method is called implicitly when the item is shown for the first time.
bool QGraphicsWidget::autoFillBackground | ( | ) | const |
Returns the value of the property.
|
override |
Reimplemented from QGraphicsItem::boundingRect()
|
protectedvirtual |
This event handler can be reimplemented to respond to various state changes. The new state can be retrieved using event. The following is a list of the events which will be passed to this method.
Returns a list of child objects. The first child added is the first object in the list and the last child added is the last object in the list. New children are appended at the end.
The list order changes whenever QWidget children are moved in the Z order, causing them to be raised or 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 |
Closes the widget. Returns true if the widget was closed, otherwise returns false. 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.
|
protectedvirtual |
The given event handler event, can be reimplemented in a subclass to receive widget close events. The default implementation accepts the event.
|
overrideprotected |
Handles the given event.
Event | When Delivered |
---|---|
Polish | Delivered to the widget some time after it has been shown. |
GraphicsSceneMove | Delivered to the widget after its local position has changed. |
GraphicsSceneResize | Delivered to the widget after its size has changed. |
Show | Delivered to the widget before it has been shown. |
Hide | Delivered to the widget after it has been hidden. |
PaletteChange | Delivered to the widget after its palette has changed. |
FontChange | Delivered to the widget after its font has changed. |
EnabledChange | Delivered to the widget after its enabled state has changed. |
StyleChange | Delivered to the widget after its style has changed. |
LayoutDirectionChange | Delivered to the widget after its layout direction has changed. |
ContentsRectChange | Delivered to the widget after its contents margins/ contents rect has changed. |
|
overrideprotected |
Reimplemented from QGraphicsItem::focusInEvent()
|
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 method searches forward. If next is false it searches backward.
Sometimes, you will want to reimplement this method 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 method for an object, you gain control of focus traversal for all child widgets.
Reimplemented in QGraphicsWebView::focusNextPrevChild(), QGraphicsProxyWidget::focusNextPrevChild()
|
overrideprotected |
Reimplemented from QGraphicsItem::focusOutEvent()
Qt::FocusPolicy QGraphicsWidget::focusPolicy | ( | ) | const |
Returns the value of the property.
QGraphicsWidget * QGraphicsWidget::focusWidget | ( | ) | const |
If this widget or one of its children currently has input focus, this method will return a pointer to that widget. If no descendant widget has input focus a nullptr is returned.
QFont QGraphicsWidget::font | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is 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 a nullptr.
Reimplemented from QGraphicsLayoutItem::getContentsMargins()
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 a nullptr.
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive notifications for QEvent::GrabKeyboard events.
|
protectedvirtual |
This event handler can be reimplemented in a subclass to receive notifications for QEvent::GrabMouse events.
Reimplemented in QGraphicsProxyWidget::grabMouseEvent()
int QGraphicsWidget::grabShortcut | ( | const QKeySequence & | sequence, |
Qt::ShortcutContext | context = Qt::WindowShortcut |
||
) |
Adds a shortcut to the CopperSpice 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::WidgetShortcut. For widgets that are not part of a window (i.e., top-level widgets and their children), Qt::WidgetShortcut 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.
|
protectedvirtual |
This event handler, for 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::hideEvent()
|
overrideprotected |
Reimplemented from QGraphicsItem::hoverLeaveEvent ()
|
overrideprotected |
Reimplemented from QGraphicsItem::hoverMoveEvent()
|
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.
Style Option Property | Value |
---|---|
state & QStyle::State_Enabled | Corresponds to QGraphicsItem::isEnabled(). |
state & QStyle::State_HasFocus | Corresponds to QGraphicsItem::hasFocus(). |
state & QStyle::State_MouseOver | Corresponds to QGraphicsItem::isUnderMouse(). |
direction | Corresponds to QGraphicsWidget::layoutDirection(). |
rect | Corresponds to QGraphicsWidget::rect().toRect(). |
palette | Corresponds to QGraphicsWidget::palette(). |
fontMetrics | Corresponds to QFontMetrics(QGraphicsWidget::font()). |
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.
Inserts the action to the current widget list of actions prior to the action specified by before. The action is appended if the before parameter is a nullptr or is not a valid action for this widget. A QGraphicsWidget should only have one of each action.
Inserts the actions to the current widget list of actions prior to the action specified by before. The actions are appended if the before parameter is a nullptr or is not a valid action for this widget. A QGraphicsWidget should only have one of each action.
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.
|
overrideprotected |
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. The value for change specifies the type of change and value is the new value.
For example, QGraphicsWidget uses QGraphicsItem::ItemVisibleChange to deliver Show and Hide events, QGraphicsItem::ItemPositionHasChanged to deliver Move events, and QGraphicsItem::ItemParentChange both to deliver ParentChange events and for managing the focus chain. QGraphicsWidget enables the ItemSendsGeometryChanges flag by default in order to track position changes.
QGraphicsLayout * QGraphicsWidget::layout | ( | ) | const |
Returns this widget's layout or a nullptr if no layout is currently managing this widget. Retrieves the value of the layout property.
Qt::LayoutDirection QGraphicsWidget::layoutDirection | ( | ) | const |
Returns the value of the property.
|
protectedvirtual |
This event handler 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. This method can be reimplemented to detect when your widget has moved. Calling QEvent::accept() or QEvent::ignore() on event has no effect.
|
override |
Reimplemented from QGraphicsItem::paint()
|
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 method in a subclass of QGraphicsWidget to provide custom rendering of the widget's window frame.
QPalette QGraphicsWidget::palette | ( | ) | const |
Returns the value of the property.
|
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.
|
inline |
void QGraphicsWidget::releaseShortcut | ( | int | id | ) |
Removes the shortcut with the given id from the CopperSpice 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).
void QGraphicsWidget::removeAction | ( | QAction * | action | ) |
Removes the action from widget list of actions.
|
inline |
Sets the value of the property to size.
Resizes the current QGraphicsWidget with the given width and height. Equivalent to calling resize(QSizeF(width, height)). This method sets the size property.
|
protectedvirtual |
This event handler, for GraphicsSceneResize events, is delivered after the widget has been resized (i.e., its local size has changed). The 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::resizeEvent()
|
overrideprotected |
The default implementation passes event to QGraphicsWidget::event(). Events for a custom widget can be handled by overriding the event() method or methods like resizeEvent() and showEvent().
void QGraphicsWidget::setAttribute | ( | Qt::WidgetAttribute | attribute, |
bool | on = true |
||
) |
If on is true, this method enables attribute, otherwise attribute is disabled. Refer to the class documentation for QGraphicsWidget for a complete list of which attributes are supported and what they are for.
void QGraphicsWidget::setAutoFillBackground | ( | bool | enabled | ) |
Sets the value of the property to enabled.
Sets the widget's contents margins to left, top, right and bottom.
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 ContentsRectChange event.
void QGraphicsWidget::setFocusPolicy | ( | Qt::FocusPolicy | policy | ) |
Sets the value of the property to policy.
void QGraphicsWidget::setFont | ( | const QFont & | font | ) |
Sets the value of the property to font.
|
inlineoverridevirtual |
Sets the geometry of the QGraphicsLayoutItem to rect, which is in coordinates relative to the parent. If rect is outside of the bounds of minimumSize and maximumSize, it will be adjusted to the closest size which is within the legal bounds.
Reimplement this method in a subclass of QGraphicsLayoutItem to receive geometry updates. The layout will call this method when it does a rearrangement.
Reimplemented from QGraphicsLayoutItem::setGeometry()
Reimplemented in QGraphicsWebView::setGeometry()
|
inlinevirtual |
Sets the geometry of the QGraphicsLayoutItem to rect, which is in coordinates relative to the parent. If rect is outside of the bounds of minimumSize and maximumSize, it will be adjusted to the closest size which is within the legal bounds.
Reimplement this method in a subclass of QGraphicsLayoutItem to receive geometry updates. The layout will call this method when it does a rearrangement.
Reimplemented from QGraphicsLayoutItem::setGeometry()
Reimplemented in QGraphicsWebView::setGeometry()
Equivalent to calling setGeometry(QRectF(x, y, width, height)). This method sets the geometry property.
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.
void QGraphicsWidget::setLayoutDirection | ( | Qt::LayoutDirection | direction | ) |
Sets the value of the property to direction.
void QGraphicsWidget::setPalette | ( | const QPalette & | palette | ) |
Sets the value of the property to palette.
void QGraphicsWidget::setShortcutAutoRepeat | ( | int | id, |
bool | enabled = true |
||
) |
If enabled is true the shortcut with the given id will have auto repeat enabled, otherwise it is disabled.
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.
void QGraphicsWidget::setStyle | ( | QStyle * | style | ) |
Sets the widget's style to style. QGraphicsWidget does not take ownership of style. If no style is assigned or style is a nullptr the widget will use QGraphicsScene::style() if this has been set. Otherwise the widget will use QApplication::style().
This method sets the Qt::WA_SetStyle attribute if style is not a nullptr, otherwise it clears the attribute.
|
static |
Adjusts the tab order so the focus of the second widget occurs immediately after the first widget. The following code shows how to set the tab order to a, b, c, d.
This code fragment will set a tab order however it does not produce the same result.
If first is a nullptr this indicates the second widget should have initial focus when the window gains focus. If second is a nullptr this indicates the first widget should be placed at the end of the focus sequence.
By default tab order is defined implicitly using widget creation order.
void QGraphicsWidget::setWindowFlags | ( | Qt::WindowFlags | flags | ) |
Sets the value of the property to flags.
Sets the widget's window frame margins to left, top, right and bottom. The default frame margins are provided by the style, and they depend on the current window flags. If you would like to draw your own window decoration, you can set your own frame margins to override the default margins.
void QGraphicsWidget::setWindowTitle | ( | const QString & | title | ) |
Sets the value of the property to title.
|
override |
Reimplemented from QGraphicsItem::shape()
|
protectedvirtual |
This event handler, for 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::showEvent()
QSizeF QGraphicsWidget::size | ( | ) | const |
Returns the value of the property.
|
overrideprotectedvirtual |
Implements QGraphicsLayoutItem::sizeHint()
Reimplemented in QGraphicsWebView::sizeHint()
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().
bool QGraphicsWidget::testAttribute | ( | Qt::WidgetAttribute | attribute | ) | const |
Returns true if attribute is enabled for this widget, otherwise returns false.
|
override |
Reimplemented from QGraphicsItem::type()
|
protectedvirtual |
This method can be reimplemented in a subclass to receive notifications for event.
|
protectedvirtual |
This method can be reimplemented in a subclass to receive notifications for event.
Reimplemented in QGraphicsProxyWidget::ungrabMouseEvent()
void QGraphicsWidget::unsetLayoutDirection | ( | ) |
Removes the value of the layoutDirection property.
void QGraphicsWidget::unsetWindowFrameMargins | ( | ) |
Resets the window frame margins to the default value, provided by the style.
|
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 method if the widget's sizeHint() has changed.
Reimplemented from QGraphicsLayoutItem::updateGeometry()
Reimplemented in QGraphicsWebView::updateGeometry()
Qt::WindowFlags QGraphicsWidget::windowFlags | ( | ) | const |
Returns the value of the property.
|
protectedvirtual |
This method receives an event for the window frame. The base class implementation provides support for default window frame actions like moving, resizing, etc. Returns true if event has been recognized and processed, otherwise returns false.
You can reimplement this method to provide custom window frame interaction support.
QRectF QGraphicsWidget::windowFrameGeometry | ( | ) | const |
Returns the widget's geometry in parent coordinates including any window frame.
QRectF QGraphicsWidget::windowFrameRect | ( | ) | const |
Returns the widget's local rect including any window frame.
|
protectedvirtual |
Returns the window frame section at position pos, or Qt::NoSection if there is no window frame section at this position.
This method 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.
QString QGraphicsWidget::windowTitle | ( | ) | const |
Returns the value of the property.
Qt::WindowType QGraphicsWidget::windowType | ( | ) | const |
Returns the widgets window type.
|
This property holds whether the widget background is filled automatically. If enabled, this property will cause CopperSpice 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 palette. Windows are always filled with QPalette::Window unless the Qt::WA_OpaquePaintEvent or Qt::WA_NoSystemBackground attributes are set.
By default, this property is false.
Properties | Class Methods |
---|---|
read | autoFillBackground |
write | setAutoFillBackground |
|
This property holds 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 QGraphicsItem::ItemIsFocusable flag. Setting Qt::NoFocus on a widget will clear the QGraphicsItem::ItemIsFocusable flag. If the widget currently has keyboard focus, the widget will automatically lose focus.
Properties | Class Methods |
---|---|
read | focusPolicy |
write | setFocusPolicy |
|
This property holds the font for the widget.
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 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.
Properties | Class Methods |
---|---|
read | font |
write | setFont |
|
This property holds the geometry of the widget.
Calling setGeometry() sets the item's geometry to the given rectangle. The item's position and size are modified as a result of calling this method. The item is first moved then resized. A side effect of calling this method is that the widget will receive a move event and a resize event. If the widget has a layout assigned the layout will activate.
Properties | Class Methods |
---|---|
read | geometry |
write | setGeometry |
notify | geometryChanged |
|
This property holds the layout of the widget.
Any existing layout manager is deleted before the new layout is assigned. If layout is a 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 a nullptr.
Properties | Class Methods |
---|---|
read | layout |
write | setLayout |
notify | layoutChanged |
|
This property holds 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 LayoutDirectionChange event, and then propagate the new layout direction to all its descendants.
Properties | Class Methods |
---|---|
read | layoutDirection |
write | setLayoutDirection |
reset | unsetLayoutDirection |
|
This property holds the maximum size of the widget.
Properties | Class Methods |
---|---|
read | maximumSize |
write | setMaximumSize |
|
This property holds the minimum size of the widget.
Properties | Class Methods |
---|---|
read | minimumSize |
write | setMinimumSize |
|
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 does not have a parent widget, it resolves against the scene. It then sends itself a 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.
Properties | Class Methods |
---|---|
read | palette |
write | setPalette |
|
This property holds the preferred size of the widget.
Properties | Class Methods |
---|---|
read | preferredSize |
write | setPreferredSize |
|
This property holds 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 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 widget'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.
Properties | Class Methods |
---|---|
read | size |
write | resize |
notify | geometryChanged |
|
This property holds the size policy for the widget.
Properties | Class Methods |
---|---|
read | sizePolicy |
write | setSizePolicy |
|
This property holds 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.
Properties | Class Methods |
---|---|
read | windowFlags |
write | setWindowFlags |
|
This property holds 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.
Properties | Class Methods |
---|---|
read | windowTitle |
write | setWindowTitle |