QskQuickItem shortened to QskItem

This commit is contained in:
Uwe Rathmann 2024-02-02 14:13:33 +01:00
parent 4fddc4db24
commit 4862b2b467
25 changed files with 272 additions and 272 deletions

View File

@ -8,7 +8,7 @@
what is needed to support a layout system, that is on par with what what is needed to support a layout system, that is on par with what
is known from Qt/Widgets. is known from Qt/Widgets.
\todo Explain: QskQuickItem::geometry(), QskQuickItem::rect(), \todo Explain: QskItem::geometry(), QskItem::rect(),
QQuickItem::boundingRect(), layoutRect(), contentsRect(), QQuickItem::boundingRect(), layoutRect(), contentsRect(),
subControlRect(), focusIndicatorRect(), QQuickItem::clipRect(), subControlRect(), focusIndicatorRect(), QQuickItem::clipRect(),
QQuickItem::contains() QQuickItem::contains()
@ -22,7 +22,7 @@
A state bit that is set, when QQuickItem::isEnabled() == false. A state bit that is set, when QQuickItem::isEnabled() == false.
\extends QskAspect::State \extends QskAspect::State
\sa QskQuickItem::setDisabled() \sa QskItem::setDisabled()
\saqt QQuickItem::enabled \saqt QQuickItem::enabled
\var QskControl::Hovered \var QskControl::Hovered
@ -71,7 +71,7 @@
\accessors autoLayoutChildren(), setAutoLayoutChildren() \accessors autoLayoutChildren(), setAutoLayoutChildren()
\sa layoutRect(), layoutHints(), layoutAlignmentHint(), \sa layoutRect(), layoutHints(), layoutAlignmentHint(),
QskQuickItem::transparentForPositioners QskItem::transparentForPositioners
\saqt QQuickItem::updatePolish() \saqt QQuickItem::updatePolish()
\note Auto layouting is similar to what happens when putting several items \note Auto layouting is similar to what happens when putting several items
@ -274,7 +274,7 @@
\aspect QskControl::Background | QskAspect::Color \aspect QskControl::Background | QskAspect::Color
\sa setBackground() \sa setBackground()
\sa QskQuickItem::DebugForceBackground \sa QskItem::DebugForceBackground
*/ */
/*! /*!
@ -554,7 +554,7 @@
A control has an impact on the layout calutaions, when: A control has an impact on the layout calutaions, when:
- isTransparentForPositioner() is false - isTransparentForPositioner() is false
- QskQuickItem::isVisibleToParent() is true, or RetainSizeWhenHidden is set - QskItem::isVisibleToParent() is true, or RetainSizeWhenHidden is set
\sa isVisibleToParent(), RetainSizeWhenHidden \sa isVisibleToParent(), RetainSizeWhenHidden
*/ */

View File

