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