beautified
This commit is contained in:
parent
50923fcf8c
commit
e5cb155350
|
@ -349,7 +349,7 @@ void QskAnimator::update()
|
||||||
|
|
||||||
if ( m_autoRepeat )
|
if ( m_autoRepeat )
|
||||||
{
|
{
|
||||||
double progress = std::fmod(( driverTime - m_startTime ), m_duration );
|
double progress = std::fmod( driverTime - m_startTime, m_duration );
|
||||||
progress /= m_duration;
|
progress /= m_duration;
|
||||||
|
|
||||||
advance( m_easingCurve.valueForProgress( progress ) );
|
advance( m_easingCurve.valueForProgress( progress ) );
|
||||||
|
|
|
@ -136,7 +136,7 @@ qreal QskBoundedControl::boundedValue( qreal value ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskBoundedControl::valueAsRatio( qreal value ) const
|
qreal QskBoundedControl::valueAsRatio( qreal value ) const
|
||||||
{
|
{
|
||||||
return ( value - m_minimum ) / ( m_maximum - m_minimum );
|
return ( value - m_minimum ) / ( m_maximum - m_minimum );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class QSK_EXPORT QskBoundedControl : public QskControl
|
||||||
Q_PROPERTY( qreal minimum READ minimum WRITE setMinimum NOTIFY minimumChanged )
|
Q_PROPERTY( qreal minimum READ minimum WRITE setMinimum NOTIFY minimumChanged )
|
||||||
Q_PROPERTY( qreal maximum READ maximum WRITE setMaximum NOTIFY maximumChanged )
|
Q_PROPERTY( qreal maximum READ maximum WRITE setMaximum NOTIFY maximumChanged )
|
||||||
Q_PROPERTY( QskIntervalF boundaries READ boundaries
|
Q_PROPERTY( QskIntervalF boundaries READ boundaries
|
||||||
WRITE setBoundaries NOTIFY boundariesChanged )
|
WRITE setBoundaries NOTIFY boundariesChanged )
|
||||||
|
|
||||||
using Inherited = QskControl;
|
using Inherited = QskControl;
|
||||||
|
|
||||||
|
|
|
@ -72,18 +72,18 @@ int QskBoundedInput::pageSize() const
|
||||||
void QskBoundedInput::stepUp()
|
void QskBoundedInput::stepUp()
|
||||||
{
|
{
|
||||||
increment( m_stepSize );
|
increment( m_stepSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskBoundedInput::stepDown()
|
void QskBoundedInput::stepDown()
|
||||||
{
|
{
|
||||||
increment( -m_stepSize );
|
increment( -m_stepSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskBoundedInput::pageUp()
|
void QskBoundedInput::pageUp()
|
||||||
{
|
{
|
||||||
increment( m_pageSize * m_stepSize );
|
increment( m_pageSize * m_stepSize );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskBoundedInput::pageDown()
|
void QskBoundedInput::pageDown()
|
||||||
{
|
{
|
||||||
increment( -m_pageSize * m_stepSize );
|
increment( -m_pageSize * m_stepSize );
|
||||||
|
@ -128,7 +128,7 @@ qreal QskBoundedInput::alignedValue( qreal value ) const
|
||||||
if ( const auto step = m_stepSize )
|
if ( const auto step = m_stepSize )
|
||||||
value = qRound( value / step ) * step;
|
value = qRound( value / step ) * step;
|
||||||
}
|
}
|
||||||
|
|
||||||
return boundedValue( value );
|
return boundedValue( value );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void QskBoundedRangeInput::setLowerValueAsRatio( qreal ratio )
|
||||||
setLowerValue( minimum() + ratio * boundaryLength() );
|
setLowerValue( minimum() + ratio * boundaryLength() );
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskBoundedRangeInput::lowerValueAsRatio() const
|
qreal QskBoundedRangeInput::lowerValueAsRatio() const
|
||||||
{
|
{
|
||||||
return ( lowerValue() - minimum() ) / boundaryLength();
|
return ( lowerValue() - minimum() ) / boundaryLength();
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ void QskBoundedRangeInput::setUpperValueAsRatio( qreal ratio )
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskBoundedRangeInput::upperValueAsRatio() const
|
qreal QskBoundedRangeInput::upperValueAsRatio() const
|
||||||
{
|
{
|
||||||
return ( upperValue() - minimum() ) / boundaryLength();
|
return ( upperValue() - minimum() ) / boundaryLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ void QskBoundedRangeInput::setUpperValue( qreal value )
|
||||||
}
|
}
|
||||||
|
|
||||||
setRange( QskIntervalF( m_range.lowerBound(), value ) );
|
setRange( QskIntervalF( m_range.lowerBound(), value ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
qreal QskBoundedRangeInput::upperValue() const
|
qreal QskBoundedRangeInput::upperValue() const
|
||||||
{
|
{
|
||||||
|
@ -93,8 +93,8 @@ void QskBoundedRangeInput::setRange( const QskIntervalF& range )
|
||||||
}
|
}
|
||||||
|
|
||||||
setRangeInternal( range );
|
setRangeInternal( range );
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskBoundedRangeInput::resetRange()
|
void QskBoundedRangeInput::resetRange()
|
||||||
{
|
{
|
||||||
if ( m_range.isValid() )
|
if ( m_range.isValid() )
|
||||||
|
@ -122,9 +122,9 @@ void QskBoundedRangeInput::setRangeInternal( const QskIntervalF& range )
|
||||||
}
|
}
|
||||||
|
|
||||||
QskIntervalF QskBoundedRangeInput::range() const
|
QskIntervalF QskBoundedRangeInput::range() const
|
||||||
{
|
{
|
||||||
return m_range;
|
return m_range;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskBoundedRangeInput::alignInput()
|
void QskBoundedRangeInput::alignInput()
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,8 +38,8 @@ class QSK_EXPORT QskBoundedRangeInput : public QskBoundedInput
|
||||||
qreal upperValue() const;
|
qreal upperValue() const;
|
||||||
|
|
||||||
// [0.0, 1.0]
|
// [0.0, 1.0]
|
||||||
qreal lowerValueAsRatio() const;
|
qreal lowerValueAsRatio() const;
|
||||||
qreal upperValueAsRatio() const;
|
qreal upperValueAsRatio() const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
void setRange( const QskIntervalF& );
|
void setRange( const QskIntervalF& );
|
||||||
|
|
|
@ -25,7 +25,7 @@ class QSK_EXPORT QskBoundedValueInput : public QskBoundedInput
|
||||||
qreal value() const;
|
qreal value() const;
|
||||||
|
|
||||||
// [0.0, 1.0]
|
// [0.0, 1.0]
|
||||||
qreal valueAsRatio() const;
|
qreal valueAsRatio() const;
|
||||||
using QskBoundedInput::valueAsRatio;
|
using QskBoundedInput::valueAsRatio;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
|
@ -153,7 +153,7 @@ void QskFocusIndicator::updateFocusFrame()
|
||||||
{
|
{
|
||||||
QRectF clipRect( 0, 0, w->width(), w->height() );
|
QRectF clipRect( 0, 0, w->width(), w->height() );
|
||||||
clipRect = parentItem()->mapRectFromScene( clipRect );
|
clipRect = parentItem()->mapRectFromScene( clipRect );
|
||||||
|
|
||||||
r = r.intersected( clipRect );
|
r = r.intersected( clipRect );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ QskProgressBar::QskProgressBar( Qt::Orientation orientation,
|
||||||
initSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::MinimumExpanding );
|
initSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::MinimumExpanding );
|
||||||
|
|
||||||
connect( this, &QskBoundedControl::boundariesChanged,
|
connect( this, &QskBoundedControl::boundariesChanged,
|
||||||
this, &QskProgressBar::adjustValue );
|
this, &QskProgressBar::adjustValue );
|
||||||
}
|
}
|
||||||
|
|
||||||
QskProgressBar::QskProgressBar( Qt::Orientation orientation, QQuickItem* parent )
|
QskProgressBar::QskProgressBar( Qt::Orientation orientation, QQuickItem* parent )
|
||||||
|
|
|
@ -15,17 +15,17 @@ class QSK_EXPORT QskProgressBar : public QskBoundedControl
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY( Qt::Orientation orientation READ orientation
|
Q_PROPERTY( Qt::Orientation orientation READ orientation
|
||||||
WRITE setOrientation NOTIFY orientationChanged )
|
WRITE setOrientation NOTIFY orientationChanged )
|
||||||
|
|
||||||
Q_PROPERTY( bool indeterminate READ isIndeterminate
|
Q_PROPERTY( bool indeterminate READ isIndeterminate
|
||||||
WRITE setIndeterminate NOTIFY indeterminateChanged )
|
WRITE setIndeterminate NOTIFY indeterminateChanged )
|
||||||
|
|
||||||
Q_PROPERTY( qreal origin READ origin
|
Q_PROPERTY( qreal origin READ origin
|
||||||
WRITE setOrigin RESET resetOrigin NOTIFY originChanged )
|
WRITE setOrigin RESET resetOrigin NOTIFY originChanged )
|
||||||
|
|
||||||
Q_PROPERTY( qreal value READ value WRITE setValue NOTIFY valueChanged )
|
Q_PROPERTY( qreal value READ value WRITE setValue NOTIFY valueChanged )
|
||||||
Q_PROPERTY( qreal valueAsRatio READ valueAsRatio
|
Q_PROPERTY( qreal valueAsRatio READ valueAsRatio
|
||||||
WRITE setValueAsRatio NOTIFY valueChanged )
|
WRITE setValueAsRatio NOTIFY valueChanged )
|
||||||
|
|
||||||
using Inherited = QskBoundedControl;
|
using Inherited = QskBoundedControl;
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ class QSK_EXPORT QskProgressBar : public QskBoundedControl
|
||||||
|
|
||||||
QskAspect::Placement effectivePlacement() const override;
|
QskAspect::Placement effectivePlacement() const override;
|
||||||
|
|
||||||
void setBarGradient( const QskGradient & );
|
void setBarGradient( const QskGradient& );
|
||||||
void resetBarGradient();
|
void resetBarGradient();
|
||||||
QskGradient barGradient() const;
|
QskGradient barGradient() const;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ QRectF QskProgressBarSkinlet::subControlRect(
|
||||||
if( ( subControl == QskProgressBar::Groove ) )
|
if( ( subControl == QskProgressBar::Groove ) )
|
||||||
{
|
{
|
||||||
const auto dim = bar->thickness();
|
const auto dim = bar->thickness();
|
||||||
|
|
||||||
auto rect = contentsRect;
|
auto rect = contentsRect;
|
||||||
if ( bar->orientation() == Qt::Horizontal )
|
if ( bar->orientation() == Qt::Horizontal )
|
||||||
{
|
{
|
||||||
|
@ -119,7 +119,7 @@ QSGNode* QskProgressBarSkinlet::updateBarNode(
|
||||||
const auto rect = bar->subControlRect( subControl );
|
const auto rect = bar->subControlRect( subControl );
|
||||||
if ( rect.isEmpty() )
|
if ( rect.isEmpty() )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto gradient = bar->gradientHint( subControl );
|
auto gradient = bar->gradientHint( subControl );
|
||||||
if ( !gradient.isVisible() )
|
if ( !gradient.isVisible() )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
|
@ -18,7 +18,7 @@ class QSK_EXPORT QskScrollBox : public QskControl
|
||||||
Q_PROPERTY( Qt::Orientations flickableOrientations READ flickableOrientations
|
Q_PROPERTY( Qt::Orientations flickableOrientations READ flickableOrientations
|
||||||
WRITE setFlickableOrientations NOTIFY flickableOrientationsChanged FINAL )
|
WRITE setFlickableOrientations NOTIFY flickableOrientationsChanged FINAL )
|
||||||
|
|
||||||
Q_PROPERTY( bool autoScrollFocusedItem READ autoScrollFocusItem
|
Q_PROPERTY( bool autoScrollFocusedItem READ autoScrollFocusItem
|
||||||
WRITE setAutoScrollFocusedItem NOTIFY autoScrollFocusedItemChanged FINAL )
|
WRITE setAutoScrollFocusedItem NOTIFY autoScrollFocusedItemChanged FINAL )
|
||||||
|
|
||||||
using Inherited = QskControl;
|
using Inherited = QskControl;
|
||||||
|
|
|
@ -73,15 +73,15 @@ class QSK_EXPORT QskShortcutMap
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
static int addFunctionT(
|
static int addFunctionT(
|
||||||
QQuickItem* item, const QKeySequence&, bool autoRepeat,
|
QQuickItem*, const QKeySequence&, bool autoRepeat,
|
||||||
const QObject* receiver, T );
|
const QObject* receiver, T );
|
||||||
|
|
||||||
static int addFunction(
|
static int addFunction(
|
||||||
QQuickItem* item, const QKeySequence&, bool autoRepeat,
|
QQuickItem*, const QKeySequence&, bool autoRepeat,
|
||||||
const QObject* receiver, const QskMetaFunction& );
|
const QObject* receiver, const QskMetaFunction& );
|
||||||
|
|
||||||
static int addMethod(
|
static int addMethod(
|
||||||
QQuickItem* item, const QKeySequence&, bool autoRepeat,
|
QQuickItem*, const QKeySequence&, bool autoRepeat,
|
||||||
const QObject* receiver, const char* );
|
const QObject* receiver, const char* );
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -385,8 +385,8 @@ void QskSkinlet::removeTraillingNodes( QSGNode* node, QSGNode* child )
|
||||||
{
|
{
|
||||||
node->removeChildNode( sibling );
|
node->removeChildNode( sibling );
|
||||||
delete sibling;
|
delete sibling;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QskSkinlet::setNodeRole( QSGNode* node, quint8 nodeRole )
|
void QskSkinlet::setNodeRole( QSGNode* node, quint8 nodeRole )
|
||||||
|
|
|
@ -452,7 +452,7 @@ bool QskSkinnable::resetHint( QskAspect::Aspect aspect )
|
||||||
|
|
||||||
if ( a.state() == QskAspect::NoState )
|
if ( a.state() == QskAspect::NoState )
|
||||||
a = a | skinState();
|
a = a | skinState();
|
||||||
|
|
||||||
const auto oldHint = storedHint( a );
|
const auto oldHint = storedHint( a );
|
||||||
|
|
||||||
m_data->hintTable.removeHint( aspect );
|
m_data->hintTable.removeHint( aspect );
|
||||||
|
@ -566,7 +566,7 @@ const QVariant& QskSkinnable::storedHint(
|
||||||
|
|
||||||
// clearing all state bits not being handled from the skin
|
// clearing all state bits not being handled from the skin
|
||||||
aspect.clearState( ~skin->stateMask() );
|
aspect.clearState( ~skin->stateMask() );
|
||||||
|
|
||||||
QskAspect::Aspect resolvedAspect;
|
QskAspect::Aspect resolvedAspect;
|
||||||
|
|
||||||
const auto& localTable = m_data->hintTable;
|
const auto& localTable = m_data->hintTable;
|
||||||
|
@ -714,7 +714,7 @@ static inline QMarginsF qskEffectivePadding( const QskSkinnable* skinnable,
|
||||||
qMax( padding.top(), paddingHint.top() ),
|
qMax( padding.top(), paddingHint.top() ),
|
||||||
qMax( padding.right(), paddingHint.right() ),
|
qMax( padding.right(), paddingHint.right() ),
|
||||||
qMax( padding.bottom(), paddingHint.bottom() )
|
qMax( padding.bottom(), paddingHint.bottom() )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMarginsF QskSkinnable::innerPadding(
|
QMarginsF QskSkinnable::innerPadding(
|
||||||
|
|
|
@ -95,7 +95,7 @@ class QSK_EXPORT QskSkinnable
|
||||||
void setBoxBorderColorsHint( QskAspect::Aspect, const QskBoxBorderColors& );
|
void setBoxBorderColorsHint( QskAspect::Aspect, const QskBoxBorderColors& );
|
||||||
QskBoxBorderColors boxBorderColorsHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
QskBoxBorderColors boxBorderColorsHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
void setIntervalHint( QskAspect::Aspect, const QskIntervalF & );
|
void setIntervalHint( QskAspect::Aspect, const QskIntervalF& );
|
||||||
QskIntervalF intervalHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
QskIntervalF intervalHint( QskAspect::Aspect, QskSkinHintStatus* = nullptr ) const;
|
||||||
|
|
||||||
void setFlagHint( QskAspect::Aspect, int flag );
|
void setFlagHint( QskAspect::Aspect, int flag );
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace
|
||||||
setFocusPolicy( Qt::NoFocus );
|
setFocusPolicy( Qt::NoFocus );
|
||||||
|
|
||||||
connect( this, &ScrollBox::scrollPosChanged,
|
connect( this, &ScrollBox::scrollPosChanged,
|
||||||
this, &QskControl::focusIndicatorRectChanged );
|
this, &QskControl::focusIndicatorRectChanged );
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF focusIndicatorClipRect() const override
|
QRectF focusIndicatorClipRect() const override
|
||||||
|
|
|
@ -31,7 +31,7 @@ QSK_QT_PRIVATE_END
|
||||||
#include <qelapsedtimer.h>
|
#include <qelapsedtimer.h>
|
||||||
#include <qloggingcategory.h>
|
#include <qloggingcategory.h>
|
||||||
Q_LOGGING_CATEGORY( logTiming, "qsk.window.timing", QtCriticalMsg )
|
Q_LOGGING_CATEGORY( logTiming, "qsk.window.timing", QtCriticalMsg )
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK( 5, 12, 0 )
|
#if QT_VERSION >= QT_VERSION_CHECK( 5, 12, 0 )
|
||||||
QSK_QT_PRIVATE_BEGIN
|
QSK_QT_PRIVATE_BEGIN
|
||||||
#include <qpa/qplatformwindow_p.h>
|
#include <qpa/qplatformwindow_p.h>
|
||||||
|
@ -358,7 +358,7 @@ bool QskWindow::event( QEvent* event )
|
||||||
{
|
{
|
||||||
const int updateTimerId = qskUpdateTimerId( this );
|
const int updateTimerId = qskUpdateTimerId( this );
|
||||||
|
|
||||||
if ( static_cast<QTimerEvent *>( event )->timerId() == updateTimerId )
|
if ( static_cast< QTimerEvent* >( event )->timerId() == updateTimerId )
|
||||||
{
|
{
|
||||||
if ( !d->renderInterval.isValid() )
|
if ( !d->renderInterval.isValid() )
|
||||||
d->renderInterval.start();
|
d->renderInterval.start();
|
||||||
|
|
|
@ -40,7 +40,7 @@ class QSK_EXPORT QskWindow : public QQuickWindow
|
||||||
~QskWindow() override;
|
~QskWindow() override;
|
||||||
|
|
||||||
using Inherited::setScreen;
|
using Inherited::setScreen;
|
||||||
void setScreen( const QString& );
|
void setScreen( const QString& );
|
||||||
|
|
||||||
bool deleteOnClose() const;
|
bool deleteOnClose() const;
|
||||||
void setDeleteOnClose( bool );
|
void setDeleteOnClose( bool );
|
||||||
|
|
Loading…
Reference in New Issue