@ -1,25 +1,25 @@
/*! /*!
\class QskQuickItem QskQuickItem.h \class QskItem QskItem.h
\ingroup Framework \ingroup Framework
QskQuickItem completes the C++ API of QQuickItem and re-establishs basic QskItem completes the C++ API of QQuickItem and re-establishs basic
concepts like events. It also offers better control over the operations concepts like events. It also offers better control over the operations
happening in the update cycle. happening in the update cycle.
*/ */
/*! /*!
\enum QskQuickItem::UpdateFlag \enum QskItem::UpdateFlag
Qt/Quick classes have a tendency to update items too early Qt/Quick classes have a tendency to update items too early
and too often. To avoid processing of unwanted operations and too often. To avoid processing of unwanted operations
QskQuickItem implements a couple of modifications, that QskItem implements a couple of modifications, that
can be en/disabled individually. can be en/disabled individually.
\sa updateFlags(), resetUpdateFlags() \sa updateFlags(), resetUpdateFlags()
testUpdateFlag(), setUpdateFlag(), resetUpdateFlag() testUpdateFlag(), setUpdateFlag(), resetUpdateFlag()
\var QskQuickItem::UpdateFlag QskQuickItem::DeferredUpdate \var QskItem::UpdateFlag QskItem::DeferredUpdate
Creating of scene graph nodes is blocked when being invisible. Creating of scene graph nodes is blocked when being invisible.
@ -37,7 +37,7 @@
such as viewport frustrum culling (i.e. hiding items outside of the such as viewport frustrum culling (i.e. hiding items outside of the
window geometry). window geometry).
\var QskQuickItem::UpdateFlag QskQuickItem::DeferredPolish \var QskItem::UpdateFlag QskItem::DeferredPolish
Polishing an item is blocked when being invisible. Polishing an item is blocked when being invisible.
F.e for all items being derived from QskControl the layout calculations F.e for all items being derived from QskControl the layout calculations
@ -45,7 +45,7 @@
\saqt QQuickItem::updatePolish(), QQuickItem::polish() \saqt QQuickItem::updatePolish(), QQuickItem::polish()
\var QskQuickItem::UpdateFlag QskQuickItem::DeferredLayout \var QskItem::UpdateFlag QskItem::DeferredLayout
Recalculations of the implicitSize are blocked until being explicitly requested. Recalculations of the implicitSize are blocked until being explicitly requested.
@ -54,15 +54,15 @@
without recalculating the actual size hints ( f.e the implicitSize ). without recalculating the actual size hints ( f.e the implicitSize ).
When having layout code that relies on binding the implicit width/height When having layout code that relies on binding the implicit width/height
the QskQuickItem::DeferredLayout flag needs to be disabled. the QskItem::DeferredLayout flag needs to be disabled.
\note All layout classes offered by the Qt/Quick modules of the Qt Company \note All layout classes offered by the Qt/Quick modules of the Qt Company
( f.e anchors ) do require immediate updates of the implicit size. ( f.e anchors ) do require immediate updates of the implicit size.
\sa QskQuickItem::resetImplicitSize() \sa QskItem::resetImplicitSize()
\saqt QQuickItem::implicitSize() \saqt QQuickItem::implicitSize()
\var QskQuickItem::UpdateFlag QskQuickItem::CleanupOnVisibility \var QskItem::UpdateFlag QskItem::CleanupOnVisibility
Delete scene graph nodes, when the item becomes hidden. Delete scene graph nodes, when the item becomes hidden.
Enabling this mode will reduce the memory footprint, but comes at the cost Enabling this mode will reduce the memory footprint, but comes at the cost
@ -70,12 +70,12 @@
\saqt QQuickItem::isVisible() \saqt QQuickItem::isVisible()
\var QskQuickItem::UpdateFlag QskQuickItem::PreferRasterForTextures \var QskItem::UpdateFlag QskItem::PreferRasterForTextures
When creating textures from QskGraphic, prefer the raster paint When creating textures from QskGraphic, prefer the raster paint
engine over the OpenGL paint engine. engine over the OpenGL paint engine.
\var QskQuickItem::UpdateFlag QskQuickItem::DebugForceBackground \var QskItem::UpdateFlag QskItem::DebugForceBackground
Always fill the background of the item with a random color. Always fill the background of the item with a random color.
@ -84,7 +84,7 @@
*/ */
/*! /*!
\property QskQuickItem::geometry \property QskItem::geometry
This property holds the geometry of the item relative to its parent item. This property holds the geometry of the item relative to its parent item.
When changing the geometry, the item receives a QskEvent::GeometryChange event. When changing the geometry, the item receives a QskEvent::GeometryChange event.
@ -93,7 +93,7 @@
*/ */
/*! /*!
\property QskQuickItem::rect \property QskItem::rect
This property returns the internal geometry of the item. This property returns the internal geometry of the item.
It equals QRect(0, 0, width(), height() ). It equals QRect(0, 0, width(), height() ).
@ -102,7 +102,7 @@
*/ */
/*! /*!
\var QskQuickItem::transparentForPositioners \var QskItem::transparentForPositioners
When transparentForPositioners is set the item indicates, that it should be excluded When transparentForPositioners is set the item indicates, that it should be excluded
from any layout calculations. This flag is actually a concept of QQuickItem, that from any layout calculations. This flag is actually a concept of QQuickItem, that
@ -112,7 +112,7 @@
*/ */
/*! /*!
\property QskQuickItem::tabFence \property QskItem::tabFence
The tabFence flag can be used to create local tab focus chains. It is usually The tabFence flag can be used to create local tab focus chains. It is usually
used in combination with QQuickItem::ItemIsFocusScope. used in combination with QQuickItem::ItemIsFocusScope.
@ -125,7 +125,7 @@
*/ */
/*! /*!
\property QskQuickItem::visibleToParent \property QskItem::visibleToParent
Flag indicating if an item would become visible if its parentItem() is shown. Flag indicating if an item would become visible if its parentItem() is shown.
The implementation relies on the internal explicitVisible flag, that has not The implementation relies on the internal explicitVisible flag, that has not
@ -142,7 +142,7 @@
*/ */
/*! /*!
\property QskQuickItem::polishOnResize \property QskItem::polishOnResize
When polishOnResize is set QQuickItem::polish() will be called automatically When polishOnResize is set QQuickItem::polish() will be called automatically
whenever the size of the item has been changed. This is usually necessary whenever the size of the item has been changed. This is usually necessary
@ -153,7 +153,7 @@
*/ */
/*! /*!
\property QskQuickItem::initiallyPainted \property QskItem::initiallyPainted
Status flag indicating that there has already been a call Status flag indicating that there has already been a call
of QQuickItem::updatePaintNode() since the item has become visible. of QQuickItem::updatePaintNode() since the item has become visible.
@ -165,7 +165,7 @@
*/ */
/*! /*!
\property QskQuickItem::hasChildItems \property QskItem::hasChildItems
A property indicating if the item has child items. A property indicating if the item has child items.
@ -173,40 +173,40 @@
*/ */
/*! /*!
\property QskQuickItem::updateFlags \property QskItem::updateFlags
QskQuickItem offers several tweaks to the Qt/Quick update cycle, QskItem offers several tweaks to the Qt/Quick update cycle,
that can be en/disabled individually. that can be en/disabled individually.
The flags are a combination from bits that have been explicitly set The flags are a combination from bits that have been explicitly set
by setUpdateFlag() and those being derived from the aapplication by setUpdateFlag() and those being derived from the aapplication
wide default settings, that can be set with QskSetup. wide default settings, that can be set with QskSetup.
\sa QskQuickItem::UpdateFlag, QskQuickItem::updateFlags(), QskSetup::itemUpdateFlags() \sa QskItem::UpdateFlag, QskItem::updateFlags(), QskSetup::itemUpdateFlags()
*/ */
/*! /*!
\fn QskQuickItem::QskQuickItem \fn QskItem::QskItem
Sets the QQuickItem::ItemHasContents flag to true. Sets the QQuickItem::ItemHasContents flag to true.
*/ */
*! *!
\fn QskQuickItem::~QskQuickItem \fn QskItem::~QskItem
Sets the componentComplete to false, so that its about-to-delete state is known Sets the componentComplete to false, so that its about-to-delete state is known
when detaching it from parent/window. when detaching it from parent/window.
*/ */
/*! /*!
\fn QskQuickItem::className \fn QskItem::className
A convenience wrapper for metaObject()->className() A convenience wrapper for metaObject()->className()
\return Class name \return Class name
*/ */
/*! /*!
\fn QskQuickItem::isVisibleTo \fn QskItem::isVisibleTo
The true case occurs if neither the item itself nor any parent up to but excluding The true case occurs if neither the item itself nor any parent up to but excluding
ancestor has been explicitly hidden. ancestor has been explicitly hidden.
@ -218,7 +218,7 @@
*/ */
/*! /*!
\fn QskQuickItem::isVisibleToParent \fn QskItem::isVisibleToParent
An item might be invisible because it has been explicitly hidden or An item might be invisible because it has been explicitly hidden or
one of its ancestors has been hidden. isVisibleToParent() indicates one of its ancestors has been hidden. isVisibleToParent() indicates
@ -231,14 +231,14 @@
*/ */
/*! /*!
\fn QskQuickItem::hasChildItems() const \fn QskItem::hasChildItems() const
\return true, if the item has child items \return true, if the item has child items
\sa hasChildItems \sa hasChildItems
*/ */
/*! /*!
\fn QskQuickItem::setGeometry( qreal, qreal, qreal, qreal ) \fn QskItem::setGeometry( qreal, qreal, qreal, qreal )
Set the position and the size of an item Set the position and the size of an item
@ -252,7 +252,7 @@
*/ */
/*! /*!
\fn QskQuickItem::setGeometry( const QPointF &, const QSizeF & ) \fn QskItem::setGeometry( const QPointF &, const QSizeF & )
Set the position and the size of an item Set the position and the size of an item
@ -261,7 +261,7 @@
*/ */
/*! /*!
\fn QskQuickItem::setGeometry( const QRectF& ) \fn QskItem::setGeometry( const QRectF& )
Set the position and the size of an item Set the position and the size of an item
@ -272,14 +272,14 @@
*/ */
/*! /*!
\fn QskQuickItem::geometry() const \fn QskItem::geometry() const
\return Position and size relative to the parent item \return Position and size relative to the parent item
\sa geometry, setGeometry() \sa geometry, setGeometry()
*/ */
/*! /*!
\fn QskQuickItem::geometryChange \fn QskItem::geometryChange
This overloaded notifier calls QQuickItem::polish() depending on the This overloaded notifier calls QQuickItem::polish() depending on the
polishOnResize() flag and forwards the notification to the event queue. polishOnResize() flag and forwards the notification to the event queue.
@ -288,14 +288,14 @@
*/ */
/*! /*!
\fn QskQuickItem::rect() const \fn QskItem::rect() const
\return Internal geometry of the item, where the position is always at ( 0, 0 ) \return Internal geometry of the item, where the position is always at ( 0, 0 )
\sa geometry \sa geometry
*/ */
/*! /*!
\fn QskQuickItem::implicitSize \fn QskItem::implicitSize
Qt/Quick offers an oversimplified layout system that is based on the Qt/Quick offers an oversimplified layout system that is based on the
property bindings of implicit width and height. QSkinny restablishs a layout property bindings of implicit width and height. QSkinny restablishs a layout
@ -308,56 +308,56 @@
\return Implicit size, \return Implicit size,
\note Layout code that relies on property bindings of the implicit width a height \note Layout code that relies on property bindings of the implicit width a height
needs to disable the QskQuickItem::DeferredLayout flag needs to disable the QskItem::DeferredLayout flag
\sa QskControl::preferredSize(), QskControl::sizeHint() \sa QskControl::preferredSize(), QskControl::sizeHint()
\saqt QQuickItem::implicitWidth(), QQuickItem::implicitHeight() \saqt QQuickItem::implicitWidth(), QQuickItem::implicitHeight()
*/ */
/*! /*!
\fn QskQuickItem::setPolishOnResize \fn QskItem::setPolishOnResize
Set or clear the polishOnResize flag. Set or clear the polishOnResize flag.
\sa polishOnResize \sa polishOnResize
*/ */
/*! /*!
\fn QskQuickItem::polishOnResize() const \fn QskItem::polishOnResize() const
\return Value of the polishOnResize flag \return Value of the polishOnResize flag
\sa setPolishOnResize() \sa setPolishOnResize()
*/ */
/*! /*!
\fn QskQuickItem::setTransparentForPositioner \fn QskItem::setTransparentForPositioner
Set or clear the transparentForPositioner flag Set or clear the transparentForPositioner flag
\sa isTransparentForPositioner() \sa isTransparentForPositioner()
*/ */
/*! /*!
\fn QskQuickItem::isTransparentForPositioner \fn QskItem::isTransparentForPositioner
\return Value of the transparentForPositioner flag \return Value of the transparentForPositioner flag
\sa transparentForPositioner \sa transparentForPositioner
*/ */
/*! /*!
\fn QskQuickItem::setTabFence \fn QskItem::setTabFence
Set or clear the tabFence property Set or clear the tabFence property
\sa isTabFence() \sa isTabFence()
*/ */
/*! /*!
\fn QskQuickItem::isTabFence \fn QskItem::isTabFence
\return Value of the tabFence property \return Value of the tabFence property
\sa setTransparentForPositioner() \sa setTransparentForPositioner()
*/ */
/*! /*!
\fn QskQuickItem::setLayoutMirroring \fn QskItem::setLayoutMirroring
Change the direction how the content is laid out horizontally. Change the direction how the content is laid out horizontally.
@ -373,7 +373,7 @@
*/ */
/*! /*!
\fn QskQuickItem::resetLayoutMirroring \fn QskItem::resetLayoutMirroring
Clear the layoutMirroring property Clear the layoutMirroring property
@ -381,7 +381,7 @@
*/ */
/*! /*!
\fn QskQuickItem::layoutMirroring() const \fn QskItem::layoutMirroring() const
Direction how the content is layed out horizontally. Direction how the content is layed out horizontally.
@ -402,7 +402,7 @@
*/ */
/*! /*!
\fn QskQuickItem::resetUpdateFlags \fn QskItem::resetUpdateFlags
Reset all flags to the default settings Reset all flags to the default settings
@ -410,16 +410,16 @@
*/ */
/*! /*!
\fn QskQuickItem::updateFlags() const \fn QskItem::updateFlags() const
\return Flags affecting the item update process \return Flags affecting the item update process
\sa testUpdateFlag(), setUpdateFlag(), updateFlags \sa testUpdateFlag(), setUpdateFlag(), updateFlags
*/ */
/*! /*!
\fn QskQuickItem::setUpdateFlag \fn QskItem::setUpdateFlag
QskQuickItem offers several tweaks to the Qt/Quick update cycle, QskItem offers several tweaks to the Qt/Quick update cycle,
that can be en/disables individually. that can be en/disables individually.
The default settings for these flags are taken from QskSetup::itemUpdateFlags() The default settings for these flags are taken from QskSetup::itemUpdateFlags()
@ -434,7 +434,7 @@
*/ */
/*! /*!
\fn QskQuickItem::resetUpdateFlag \fn QskItem::resetUpdateFlag
Reset the value for flag to the default settings from QskSetup. Future Reset the value for flag to the default settings from QskSetup. Future
changes of the corresponding bit with QskSetup::setItemUpdateFlag() will affect changes of the corresponding bit with QskSetup::setItemUpdateFlag() will affect
@ -445,7 +445,7 @@
*/ */
/*! /*!
\fn QskQuickItem::testUpdateFlag \fn QskItem::testUpdateFlag
\param Flag affecting the item update process \param Flag affecting the item update process
\return true, when the corresponding bit is effective \return true, when the corresponding bit is effective
@ -454,7 +454,7 @@
*/ */
/*! /*!
\fn QskQuickItem::updateFlagsChanged \fn QskItem::updateFlagsChanged
Signal indicating, that the effective update flags have changed Signal indicating, that the effective update flags have changed
@ -463,7 +463,7 @@
*/ */
/*! /*!
\fn QskQuickItem::classBegin \fn QskItem::classBegin
The QML engine initializes an item as being incomplete by The QML engine initializes an item as being incomplete by
explicitly calling classBegin(). Once the item explicitly calling classBegin(). Once the item
@ -481,7 +481,7 @@
*/ */
/*! /*!
\fn QskQuickItem::componentComplete \fn QskItem::componentComplete
The QML engine initilizes an item as being incomplete by The QML engine initilizes an item as being incomplete by
explicitly calling QQuickItem::classBegin(). Once the item explicitly calling QQuickItem::classBegin(). Once the item
@ -499,7 +499,7 @@
*/ */
/*! /*!
\fn QskQuickItem::releaseResources \fn QskItem::releaseResources
This specific hook is called, when the item is about to be removed This specific hook is called, when the item is about to be removed
from the window it was previously rendering to. from the window it was previously rendering to.
@ -510,7 +510,7 @@
*/ */
/*! /*!
\fn QskQuickItem::isPolishScheduled \fn QskItem::isPolishScheduled
\return True, if the item will be polished in the next \return True, if the item will be polished in the next
scene graph update cycle. scene graph update cycle.
@ -519,21 +519,21 @@
*/ */
/*! /*!
\fn QskQuickItem::isUpdateNodeScheduled \fn QskItem::isUpdateNodeScheduled
\return True, if the item will update the paint node in \return True, if the item will update the paint node in
the next scene graph update cycle the next scene graph update cycle
*/ */
/*! /*!
\fn QskQuickItem::isInitiallyPainted \fn QskItem::isInitiallyPainted
\return Value of the initiallyPainted property \return Value of the initiallyPainted property
\sa initiallyPainted \sa initiallyPainted
*/ */
/*! /*!
\fn QskQuickItem::maybeUnresized \fn QskItem::maybeUnresized
Flag indicating a potential state, where the item is waiting to be Flag indicating a potential state, where the item is waiting to be
sized by the layout system. sized by the layout system.
@ -547,7 +547,7 @@
*/ */
/*! /*!
\fn QskQuickItem::itemFlagsChanged \fn QskItem::itemFlagsChanged
Signal indicating that at least one if the following attributes has changed: Signal indicating that at least one if the following attributes has changed:
@ -557,7 +557,7 @@
*/ */
/*! /*!
\fn QskQuickItem::show \fn QskItem::show
An alternative way to call setVisible( true ). An alternative way to call setVisible( true ).
Useful for signal/slot connections Useful for signal/slot connections
@ -567,7 +567,7 @@
*/ */
/*! /*!
\fn QskQuickItem::hide \fn QskItem::hide
An alternative way to call setVisible( false ). An alternative way to call setVisible( false ).
Useful for signal/slot connections Useful for signal/slot connections
@ -577,7 +577,7 @@
*/ */
/*! /*!
\fn QskQuickItem::setHidden \fn QskItem::setHidden
Convenience function, equivalent to setVisible( !on ). Convenience function, equivalent to setVisible( !on ).
@ -586,19 +586,19 @@
*/ */
/*! /*!
\fn QskQuickItem::setDisabled \fn QskItem::setDisabled
Convenience function, equivalent to setEnabled( !on ). Convenience function, equivalent to setEnabled( !on ).
\saqt QQuickItem::setEnabled() \saqt QQuickItem::setEnabled()
*/ */
/*! /*!
\fn QskQuickItem::resetImplicitSize \fn QskItem::resetImplicitSize
Notifies the layout system that attributes affecting the layout Notifies the layout system that attributes affecting the layout
system have changed. system have changed.
If the QskQuickItem::DeferredLayout flag is enabled ( = default ) If the QskItem::DeferredLayout flag is enabled ( = default )
the cached implicitSize() gets invalidated and a QEvent::LayoutRequest is sent the cached implicitSize() gets invalidated and a QEvent::LayoutRequest is sent
to the parent item ( like QWidget::updateGeometry ). to the parent item ( like QWidget::updateGeometry ).
@ -607,13 +607,13 @@
*/ */
/*! /*!
\fn QskQuickItem::event \fn QskItem::event
QskQuickItem handles the additional type of events. QskItem handles the additional type of events.
For some reason the QQuick classes introduced proprietory notfier hooks For some reason the QQuick classes introduced proprietory notfier hooks
instead of using the well established and powerful concept of events. instead of using the well established and powerful concept of events.
QskQuickItem tries to revert this decision by mapping notifications QskItem tries to revert this decision by mapping notifications
to events, when possible. to events, when possible.
The following notification events are added by QSkinny - usually with a The following notification events are added by QSkinny - usually with a
@ -633,7 +633,7 @@
*/ */
/*! /*!
\fn QskQuickItem::changeEvent \fn QskItem::changeEvent
This event handler can be reimplemented to handle certain state changes: This event handler can be reimplemented to handle certain state changes:
@ -649,12 +649,12 @@
*/ */
/*! /*!
\fn QskQuickItem::geometryChangeEvent \fn QskItem::geometryChangeEvent
For no known reason QQuickItem propagates changes of position and size For no known reason QQuickItem propagates changes of position and size
by calling QQuickItem::geometryChange(), instead of using events. by calling QQuickItem::geometryChange(), instead of using events.
QskQuickItem reestablished the more powerful concept of events by sending/posting QskItem reestablished the more powerful concept of events by sending/posting
events, that can be preprocessed by event filtering. events, that can be preprocessed by event filtering.
\param event Event indicating the geometry change \param event Event indicating the geometry change
@ -664,7 +664,7 @@
*/ */
/*! /*!
\fn QskQuickItem::windowChangeEvent \fn QskItem::windowChangeEvent
This event handler can be reimplemented to handle situations, where This event handler can be reimplemented to handle situations, where
an item is added, removed or transferred between windows. It corresponds an item is added, removed or transferred between windows. It corresponds
@ -677,7 +677,7 @@
*/ */
/*! /*!
\fn QskQuickItem::itemChange \fn QskItem::itemChange
For no obvious reason Qt/Quick has introduced an additional callback For no obvious reason Qt/Quick has introduced an additional callback
mechanism beside events and signals. mechanism beside events and signals.
@ -698,7 +698,7 @@
*/ */
/*! /*!
\fn QskQuickItem::aboutToShow \fn QskItem::aboutToShow
A specific hook that is intended to be overloaded by controls that need A specific hook that is intended to be overloaded by controls that need
to do some specific operations, when an item is painted the first time to do some specific operations, when an item is painted the first time
@ -711,7 +711,7 @@
*/ */
/*! /*!
\fn QskQuickItem::mouseUngrabEvent \fn QskItem::mouseUngrabEvent
Notification, that is overloaded for debuging purposes, without Notification, that is overloaded for debuging purposes, without
doing anything beside calling the base class. doing anything beside calling the base class.
@ -720,7 +720,7 @@
*/ */
/*! /*!
\fn QskQuickItem::touchUngrabEvent \fn QskItem::touchUngrabEvent
Notification, that is overloaded for debuging purposes, without Notification, that is overloaded for debuging purposes, without
doing anything beside calling the base class. doing anything beside calling the base class.

View File

@ -53,7 +53,7 @@
The default value The default value
\accessors visiblePolicy(), setVisiblePolicy() \accessors visiblePolicy(), setVisiblePolicy()
\sa hiddenPolicy, QskQuickItem::isVisibleToParent(), qskIsVisibleToParent() \sa hiddenPolicy, QskItem::isVisibleToParent(), qskIsVisibleToParent()
\note QskPlacementPolicy::Ignore is stored in the transparentForPositioner \note QskPlacementPolicy::Ignore is stored in the transparentForPositioner
bit in QQuickItem and might have an impact on Qt/Quick layout code. bit in QQuickItem and might have an impact on Qt/Quick layout code.
@ -78,7 +78,7 @@
Sometimes an item wants to have its proper size even when being hidden. Sometimes an item wants to have its proper size even when being hidden.
\accessors hiddenPolicy(), setHiddenPolicy() \accessors hiddenPolicy(), setHiddenPolicy()
\sa visiblePolicy, QskQuickItem::isVisibleToParent(), qskIsVisibleToParent() \sa visiblePolicy, QskItem::isVisibleToParent(), qskIsVisibleToParent()
\note QskPlacementPolicy::Ignore is stored in the transparentForPositioner \note QskPlacementPolicy::Ignore is stored in the transparentForPositioner
bit in QQuickItem and might have an impact on Qt/Quick layout code. bit in QQuickItem and might have an impact on Qt/Quick layout code.

View File

@ -178,7 +178,7 @@ void ProgressBarPage::populate()
} }
} }
connect( this, &QskQuickItem::windowChanged, this, [this, determinateIndicators]( QQuickWindow* window ) connect( this, &QskItem::windowChanged, this, [this, determinateIndicators]( QQuickWindow* window )
{ {
if( window ) if( window )
{ {

View File

@ -18,7 +18,7 @@ QSK_SUBCONTROL( StorageBar, Free )
using S = StorageBar; using S = StorageBar;
StorageBar::StorageBar( QskQuickItem* const parent ) StorageBar::StorageBar( QskItem* const parent )
: Inherited( parent ) : Inherited( parent )
{ {
static constexpr qreal size = 16.0; static constexpr qreal size = 16.0;

View File

@ -20,7 +20,7 @@ class StorageBar final : public QskControl
public: public:
QSK_SUBCONTROLS( Pictures, Music, Videos, Documents, Others, Free ) QSK_SUBCONTROLS( Pictures, Music, Videos, Documents, Others, Free )
explicit StorageBar( QskQuickItem* parent = nullptr ); explicit StorageBar( QskItem* parent = nullptr );
qreal pictures() const; qreal pictures() const;
void setPictures( qreal newPictures ); void setPictures( qreal newPictures );

View File

@ -28,7 +28,7 @@ int main( int argc, char* argv[] )
QGuiApplication app( argc, argv ); QGuiApplication app( argc, argv );
qskSetup->setItemUpdateFlag( QskQuickItem::PreferRasterForTextures, true ); qskSetup->setItemUpdateFlag( QskItem::PreferRasterForTextures, true );
qskSkinManager->setSkin( new Skin() ); qskSkinManager->setSkin( new Skin() );
Qsk::addGraphicProvider( QString(), new GraphicProvider() ); Qsk::addGraphicProvider( QString(), new GraphicProvider() );

View File

@ -139,7 +139,7 @@ int main( int argc, char* argv[] )
qskSkinManager->registerFactory( qskSkinManager->registerFactory(
QStringLiteral( "MySkinFactory" ), new MySkinFactory() ); QStringLiteral( "MySkinFactory" ), new MySkinFactory() );
qskSetup->setItemUpdateFlag( QskQuickItem::PreferRasterForTextures, true ); qskSetup->setItemUpdateFlag( QskItem::PreferRasterForTextures, true );
Window window; Window window;
window.resize( 480, 360 ); window.resize( 480, 360 );

View File

@ -138,7 +138,7 @@ class IconGrid : public QskLinearBox
When having too many nodes, the scene graph becomes horribly slow. When having too many nodes, the scene graph becomes horribly slow.
So we explicitely hide all items outside the visible area So we explicitely hide all items outside the visible area
( see updateVisibilities below ) and make use of the DeferredUpdate and ( see updateVisibilities below ) and make use of the DeferredUpdate and
CleanupOnVisibility features of QskQuickItem. CleanupOnVisibility features of QskItem.
*/ */
setSize( sizeConstraint() ); setSize( sizeConstraint() );
updateLayout(); // so that every item has its initial geometry updateLayout(); // so that every item has its initial geometry

View File

@ -243,8 +243,8 @@ void QskQml::registerTypes()
QSK_VERSION_MAJOR, QSK_VERSION_MINOR, "Skin", QString() ); QSK_VERSION_MAJOR, QSK_VERSION_MINOR, "Skin", QString() );
#endif #endif
QSK_REGISTER_FLAGS( QskQuickItem::UpdateFlag ); QSK_REGISTER_FLAGS( QskItem::UpdateFlag );
QSK_REGISTER_FLAGS( QskQuickItem::UpdateFlags ); QSK_REGISTER_FLAGS( QskItem::UpdateFlags );
QSK_REGISTER_FLAGS( QskSizePolicy::Policy ); QSK_REGISTER_FLAGS( QskSizePolicy::Policy );
QSK_REGISTER_FLAGS( QskDialog::Actions ); QSK_REGISTER_FLAGS( QskDialog::Actions );

View File

@ -219,6 +219,7 @@ list(APPEND HEADERS
controls/QskGraphicLabel.h controls/QskGraphicLabel.h
controls/QskGraphicLabelSkinlet.h controls/QskGraphicLabelSkinlet.h
controls/QskHintAnimator.h controls/QskHintAnimator.h
controls/QskItem.h
controls/QskInputGrabber.h controls/QskInputGrabber.h
controls/QskListView.h controls/QskListView.h
controls/QskListViewSkinlet.h controls/QskListViewSkinlet.h
@ -239,7 +240,6 @@ list(APPEND HEADERS
controls/QskPushButton.h controls/QskPushButton.h
controls/QskPushButtonSkinlet.h controls/QskPushButtonSkinlet.h
controls/QskQuick.h controls/QskQuick.h
controls/QskQuickItem.h
controls/QskRadioBox.h controls/QskRadioBox.h
controls/QskRadioBoxSkinlet.h controls/QskRadioBoxSkinlet.h
controls/QskScrollArea.h controls/QskScrollArea.h
@ -291,7 +291,7 @@ list(APPEND HEADERS
list(APPEND PRIVATE_HEADERS list(APPEND PRIVATE_HEADERS
controls/QskDirtyItemFilter.h controls/QskDirtyItemFilter.h
controls/QskControlPrivate.h controls/QskControlPrivate.h
controls/QskQuickItemPrivate.h controls/QskItemPrivate.h
) )
list(APPEND SOURCES list(APPEND SOURCES
@ -324,6 +324,8 @@ list(APPEND SOURCES
controls/QskGraphicLabelSkinlet.cpp controls/QskGraphicLabelSkinlet.cpp
controls/QskHintAnimator.cpp controls/QskHintAnimator.cpp
controls/QskInputGrabber.cpp controls/QskInputGrabber.cpp
controls/QskItem.cpp
controls/QskItemPrivate.cpp
controls/QskListView.cpp controls/QskListView.cpp
controls/QskListViewSkinlet.cpp controls/QskListViewSkinlet.cpp
controls/QskMenuSkinlet.cpp controls/QskMenuSkinlet.cpp
@ -343,8 +345,6 @@ list(APPEND SOURCES
controls/QskPushButton.cpp controls/QskPushButton.cpp
controls/QskPushButtonSkinlet.cpp controls/QskPushButtonSkinlet.cpp
controls/QskQuick.cpp controls/QskQuick.cpp
controls/QskQuickItem.cpp
controls/QskQuickItemPrivate.cpp
controls/QskScrollArea.cpp controls/QskScrollArea.cpp
controls/QskScrollBox.cpp controls/QskScrollBox.cpp
controls/QskScrollView.cpp controls/QskScrollView.cpp

View File

@ -47,7 +47,7 @@ static inline bool qskMaybeGesture( QQuickItem* item,
} }
QskControl::QskControl( QQuickItem* parent ) QskControl::QskControl( QQuickItem* parent )
: QskQuickItem( *( new QskControlPrivate() ), parent ) : QskItem( *( new QskControlPrivate() ), parent )
{ {
if ( parent ) if ( parent )
{ {

View File

@ -6,7 +6,7 @@
#ifndef QSK_CONTROL_H #ifndef QSK_CONTROL_H
#define QSK_CONTROL_H #define QSK_CONTROL_H
#include "QskQuickItem.h" #include "QskItem.h"
#include "QskSkinnable.h" #include "QskSkinnable.h"
#include "QskAspect.h" #include "QskAspect.h"
#include "QskGradient.h" #include "QskGradient.h"
@ -19,7 +19,7 @@
class QskControlPrivate; class QskControlPrivate;
class QskGestureEvent; class QskGestureEvent;
class QSK_EXPORT QskControl : public QskQuickItem, public QskSkinnable class QSK_EXPORT QskControl : public QskItem, public QskSkinnable
{ {
Q_OBJECT Q_OBJECT
@ -49,7 +49,7 @@ class QSK_EXPORT QskControl : public QskQuickItem, public QskSkinnable
Q_PROPERTY( QSizeF preferredSize READ preferredSize WRITE setPreferredSize ) Q_PROPERTY( QSizeF preferredSize READ preferredSize WRITE setPreferredSize )
Q_PROPERTY( QSizeF sizeConstraint READ sizeConstraint ) Q_PROPERTY( QSizeF sizeConstraint READ sizeConstraint )
using Inherited = QskQuickItem; using Inherited = QskItem;
public: public:
QSK_SUBCONTROLS( Background ) QSK_SUBCONTROLS( Background )

View File

@ -8,11 +8,11 @@
#include "QskGlobal.h" #include "QskGlobal.h"
#include "QskControl.h" #include "QskControl.h"
#include "QskQuickItemPrivate.h" #include "QskItemPrivate.h"
class QskControlPrivate : public QskQuickItemPrivate class QskControlPrivate : public QskItemPrivate
{ {
using Inherited = QskQuickItemPrivate; using Inherited = QskItemPrivate;
public: public:
static bool inheritLocale( QskControl*, const QLocale& ); static bool inheritLocale( QskControl*, const QLocale& );

View File

@ -4,7 +4,7 @@
*****************************************************************************/ *****************************************************************************/
#include "QskDirtyItemFilter.h" #include "QskDirtyItemFilter.h"
#include "QskQuickItem.h" #include "QskItem.h"
QSK_QT_PRIVATE_BEGIN QSK_QT_PRIVATE_BEGIN
#include <private/qquickitem_p.h> #include <private/qquickitem_p.h>
@ -15,8 +15,8 @@ static inline bool qskIsUpdateBlocked( const QQuickItem* item )
{ {
if ( !item->isVisible() ) if ( !item->isVisible() )
{ {
if ( auto qskItem = qobject_cast< const QskQuickItem* >( item ) ) if ( auto qskItem = qobject_cast< const QskItem* >( item ) )
return qskItem->testUpdateFlag( QskQuickItem::DeferredUpdate ); return qskItem->testUpdateFlag( QskItem::DeferredUpdate );
} }
#if 0 #if 0

View File

@ -3,8 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#include "QskQuickItem.h" #include "QskItem.h"
#include "QskQuickItemPrivate.h" #include "QskItemPrivate.h"
#include "QskQuick.h" #include "QskQuick.h"
#include "QskEvent.h" #include "QskEvent.h"
#include "QskSetup.h" #include "QskSetup.h"
@ -44,9 +44,9 @@ static inline void qskSendEventTo( QObject* object, QEvent::Type type )
} }
static inline void qskApplyUpdateFlags( static inline void qskApplyUpdateFlags(
QskQuickItem::UpdateFlags flags, QskQuickItem* item ) QskItem::UpdateFlags flags, QskItem* item )
{ {
auto d = static_cast< QskQuickItemPrivate* >( QskQuickItemPrivate::get( item ) ); auto d = static_cast< QskItemPrivate* >( QskItemPrivate::get( item ) );
d->applyUpdateFlags( flags ); d->applyUpdateFlags( flags );
} }
@ -61,10 +61,10 @@ static inline void qskFilterWindow( QQuickWindow* window )
namespace namespace
{ {
class QskQuickItemRegistry class QskItemRegistry
{ {
public: public:
QskQuickItemRegistry() QskItemRegistry()
{ {
/* /*
Its faster and saves some memory to have this registry instead Its faster and saves some memory to have this registry instead
@ -84,12 +84,12 @@ namespace
qskSkinManager, [ this ] { updateSkin(); } ); qskSkinManager, [ this ] { updateSkin(); } );
} }
inline void insert( QskQuickItem* item ) inline void insert( QskItem* item )
{ {
m_items.insert( item ); m_items.insert( item );
} }
inline void remove( QskQuickItem* item ) inline void remove( QskItem* item )
{ {
m_items.erase( item ); m_items.erase( item );
} }
@ -114,7 +114,7 @@ namespace
} }
private: private:
std::unordered_set< QskQuickItem* > m_items; std::unordered_set< QskItem* > m_items;
}; };
} }
@ -164,22 +164,22 @@ namespace
}; };
} }
Q_GLOBAL_STATIC( QskQuickItemRegistry, qskRegistry ) Q_GLOBAL_STATIC( QskItemRegistry, qskRegistry )
Q_GLOBAL_STATIC( QskWindowStore, qskReleasedWindowCounter ) Q_GLOBAL_STATIC( QskWindowStore, qskReleasedWindowCounter )
QskQuickItem::QskQuickItem( QskQuickItemPrivate& dd, QQuickItem* parent ) QskItem::QskItem( QskItemPrivate& dd, QQuickItem* parent )
: QQuickItem( dd, parent ) : QQuickItem( dd, parent )
{ {
setFlag( QQuickItem::ItemHasContents, true ); setFlag( QQuickItem::ItemHasContents, true );
Inherited::setActiveFocusOnTab( false ); Inherited::setActiveFocusOnTab( false );
if ( dd.updateFlags & QskQuickItem::DeferredUpdate ) if ( dd.updateFlags & QskItem::DeferredUpdate )
qskFilterWindow( window() ); qskFilterWindow( window() );
qskRegistry->insert( this ); qskRegistry->insert( this );
} }
QskQuickItem::~QskQuickItem() QskItem::~QskItem()
{ {
/* /*
We set componentComplete to false, so that operations We set componentComplete to false, so that operations
@ -197,24 +197,24 @@ QskQuickItem::~QskQuickItem()
qskRegistry->remove( this ); qskRegistry->remove( this );
} }
const char* QskQuickItem::className() const const char* QskItem::className() const
{ {
return metaObject()->className(); return metaObject()->className();
} }
void QskQuickItem::classBegin() void QskItem::classBegin()
{ {
Inherited::classBegin(); Inherited::classBegin();
} }
void QskQuickItem::componentComplete() void QskItem::componentComplete()
{ {
#if defined( QT_DEBUG ) #if defined( QT_DEBUG )
if ( d_func()->updateFlags & QskQuickItem::DeferredLayout ) if ( d_func()->updateFlags & QskItem::DeferredLayout )
{ {
if ( qobject_cast< const QQuickBasePositioner* >( parent() ) ) if ( qobject_cast< const QQuickBasePositioner* >( parent() ) )
{ {
qWarning( "QskQuickItem in DeferredLayout mode under control of a positioner" ); qWarning( "QskItem in DeferredLayout mode under control of a positioner" );
} }
} }
#endif #endif
@ -222,7 +222,7 @@ void QskQuickItem::componentComplete()
Inherited::componentComplete(); Inherited::componentComplete();
} }
void QskQuickItem::releaseResources() void QskItem::releaseResources()
{ {
Inherited::releaseResources(); Inherited::releaseResources();
@ -235,37 +235,37 @@ void QskQuickItem::releaseResources()
qskReleasedWindowCounter->setWindow( window() ); qskReleasedWindowCounter->setWindow( window() );
} }
void QskQuickItem::setDisabled( bool on ) void QskItem::setDisabled( bool on )
{ {
Inherited::setEnabled( !on ); Inherited::setEnabled( !on );
} }
void QskQuickItem::setHidden( bool on ) void QskItem::setHidden( bool on )
{ {
Inherited::setVisible( !on ); Inherited::setVisible( !on );
} }
void QskQuickItem::show() void QskItem::show()
{ {
Inherited::setVisible( true ); Inherited::setVisible( true );
} }
void QskQuickItem::hide() void QskItem::hide()
{ {
Inherited::setVisible( false ); Inherited::setVisible( false );
} }
bool QskQuickItem::isVisibleTo( const QQuickItem* ancestor ) const bool QskItem::isVisibleTo( const QQuickItem* ancestor ) const
{ {
return qskIsVisibleTo( this, ancestor ); return qskIsVisibleTo( this, ancestor );
} }
bool QskQuickItem::isVisibleToParent() const bool QskItem::isVisibleToParent() const
{ {
return d_func()->explicitVisible; return d_func()->explicitVisible;
} }
void QskQuickItem::setGeometry( qreal x, qreal y, qreal width, qreal height ) void QskItem::setGeometry( qreal x, qreal y, qreal width, qreal height )
{ {
// QQuickItem does not even offer changing the geometry // QQuickItem does not even offer changing the geometry
// in one call - what leads to 2 calls of the updateGeometry // in one call - what leads to 2 calls of the updateGeometry
@ -323,19 +323,19 @@ void QskQuickItem::setGeometry( qreal x, qreal y, qreal width, qreal height )
} }
} }
QRectF QskQuickItem::rect() const QRectF QskItem::rect() const
{ {
Q_D( const QQuickItem ); Q_D( const QQuickItem );
return QRectF( 0, 0, d->width, d->height ); return QRectF( 0, 0, d->width, d->height );
} }
QRectF QskQuickItem::geometry() const QRectF QskItem::geometry() const
{ {
Q_D( const QQuickItem ); Q_D( const QQuickItem );
return QRectF( d->x, d->y, d->width, d->height ); return QRectF( d->x, d->y, d->width, d->height );
} }
void QskQuickItem::setTabFence( bool on ) void QskItem::setTabFence( bool on )
{ {
Q_D( QQuickItem ); Q_D( QQuickItem );
if ( on != d->isTabFence ) if ( on != d->isTabFence )
@ -345,12 +345,12 @@ void QskQuickItem::setTabFence( bool on )
} }
} }
bool QskQuickItem::isTabFence() const bool QskItem::isTabFence() const
{ {
return d_func()->isTabFence; return d_func()->isTabFence;
} }
void QskQuickItem::setFocusPolicy( Qt::FocusPolicy policy ) void QskItem::setFocusPolicy( Qt::FocusPolicy policy )
{ {
/* /*
Qt::FocusPolicy has always been there with widgets, got lost with Qt::FocusPolicy has always been there with widgets, got lost with
@ -358,7 +358,7 @@ void QskQuickItem::setFocusPolicy( Qt::FocusPolicy policy )
Unfortunately this was done by adding code on top instead of fixing Unfortunately this was done by adding code on top instead of fixing
the foundation. the foundation.
*/ */
Q_D( QskQuickItem ); Q_D( QskItem );
if ( policy != d->focusPolicy ) if ( policy != d->focusPolicy )
{ {
d->focusPolicy = ( policy & ~Qt::TabFocus ); d->focusPolicy = ( policy & ~Qt::TabFocus );
@ -381,7 +381,7 @@ void QskQuickItem::setFocusPolicy( Qt::FocusPolicy policy )
} }
} }
Qt::FocusPolicy QskQuickItem::focusPolicy() const Qt::FocusPolicy QskItem::focusPolicy() const
{ {
uint policy = d_func()->focusPolicy; uint policy = d_func()->focusPolicy;
if ( Inherited::activeFocusOnTab() ) if ( Inherited::activeFocusOnTab() )
@ -390,9 +390,9 @@ Qt::FocusPolicy QskQuickItem::focusPolicy() const
return static_cast< Qt::FocusPolicy >( policy ); return static_cast< Qt::FocusPolicy >( policy );
} }
void QskQuickItem::setWheelEnabled( bool on ) void QskItem::setWheelEnabled( bool on )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if ( on != d->wheelEnabled ) if ( on != d->wheelEnabled )
{ {
d->wheelEnabled = on; d->wheelEnabled = on;
@ -400,14 +400,14 @@ void QskQuickItem::setWheelEnabled( bool on )
} }
} }
bool QskQuickItem::isWheelEnabled() const bool QskItem::isWheelEnabled() const
{ {
return d_func()->wheelEnabled; return d_func()->wheelEnabled;
} }
void QskQuickItem::setPolishOnResize( bool on ) void QskItem::setPolishOnResize( bool on )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if ( on != d->polishOnResize ) if ( on != d->polishOnResize )
{ {
d->polishOnResize = on; d->polishOnResize = on;
@ -417,12 +417,12 @@ void QskQuickItem::setPolishOnResize( bool on )
} }
} }
bool QskQuickItem::polishOnResize() const bool QskItem::polishOnResize() const
{ {
return d_func()->polishOnResize; return d_func()->polishOnResize;
} }
bool QskQuickItem::layoutMirroring() const bool QskItem::layoutMirroring() const
{ {
#if 1 #if 1
/* /*
@ -436,7 +436,7 @@ bool QskQuickItem::layoutMirroring() const
#endif #endif
} }
void QskQuickItem::setLayoutMirroring( bool on, bool childrenInherit ) void QskItem::setLayoutMirroring( bool on, bool childrenInherit )
{ {
// Again we have to deal with an existing API made for QML, // Again we have to deal with an existing API made for QML,
// that is weired for C++: LayoutMirroring/QQuickLayoutMirroringAttached // that is weired for C++: LayoutMirroring/QQuickLayoutMirroringAttached
@ -464,7 +464,7 @@ void QskQuickItem::setLayoutMirroring( bool on, bool childrenInherit )
} }
} }
void QskQuickItem::resetLayoutMirroring() void QskItem::resetLayoutMirroring()
{ {
Q_D( QQuickItem ); Q_D( QQuickItem );
@ -476,27 +476,27 @@ void QskQuickItem::resetLayoutMirroring()
} }
} }
bool QskQuickItem::isPolishScheduled() const bool QskItem::isPolishScheduled() const
{ {
return d_func()->polishScheduled; return d_func()->polishScheduled;
} }
bool QskQuickItem::isUpdateNodeScheduled() const bool QskItem::isUpdateNodeScheduled() const
{ {
Q_D( const QskQuickItem ); Q_D( const QskItem );
return ( d->dirtyAttributes & QQuickItemPrivate::ContentUpdateMask ) && return ( d->dirtyAttributes & QQuickItemPrivate::ContentUpdateMask ) &&
( d->flags & QQuickItem::ItemHasContents ); ( d->flags & QQuickItem::ItemHasContents );
} }
bool QskQuickItem::isInitiallyPainted() const bool QskItem::isInitiallyPainted() const
{ {
return d_func()->initiallyPainted; return d_func()->initiallyPainted;
} }
bool QskQuickItem::maybeUnresized() const bool QskItem::maybeUnresized() const
{ {
Q_D( const QskQuickItem ); Q_D( const QskItem );
if ( d->width <= 0.0 && d->height <= 0.0 ) if ( d->width <= 0.0 && d->height <= 0.0 )
{ {
@ -514,23 +514,23 @@ bool QskQuickItem::maybeUnresized() const
return false; return false;
} }
QskQuickItem::UpdateFlags QskQuickItem::updateFlags() const QskItem::UpdateFlags QskItem::updateFlags() const
{ {
return UpdateFlags( d_func()->updateFlags ); return UpdateFlags( d_func()->updateFlags );
} }
void QskQuickItem::resetUpdateFlags() void QskItem::resetUpdateFlags()
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
// clear all bits in the mask // clear all bits in the mask
d->updateFlagsMask = 0; d->updateFlagsMask = 0;
d->applyUpdateFlags( qskSetup->itemUpdateFlags() ); d->applyUpdateFlags( qskSetup->itemUpdateFlags() );
} }
void QskQuickItem::setUpdateFlag( UpdateFlag flag, bool on ) void QskItem::setUpdateFlag( UpdateFlag flag, bool on )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
d->updateFlagsMask |= flag; d->updateFlagsMask |= flag;
@ -541,9 +541,9 @@ void QskQuickItem::setUpdateFlag( UpdateFlag flag, bool on )
} }
} }
void QskQuickItem::resetUpdateFlag( UpdateFlag flag ) void QskItem::resetUpdateFlag( UpdateFlag flag )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
d->updateFlagsMask &= ~flag; d->updateFlagsMask &= ~flag;
@ -556,14 +556,14 @@ void QskQuickItem::resetUpdateFlag( UpdateFlag flag )
} }
} }
bool QskQuickItem::testUpdateFlag( UpdateFlag flag ) const bool QskItem::testUpdateFlag( UpdateFlag flag ) const
{ {
return d_func()->updateFlags & flag; return d_func()->updateFlags & flag;
} }
void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on ) void QskItem::applyUpdateFlag( UpdateFlag flag, bool on )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if ( testUpdateFlag( flag ) == on ) if ( testUpdateFlag( flag ) == on )
return; return;
@ -575,7 +575,7 @@ void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on )
switch ( flag ) switch ( flag )
{ {
case QskQuickItem::DeferredUpdate: case QskItem::DeferredUpdate:
{ {
if ( on ) if ( on )
{ {
@ -589,14 +589,14 @@ void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on )
break; break;
} }
case QskQuickItem::DeferredPolish: case QskItem::DeferredPolish:
{ {
if ( !on && d->blockedPolish ) if ( !on && d->blockedPolish )
polish(); polish();
break; break;
} }
case QskQuickItem::DeferredLayout: case QskItem::DeferredLayout:
{ {
if ( !on ) if ( !on )
{ {
@ -613,14 +613,14 @@ void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on )
break; break;
} }
case QskQuickItem::CleanupOnVisibility: case QskItem::CleanupOnVisibility:
{ {
if ( on && !isVisible() ) if ( on && !isVisible() )
d->cleanupNodes(); d->cleanupNodes();
break; break;
} }
case QskQuickItem::DebugForceBackground: case QskItem::DebugForceBackground:
{ {
// no need to mark it dirty // no need to mark it dirty
if ( flags() & QQuickItem::ItemHasContents ) if ( flags() & QQuickItem::ItemHasContents )
@ -632,11 +632,11 @@ void QskQuickItem::applyUpdateFlag( UpdateFlag flag, bool on )
} }
} }
void QskQuickItem::resetImplicitSize() void QskItem::resetImplicitSize()
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if ( d->updateFlags & QskQuickItem::DeferredLayout ) if ( d->updateFlags & QskItem::DeferredLayout )
{ {
d->blockedImplicitSize = true; d->blockedImplicitSize = true;
d->layoutConstraintChanged(); d->layoutConstraintChanged();
@ -647,7 +647,7 @@ void QskQuickItem::resetImplicitSize()
} }
} }
bool QskQuickItem::event( QEvent* event ) bool QskItem::event( QEvent* event )
{ {
const int eventType = event->type(); const int eventType = event->type();
const bool hasContents = flags() & QQuickItem::ItemHasContents; const bool hasContents = flags() & QQuickItem::ItemHasContents;
@ -762,19 +762,19 @@ bool QskQuickItem::event( QEvent* event )
return Inherited::event( event ); return Inherited::event( event );
} }
void QskQuickItem::windowChangeEvent( QskWindowChangeEvent* ) void QskItem::windowChangeEvent( QskWindowChangeEvent* )
{ {
} }
void QskQuickItem::geometryChangeEvent( QskGeometryChangeEvent* ) void QskItem::geometryChangeEvent( QskGeometryChangeEvent* )
{ {
} }
void QskQuickItem::changeEvent( QEvent* ) void QskItem::changeEvent( QEvent* )
{ {
} }
void QskQuickItem::itemChange( QQuickItem::ItemChange change, void QskItem::itemChange( QQuickItem::ItemChange change,
const QQuickItem::ItemChangeData& changeData ) const QQuickItem::ItemChangeData& changeData )
{ {
switch ( change ) switch ( change )
@ -783,8 +783,8 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
{ {
if ( changeData.window ) if ( changeData.window )
{ {
Q_D( const QskQuickItem ); Q_D( const QskItem );
if ( d->updateFlags & QskQuickItem::DeferredUpdate ) if ( d->updateFlags & QskItem::DeferredUpdate )
qskFilterWindow( changeData.window ); qskFilterWindow( changeData.window );
} }
@ -824,7 +824,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
#if 1 #if 1
if ( changeData.window == nullptr ) if ( changeData.window == nullptr )
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if( d->focus ) if( d->focus )
{ {
@ -854,7 +854,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
} }
case QQuickItem::ItemVisibleHasChanged: case QQuickItem::ItemVisibleHasChanged:
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
#if 1 #if 1
/* /*
~QQuickItem sends QQuickItem::ItemVisibleHasChanged recursively ~QQuickItem sends QQuickItem::ItemVisibleHasChanged recursively
@ -868,7 +868,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
if ( d->blockedPolish ) if ( d->blockedPolish )
polish(); polish();
if ( d->updateFlags & QskQuickItem::DeferredUpdate ) if ( d->updateFlags & QskItem::DeferredUpdate )
{ {
if ( d->dirtyAttributes && ( d->flags & QQuickItem::ItemHasContents ) ) if ( d->dirtyAttributes && ( d->flags & QQuickItem::ItemHasContents ) )
update(); update();
@ -876,7 +876,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
} }
else else
{ {
if ( d->updateFlags & QskQuickItem::CleanupOnVisibility ) if ( d->updateFlags & QskItem::CleanupOnVisibility )
d->cleanupNodes(); d->cleanupNodes();
d->initiallyPainted = false; d->initiallyPainted = false;
@ -923,7 +923,7 @@ void QskQuickItem::itemChange( QQuickItem::ItemChange change,
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
void QskQuickItem::geometryChanged( void QskItem::geometryChanged(
const QRectF& newGeometry, const QRectF& oldGeometry ) const QRectF& newGeometry, const QRectF& oldGeometry )
{ {
geometryChange( newGeometry, oldGeometry ); geometryChange( newGeometry, oldGeometry );
@ -931,7 +931,7 @@ void QskQuickItem::geometryChanged(
#endif #endif
void QskQuickItem::geometryChange( void QskItem::geometryChange(
const QRectF& newGeometry, const QRectF& oldGeometry ) const QRectF& newGeometry, const QRectF& oldGeometry )
{ {
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
@ -940,7 +940,7 @@ void QskQuickItem::geometryChange(
Inherited::geometryChange( newGeometry, oldGeometry ); Inherited::geometryChange( newGeometry, oldGeometry );
#endif #endif
Q_D( const QskQuickItem ); Q_D( const QskItem );
if ( !d->polishScheduled && d->polishOnResize ) if ( !d->polishScheduled && d->polishOnResize )
{ {
if ( newGeometry.size() != oldGeometry.size() ) if ( newGeometry.size() != oldGeometry.size() )
@ -951,30 +951,30 @@ void QskQuickItem::geometryChange(
QCoreApplication::sendEvent( this, &event ); QCoreApplication::sendEvent( this, &event );
} }
void QskQuickItem::mouseUngrabEvent() void QskItem::mouseUngrabEvent()
{ {
Inherited::mouseUngrabEvent(); Inherited::mouseUngrabEvent();
} }
void QskQuickItem::touchUngrabEvent() void QskItem::touchUngrabEvent()
{ {
Inherited::touchUngrabEvent(); Inherited::touchUngrabEvent();
} }
#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 ) #if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
void QskQuickItem::windowDeactivateEvent() void QskItem::windowDeactivateEvent()
{ {
Inherited::windowDeactivateEvent(); Inherited::windowDeactivateEvent();
} }
#endif #endif
void QskQuickItem::updatePolish() void QskItem::updatePolish()
{ {
Q_D( QskQuickItem ); Q_D( QskItem );
if ( d->updateFlags & QskQuickItem::DeferredPolish ) if ( d->updateFlags & QskItem::DeferredPolish )
{ {
if ( !isVisible() ) if ( !isVisible() )
{ {
@ -998,21 +998,21 @@ void QskQuickItem::updatePolish()
updateItemPolish(); updateItemPolish();
} }
void QskQuickItem::aboutToShow() void QskItem::aboutToShow()
{ {
} }
void QskQuickItem::updateItemPolish() void QskItem::updateItemPolish()
{ {
} }
QSGNode* QskQuickItem::updatePaintNode( QSGNode* node, UpdatePaintNodeData* data ) QSGNode* QskItem::updatePaintNode( QSGNode* node, UpdatePaintNodeData* data )
{ {
Q_UNUSED( data ) Q_UNUSED( data )
Q_D( QskQuickItem ); Q_D( QskItem );
Q_ASSERT( isVisible() || !( d->updateFlags & QskQuickItem::DeferredUpdate ) ); Q_ASSERT( isVisible() || !( d->updateFlags & QskItem::DeferredUpdate ) );
d->initiallyPainted = true; d->initiallyPainted = true;
@ -1040,9 +1040,9 @@ QSGNode* QskQuickItem::updatePaintNode( QSGNode* node, UpdatePaintNodeData* data
return updateItemPaintNode( node ); return updateItemPaintNode( node );
} }
QSGNode* QskQuickItem::updateItemPaintNode( QSGNode* node ) QSGNode* QskItem::updateItemPaintNode( QSGNode* node )
{ {
return node; return node;
} }
#include "moc_QskQuickItem.cpp" #include "moc_QskItem.cpp"

View File

@ -3,17 +3,17 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_QUICK_ITEM_H #ifndef QSK_ITEM_H
#define QSK_QUICK_ITEM_H #define QSK_ITEM_H
#include "QskGlobal.h" #include "QskGlobal.h"
#include <qquickitem.h> #include <qquickitem.h>
class QskQuickItemPrivate; class QskItemPrivate;
class QskGeometryChangeEvent; class QskGeometryChangeEvent;
class QskWindowChangeEvent; class QskWindowChangeEvent;
class QSK_EXPORT QskQuickItem : public QQuickItem class QSK_EXPORT QskItem : public QQuickItem
{ {
Q_OBJECT Q_OBJECT
@ -56,7 +56,7 @@ class QSK_EXPORT QskQuickItem : public QQuickItem
Q_ENUM( UpdateFlag ) Q_ENUM( UpdateFlag )
Q_DECLARE_FLAGS( UpdateFlags, UpdateFlag ) Q_DECLARE_FLAGS( UpdateFlags, UpdateFlag )
~QskQuickItem() override; ~QskItem() override;
const char* className() const; const char* className() const;
@ -136,7 +136,7 @@ class QSK_EXPORT QskQuickItem : public QQuickItem
#endif #endif
protected: protected:
QskQuickItem( QskQuickItemPrivate&, QQuickItem* = nullptr ); QskItem( QskItemPrivate&, QQuickItem* = nullptr );
bool event( QEvent* ) override; bool event( QEvent* ) override;
@ -182,40 +182,40 @@ class QSK_EXPORT QskQuickItem : public QQuickItem
void updatePolish() override final; void updatePolish() override final;
virtual void updateItemPolish(); virtual void updateItemPolish();
Q_DECLARE_PRIVATE( QskQuickItem ) Q_DECLARE_PRIVATE( QskItem )
}; };
inline bool QskQuickItem::hasChildItems() const inline bool QskItem::hasChildItems() const
{ {
return !childItems().isEmpty(); return !childItems().isEmpty();
} }
inline void QskQuickItem::setGeometry( const QPointF& pos, const QSizeF& size ) inline void QskItem::setGeometry( const QPointF& pos, const QSizeF& size )
{ {
setGeometry( pos.x(), pos.y(), size.width(), size.height() ); setGeometry( pos.x(), pos.y(), size.width(), size.height() );
} }
inline void QskQuickItem::setGeometry( const QRectF& rect ) inline void QskItem::setGeometry( const QRectF& rect )
{ {
setGeometry( rect.x(), rect.y(), rect.width(), rect.height() ); setGeometry( rect.x(), rect.y(), rect.width(), rect.height() );
} }
inline void QskQuickItem::setPosition( qreal x, qreal y ) inline void QskItem::setPosition( qreal x, qreal y )
{ {
QQuickItem::setPosition( QPointF( x, y ) ); QQuickItem::setPosition( QPointF( x, y ) );
} }
inline void QskQuickItem::setSize( qreal width, qreal height ) inline void QskItem::setSize( qreal width, qreal height )
{ {
QQuickItem::setSize( QSizeF( width, height ) ); QQuickItem::setSize( QSizeF( width, height ) );
} }
inline QSizeF QskQuickItem::implicitSize() const inline QSizeF QskItem::implicitSize() const
{ {
return QSizeF( implicitWidth(), implicitHeight() ); return QSizeF( implicitWidth(), implicitHeight() );
} }
Q_DECLARE_OPERATORS_FOR_FLAGS( QskQuickItem::UpdateFlags ) Q_DECLARE_OPERATORS_FOR_FLAGS( QskItem::UpdateFlags )
Q_DECLARE_METATYPE( QskQuickItem::UpdateFlags ) Q_DECLARE_METATYPE( QskItem::UpdateFlags )
#endif #endif

View File

@ -3,7 +3,7 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#include "QskQuickItemPrivate.h" #include "QskItemPrivate.h"
#include "QskTreeNode.h" #include "QskTreeNode.h"
#include "QskSetup.h" #include "QskSetup.h"
@ -13,7 +13,7 @@ static inline void qskSendEventTo( QObject* object, QEvent::Type type )
QCoreApplication::sendEvent( object, &event ); QCoreApplication::sendEvent( object, &event );
} }
QskQuickItemPrivate::QskQuickItemPrivate() QskItemPrivate::QskItemPrivate()
: updateFlags( qskSetup->itemUpdateFlags() ) : updateFlags( qskSetup->itemUpdateFlags() )
, updateFlagsMask( 0 ) , updateFlagsMask( 0 )
, polishOnResize( false ) , polishOnResize( false )
@ -24,7 +24,7 @@ QskQuickItemPrivate::QskQuickItemPrivate()
, wheelEnabled( false ) , wheelEnabled( false )
, focusPolicy( Qt::NoFocus ) , focusPolicy( Qt::NoFocus )
{ {
if ( updateFlags & QskQuickItem::DeferredLayout ) if ( updateFlags & QskItem::DeferredLayout )
{ {
/* /*
In general the geometry of an item should be the job of In general the geometry of an item should be the job of
@ -49,16 +49,16 @@ QskQuickItemPrivate::QskQuickItemPrivate()
} }
} }
QskQuickItemPrivate::~QskQuickItemPrivate() QskItemPrivate::~QskItemPrivate()
{ {
} }
void QskQuickItemPrivate::mirrorChange() void QskItemPrivate::mirrorChange()
{ {
qskSendEventTo( q_func(), QEvent::LayoutDirectionChange ); qskSendEventTo( q_func(), QEvent::LayoutDirectionChange );
} }
void QskQuickItemPrivate::applyUpdateFlags( QskQuickItem::UpdateFlags flags ) void QskItemPrivate::applyUpdateFlags( QskItem::UpdateFlags flags )
{ {
/* /*
Replace all flags, that have not been set explicitely by the Replace all flags, that have not been set explicitely by the
@ -70,12 +70,12 @@ void QskQuickItemPrivate::applyUpdateFlags( QskQuickItem::UpdateFlags flags )
if ( flags == oldFlags ) if ( flags == oldFlags )
return; return;
Q_Q( QskQuickItem ); Q_Q( QskItem );
Q_STATIC_ASSERT( sizeof( updateFlags ) == 1 ); Q_STATIC_ASSERT( sizeof( updateFlags ) == 1 );
for ( uint i = 0; i < 8; i++ ) for ( uint i = 0; i < 8; i++ )
{ {
const auto flag = static_cast< QskQuickItem::UpdateFlag >( 1 << i ); const auto flag = static_cast< QskItem::UpdateFlag >( 1 << i );
if ( !( this->updateFlagsMask & flag ) ) if ( !( this->updateFlagsMask & flag ) )
q->applyUpdateFlag( flag, flags & flag ); q->applyUpdateFlag( flag, flags & flag );
@ -85,40 +85,40 @@ void QskQuickItemPrivate::applyUpdateFlags( QskQuickItem::UpdateFlags flags )
Q_EMIT q->updateFlagsChanged( q->updateFlags() ); Q_EMIT q->updateFlagsChanged( q->updateFlags() );
} }
void QskQuickItemPrivate::layoutConstraintChanged() void QskItemPrivate::layoutConstraintChanged()
{ {
if ( auto item = q_func()->parentItem() ) if ( auto item = q_func()->parentItem() )
qskSendEventTo( item, QEvent::LayoutRequest ); qskSendEventTo( item, QEvent::LayoutRequest );
} }
void QskQuickItemPrivate::implicitSizeChanged() void QskItemPrivate::implicitSizeChanged()
{ {
layoutConstraintChanged(); layoutConstraintChanged();
} }
qreal QskQuickItemPrivate::getImplicitWidth() const qreal QskItemPrivate::getImplicitWidth() const
{ {
if ( blockedImplicitSize ) if ( blockedImplicitSize )
{ {
auto that = const_cast< QskQuickItemPrivate* >( this ); auto that = const_cast< QskItemPrivate* >( this );
that->updateImplicitSize( false ); that->updateImplicitSize( false );
} }
return implicitWidth; return implicitWidth;
} }
qreal QskQuickItemPrivate::getImplicitHeight() const qreal QskItemPrivate::getImplicitHeight() const
{ {
if ( blockedImplicitSize ) if ( blockedImplicitSize )
{ {
auto that = const_cast< QskQuickItemPrivate* >( this ); auto that = const_cast< QskItemPrivate* >( this );
that->updateImplicitSize( false ); that->updateImplicitSize( false );
} }
return implicitHeight; return implicitHeight;
} }
void QskQuickItemPrivate::updateImplicitSize( bool doNotify ) void QskItemPrivate::updateImplicitSize( bool doNotify )
{ {
blockedImplicitSize = false; blockedImplicitSize = false;
@ -126,7 +126,7 @@ void QskQuickItemPrivate::updateImplicitSize( bool doNotify )
setImplicitSize( hint.width(), hint.height(), doNotify ); setImplicitSize( hint.width(), hint.height(), doNotify );
} }
void QskQuickItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify ) void QskItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify )
{ {
const bool doWidth = ( w != implicitWidth ); const bool doWidth = ( w != implicitWidth );
const bool doHeight = ( h != implicitHeight ); const bool doHeight = ( h != implicitHeight );
@ -162,7 +162,7 @@ void QskQuickItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify )
const QRectF oldRect( x, y, oldWidth, oldHeight ); const QRectF oldRect( x, y, oldWidth, oldHeight );
const QRectF newRect( x, y, width, height ); const QRectF newRect( x, y, width, height );
Q_Q( QskQuickItem ); Q_Q( QskItem );
q->geometryChange( newRect, oldRect ); q->geometryChange( newRect, oldRect );
} }
} }
@ -181,7 +181,7 @@ void QskQuickItemPrivate::setImplicitSize( qreal w, qreal h, bool doNotify )
In case of the application interferes by calling In case of the application interferes by calling
setImplicitWidth or setImplicitHeight manually: setImplicitWidth or setImplicitHeight manually:
*/ */
void QskQuickItemPrivate::implicitWidthChanged() void QskItemPrivate::implicitWidthChanged()
{ {
Inherited::implicitWidthChanged(); Inherited::implicitWidthChanged();
@ -189,7 +189,7 @@ void QskQuickItemPrivate::implicitWidthChanged()
implicitSizeChanged(); implicitSizeChanged();
} }
void QskQuickItemPrivate::implicitHeightChanged() void QskItemPrivate::implicitHeightChanged()
{ {
Inherited::implicitWidthChanged(); Inherited::implicitWidthChanged();
@ -197,7 +197,7 @@ void QskQuickItemPrivate::implicitHeightChanged()
implicitSizeChanged(); implicitSizeChanged();
} }
void QskQuickItemPrivate::cleanupNodes() void QskItemPrivate::cleanupNodes()
{ {
if ( itemNodeInstance == nullptr ) if ( itemNodeInstance == nullptr )
return; return;
@ -243,7 +243,7 @@ void QskQuickItemPrivate::cleanupNodes()
} }
} }
QSGTransformNode* QskQuickItemPrivate::createTransformNode() QSGTransformNode* QskItemPrivate::createTransformNode()
{ {
return new QskItemNode(); return new QskItemNode();
} }

View File

@ -3,26 +3,26 @@
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*****************************************************************************/ *****************************************************************************/
#ifndef QSK_QUICK_ITEM_PRIVATE_H #ifndef QSK_ITEM_PRIVATE_H
#define QSK_QUICK_ITEM_PRIVATE_H #define QSK_ITEM_PRIVATE_H
#include "QskGlobal.h" #include "QskGlobal.h"
#include "QskQuickItem.h" #include "QskItem.h"
QSK_QT_PRIVATE_BEGIN QSK_QT_PRIVATE_BEGIN
#include <private/qquickitem_p.h> #include <private/qquickitem_p.h>
QSK_QT_PRIVATE_END QSK_QT_PRIVATE_END
class QskQuickItemPrivate : public QQuickItemPrivate class QskItemPrivate : public QQuickItemPrivate
{ {
using Inherited = QQuickItemPrivate; using Inherited = QQuickItemPrivate;
protected: protected:
QskQuickItemPrivate(); QskItemPrivate();
~QskQuickItemPrivate() override; ~QskItemPrivate() override;
public: public:
void applyUpdateFlags( QskQuickItem::UpdateFlags ); void applyUpdateFlags( QskItem::UpdateFlags );
QSGTransformNode* createTransformNode() override; QSGTransformNode* createTransformNode() override;
protected: protected:
@ -45,7 +45,7 @@ class QskQuickItemPrivate : public QQuickItemPrivate
virtual QSizeF implicitSizeHint() const = 0; virtual QSizeF implicitSizeHint() const = 0;
private: private:
Q_DECLARE_PUBLIC( QskQuickItem ) Q_DECLARE_PUBLIC( QskItem )
quint8 updateFlags; quint8 updateFlags;
quint8 updateFlagsMask; quint8 updateFlagsMask;

View File

@ -65,7 +65,7 @@ bool qskIsItemInDestructor( const QQuickItem* item )
return d->inDestructor; return d->inDestructor;
#else #else
/* /*
QskQuickItem sets componentComplete to false in its destructor, QskItem sets componentComplete to false in its destructor,
but for other items we will will return the wrong information but for other items we will will return the wrong information
*/ */
return !d->componentComplete; return !d->componentComplete;

View File

@ -23,29 +23,29 @@ static inline bool qskHasEnvironment( const char* env )
return !result.isEmpty() && result != "false"; return !result.isEmpty() && result != "false";
} }
static inline const QskQuickItem::UpdateFlags qskEnvironmentUpdateFlags() static inline const QskItem::UpdateFlags qskEnvironmentUpdateFlags()
{ {
QskQuickItem::UpdateFlags flags; QskItem::UpdateFlags flags;
if ( qskHasEnvironment( "QSK_PREFER_RASTER" ) ) if ( qskHasEnvironment( "QSK_PREFER_RASTER" ) )
flags |= QskQuickItem::PreferRasterForTextures; flags |= QskItem::PreferRasterForTextures;
if ( qskHasEnvironment( "QSK_FORCE_BACKGROUND" ) ) if ( qskHasEnvironment( "QSK_FORCE_BACKGROUND" ) )
flags |= QskQuickItem::DebugForceBackground; flags |= QskItem::DebugForceBackground;
return flags; return flags;
} }
static inline QskQuickItem::UpdateFlags qskDefaultUpdateFlags() static inline QskItem::UpdateFlags qskDefaultUpdateFlags()
{ {
static QskQuickItem::UpdateFlags flags; static QskItem::UpdateFlags flags;
if ( flags == 0 ) if ( flags == 0 )
{ {
flags |= QskQuickItem::DeferredUpdate; flags |= QskItem::DeferredUpdate;
flags |= QskQuickItem::DeferredPolish; flags |= QskItem::DeferredPolish;
flags |= QskQuickItem::DeferredLayout; flags |= QskItem::DeferredLayout;
flags |= QskQuickItem::CleanupOnVisibility; flags |= QskItem::CleanupOnVisibility;
flags |= qskEnvironmentUpdateFlags(); flags |= qskEnvironmentUpdateFlags();
} }
@ -69,7 +69,7 @@ class QskSetup::PrivateData
} }
QskGraphicProviderMap graphicProviders; QskGraphicProviderMap graphicProviders;
QskQuickItem::UpdateFlags itemUpdateFlags; QskItem::UpdateFlags itemUpdateFlags;
}; };
QskSetup::QskSetup() QskSetup::QskSetup()
@ -94,7 +94,7 @@ void QskSetup::cleanup()
s_instance = nullptr; s_instance = nullptr;
} }
void QskSetup::setItemUpdateFlags( QskQuickItem::UpdateFlags flags ) void QskSetup::setItemUpdateFlags( QskItem::UpdateFlags flags )
{ {
if ( m_data->itemUpdateFlags != flags ) if ( m_data->itemUpdateFlags != flags )
{ {
@ -103,7 +103,7 @@ void QskSetup::setItemUpdateFlags( QskQuickItem::UpdateFlags flags )
} }
} }
QskQuickItem::UpdateFlags QskSetup::itemUpdateFlags() const QskItem::UpdateFlags QskSetup::itemUpdateFlags() const
{ {
return m_data->itemUpdateFlags; return m_data->itemUpdateFlags;
} }
@ -113,7 +113,7 @@ void QskSetup::resetItemUpdateFlags()
setItemUpdateFlags( qskDefaultUpdateFlags() ); setItemUpdateFlags( qskDefaultUpdateFlags() );
} }
void QskSetup::setItemUpdateFlag( QskQuickItem::UpdateFlag flag, bool on ) void QskSetup::setItemUpdateFlag( QskItem::UpdateFlag flag, bool on )
{ {
if ( m_data->itemUpdateFlags.testFlag( flag ) != on ) if ( m_data->itemUpdateFlags.testFlag( flag ) != on )
{ {
@ -126,12 +126,12 @@ void QskSetup::setItemUpdateFlag( QskQuickItem::UpdateFlag flag, bool on )
} }
} }
void QskSetup::resetItemUpdateFlag( QskQuickItem::UpdateFlag flag ) void QskSetup::resetItemUpdateFlag( QskItem::UpdateFlag flag )
{ {
setItemUpdateFlag( flag, flag & qskDefaultUpdateFlags() ); setItemUpdateFlag( flag, flag & qskDefaultUpdateFlags() );
} }
bool QskSetup::testItemUpdateFlag( QskQuickItem::UpdateFlag flag ) bool QskSetup::testItemUpdateFlag( QskItem::UpdateFlag flag )
{ {
return m_data->itemUpdateFlags.testFlag( flag ); return m_data->itemUpdateFlags.testFlag( flag );
} }

View File

@ -7,7 +7,7 @@
#define QSK_SETUP_H #define QSK_SETUP_H
#include "QskGlobal.h" #include "QskGlobal.h"
#include "QskQuickItem.h" #include "QskItem.h"
#include <qobject.h> #include <qobject.h>
#include <memory> #include <memory>
@ -29,13 +29,13 @@ class QSK_EXPORT QskSetup : public QObject
static QskSetup* instance(); static QskSetup* instance();
void setItemUpdateFlags( QskQuickItem::UpdateFlags ); void setItemUpdateFlags( QskItem::UpdateFlags );
void resetItemUpdateFlags(); void resetItemUpdateFlags();
QskQuickItem::UpdateFlags itemUpdateFlags() const; QskItem::UpdateFlags itemUpdateFlags() const;
void setItemUpdateFlag( QskQuickItem::UpdateFlag, bool on = true ); void setItemUpdateFlag( QskItem::UpdateFlag, bool on = true );
void resetItemUpdateFlag( QskQuickItem::UpdateFlag ); void resetItemUpdateFlag( QskItem::UpdateFlag );
bool testItemUpdateFlag( QskQuickItem::UpdateFlag ); bool testItemUpdateFlag( QskItem::UpdateFlag );
void addGraphicProvider( const QString& providerId, QskGraphicProvider* ); void addGraphicProvider( const QString& providerId, QskGraphicProvider* );
QskGraphicProvider* graphicProvider( const QString& providerId ) const; QskGraphicProvider* graphicProvider( const QString& providerId ) const;

View File

@ -126,10 +126,10 @@ static inline QSGNode* qskUpdateGraphicNode(
if ( graphicNode == nullptr ) if ( graphicNode == nullptr )
graphicNode = new QskGraphicNode(); graphicNode = new QskGraphicNode();
const auto flag = QskQuickItem::PreferRasterForTextures; const auto flag = QskItem::PreferRasterForTextures;
bool useRaster = qskSetup->testItemUpdateFlag( flag ); bool useRaster = qskSetup->testItemUpdateFlag( flag );
if ( auto qItem = qobject_cast< const QskQuickItem* >( item ) ) if ( auto qItem = qobject_cast< const QskItem* >( item ) )
useRaster = qItem->testUpdateFlag( flag ); useRaster = qItem->testUpdateFlag( flag );
graphicNode->setRenderHint( useRaster ? QskPaintedNode::Raster : QskPaintedNode::OpenGL ); graphicNode->setRenderHint( useRaster ? QskPaintedNode::Raster : QskPaintedNode::OpenGL );
@ -345,7 +345,7 @@ void QskSkinlet::updateNode( QskSkinnable* skinnable, QSGNode* parentNode ) cons
oldNode = findChildNode( parentNode, DebugRole ); oldNode = findChildNode( parentNode, DebugRole );
newNode = nullptr; newNode = nullptr;
if ( control->testUpdateFlag( QskQuickItem::DebugForceBackground ) ) if ( control->testUpdateFlag( QskItem::DebugForceBackground ) )
newNode = updateDebugNode( control, oldNode ); newNode = updateDebugNode( control, oldNode );
replaceChildNode( DebugRole, parentNode, oldNode, newNode ); replaceChildNode( DebugRole, parentNode, oldNode, newNode );

View File

@ -32,7 +32,7 @@ QSK_EXPORT QskTreeNode* qskTreeNodeCast( QSGNode* );
QSK_EXPORT const QskTreeNode* qskTreeNodeCast( const QSGNode* ); QSK_EXPORT const QskTreeNode* qskTreeNodeCast( const QSGNode* );
/* /*
Used by all QskQuickItem as root node ( = itemNode ) of its subtree Used by QskItem as root node ( = itemNode ) of its subtree
( see qskItemNode in QskQuick.h ) ( see qskItemNode in QskQuick.h )
*/ */
class QSK_EXPORT QskItemNode final : public QSGTransformNode class QSK_EXPORT QskItemNode final : public QSGTransformNode

View File

@ -111,7 +111,7 @@ void SkinnyShortcut::showBackground()
scengraphDebugMode = sgDebugModes[ id - 2 ]; scengraphDebugMode = sgDebugModes[ id - 2 ];
} }
qskSetup->setItemUpdateFlag( QskQuickItem::DebugForceBackground, forceBackground ); qskSetup->setItemUpdateFlag( QskItem::DebugForceBackground, forceBackground );
const auto windows = QGuiApplication::topLevelWindows(); const auto windows = QGuiApplication::topLevelWindows();
for ( auto window : windows ) for ( auto window : windows )