playing with clang-format
This commit is contained in:
parent
68bc2f032c
commit
0a92cb82db
|
|
@ -0,0 +1,116 @@
|
|||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: LLVM
|
||||
AccessModifierOffset: -2
|
||||
AlignAfterOpenBracket: DontAlign
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlinesLeft: false
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: true
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
#AllowShortFunctionsOnASingleLine: InlineOnly
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterObjCDeclaration: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
AfterExternBlock: false
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakAfterJavaFieldAnnotations: false
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 100
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: false
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
IncludeBlocks: Preserve
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: All
|
||||
ObjCBlockIndentWidth: 2
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
RawStringFormats:
|
||||
- Delimiter: pb
|
||||
Language: TextProto
|
||||
BasedOnStyle: google
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: true
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: true
|
||||
SpacesInParentheses: true
|
||||
SpacesInSquareBrackets: true
|
||||
Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ QSK_SUBCONTROL( ButtonBar, Indicator )
|
|||
class IndicatorLabel final : public QskGraphicLabel
|
||||
{
|
||||
public:
|
||||
IndicatorLabel( QQuickItem* parentItem = nullptr ):
|
||||
QskGraphicLabel( parentItem )
|
||||
IndicatorLabel( QQuickItem* parentItem = nullptr )
|
||||
: QskGraphicLabel( parentItem )
|
||||
{
|
||||
// so the skins are able to colorize them
|
||||
setGraphicRole( SkinFactory::Indicator );
|
||||
|
|
@ -28,8 +28,8 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
ButtonBar::ButtonBar( QQuickItem* parentItem ):
|
||||
QskLinearBox( parentItem )
|
||||
ButtonBar::ButtonBar( QQuickItem* parentItem )
|
||||
: QskLinearBox( parentItem )
|
||||
{
|
||||
QColor c( Qt::black );
|
||||
c.setAlphaF( 0.5 );
|
||||
|
|
|
|||
|
|
@ -1,23 +1,23 @@
|
|||
#include "DefaultSkin.h"
|
||||
|
||||
#include "ButtonBar.h"
|
||||
#include "SkinFactory.h"
|
||||
#include "SoundControl.h"
|
||||
#include "ButtonBar.h"
|
||||
|
||||
#include "Speedometer.h"
|
||||
#include "SpeedometerSkinlet.h"
|
||||
|
||||
#include <QskBox.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskSkinTransition.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
|
@ -34,7 +34,6 @@ protected:
|
|||
class Palette
|
||||
{
|
||||
public:
|
||||
|
||||
Palette( DefaultSkin::Scheme scheme = DefaultSkin::Daylight )
|
||||
{
|
||||
if ( scheme == DefaultSkin::Daylight )
|
||||
|
|
@ -62,11 +61,10 @@ public:
|
|||
QColor color3;
|
||||
QColor color4;
|
||||
QColor color5;
|
||||
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
namespace
|
||||
{
|
||||
static inline QFont qskFont( qreal pointSize )
|
||||
{
|
||||
QFont font( "Roboto" );
|
||||
|
|
@ -76,11 +74,11 @@ namespace {
|
|||
|
||||
} // namespace
|
||||
|
||||
DefaultSkin::DefaultSkin( const QString& name, QObject* parent ):
|
||||
QskSkin( parent ),
|
||||
m_name( name ),
|
||||
m_palette( new Palette ),
|
||||
m_scheme( Daylight )
|
||||
DefaultSkin::DefaultSkin( const QString& name, QObject* parent )
|
||||
: QskSkin( parent )
|
||||
, m_name( name )
|
||||
, m_palette( new Palette )
|
||||
, m_scheme( Daylight )
|
||||
{
|
||||
setObjectName( "DefaultSkin" );
|
||||
declareSkinlet< Speedometer, SpeedometerSkinlet >();
|
||||
|
|
@ -155,8 +153,8 @@ void DefaultSkin::initHints()
|
|||
|
||||
setBoxBorderMetrics( Speedometer::NeedleHead, 2 );
|
||||
setMetric( Speedometer::NeedleHead | QskAspect::Size, 15 );
|
||||
setGradient( Speedometer::NeedleHead, QskGradient( QskGradient::Diagonal,
|
||||
m_palette->color2, m_palette->color1 ) );
|
||||
setGradient( Speedometer::NeedleHead,
|
||||
QskGradient( QskGradient::Diagonal, m_palette->color2, m_palette->color1 ) );
|
||||
// setBoxBorderColors( Speedometer::NeedleHead, m_palette->color4 );
|
||||
|
||||
setMetric( Speedometer::Needle | QskAspect::MinimumWidth, 2 );
|
||||
|
|
@ -170,7 +168,6 @@ void DefaultSkin::initHints()
|
|||
setColor( Speedometer::Labels, m_palette->color4 );
|
||||
setFontRole( Speedometer::Labels, QskSkin::SmallFont );
|
||||
|
||||
|
||||
// handle expanding, when being pressed
|
||||
for ( auto state : { QskAspect::NoState, QskSlider::Pressed } )
|
||||
{
|
||||
|
|
@ -217,4 +214,3 @@ void DefaultSkin::resetHints()
|
|||
m_palette = new Palette( m_scheme );
|
||||
initHints();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,30 +1,29 @@
|
|||
#include "OtherSkin.h"
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include "SoundControl.h"
|
||||
#include "ButtonBar.h"
|
||||
#include "SoundControl.h"
|
||||
|
||||
#include "Speedometer.h"
|
||||
#include "SpeedometerSkinlet.h"
|
||||
|
||||
#include <QskBox.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskSkinTransition.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
class Palette
|
||||
{
|
||||
public:
|
||||
|
||||
Palette()
|
||||
{
|
||||
// grey-blue-yellow:
|
||||
|
|
@ -40,24 +39,22 @@ public:
|
|||
QColor color3;
|
||||
QColor color4;
|
||||
QColor color5;
|
||||
|
||||
};
|
||||
|
||||
namespace {
|
||||
|
||||
namespace
|
||||
{
|
||||
static inline QFont qskFont( qreal pointSize )
|
||||
{
|
||||
QFont font( "Roboto" );
|
||||
font.setPointSizeF( pointSize / qskDpiScaled( 1.0 ) );
|
||||
return font;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
OtherSkin::OtherSkin( const QString& name, QObject* parent ):
|
||||
QskSkin( parent ),
|
||||
m_name( name ),
|
||||
m_palette( new Palette )
|
||||
OtherSkin::OtherSkin( const QString& name, QObject* parent )
|
||||
: QskSkin( parent )
|
||||
, m_name( name )
|
||||
, m_palette( new Palette )
|
||||
{
|
||||
setObjectName( "OtherSkin" );
|
||||
declareSkinlet< Speedometer, SpeedometerSkinlet >();
|
||||
|
|
@ -144,8 +141,8 @@ void OtherSkin::initHints()
|
|||
// -- speedometers
|
||||
|
||||
setBoxBorderMetrics( Speedometer::Panel, 5 );
|
||||
setGradient( Speedometer::Panel, QskGradient( QskGradient::Vertical,
|
||||
m_palette->color2, m_palette->color4 ) );
|
||||
setGradient( Speedometer::Panel,
|
||||
QskGradient( QskGradient::Vertical, m_palette->color2, m_palette->color4 ) );
|
||||
setBoxBorderColors( Speedometer::Panel, m_palette->color3 );
|
||||
|
||||
setBoxBorderMetrics( Speedometer::NeedleHead, 5 );
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
#include "SoundControl.h"
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include <QskBox.h>
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskGridBox.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskNamespace.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskBox.h>
|
||||
#include <QskNamespace.h>
|
||||
|
||||
QSK_SUBCONTROL( SoundControl, Overlay )
|
||||
QSK_SUBCONTROL( SoundControl, CrossHair )
|
||||
|
|
@ -23,8 +23,8 @@ QSK_SUBCONTROL( SoundControl, SliderControl )
|
|||
class VehicleLabel final : public QskGraphicLabel
|
||||
{
|
||||
public:
|
||||
VehicleLabel( QQuickItem* parentItem = nullptr ):
|
||||
QskGraphicLabel( parentItem )
|
||||
VehicleLabel( QQuickItem* parentItem = nullptr )
|
||||
: QskGraphicLabel( parentItem )
|
||||
{
|
||||
setGraphic( QskGraphicIO::read( QString( ":/qvg/car.qvg" ) ) );
|
||||
}
|
||||
|
|
@ -44,8 +44,8 @@ public:
|
|||
class CrossHairLine final : public QskBox
|
||||
{
|
||||
public:
|
||||
CrossHairLine( QQuickItem* parent ):
|
||||
QskBox( parent )
|
||||
CrossHairLine( QQuickItem* parent )
|
||||
: QskBox( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ public:
|
|||
class BalanceFadeMarker final : public QskBox
|
||||
{
|
||||
public:
|
||||
BalanceFadeMarker( QQuickItem* parent ):
|
||||
QskBox( parent )
|
||||
BalanceFadeMarker( QQuickItem* parent )
|
||||
: QskBox( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -80,9 +80,9 @@ public:
|
|||
class MarkerControlButton final : public QskPushButton
|
||||
{
|
||||
public:
|
||||
MarkerControlButton( Qsk::Direction direction, QQuickItem* parentItem = nullptr ):
|
||||
QskPushButton( parentItem ),
|
||||
m_direction( direction )
|
||||
MarkerControlButton( Qsk::Direction direction, QQuickItem* parentItem = nullptr )
|
||||
: QskPushButton( parentItem )
|
||||
, m_direction( direction )
|
||||
{
|
||||
const char* svgList[] = { "right", "left", "down", "up" };
|
||||
|
||||
|
|
@ -144,8 +144,8 @@ private:
|
|||
class ControlButton final : public QskPushButton
|
||||
{
|
||||
public:
|
||||
ControlButton( const char symbol, QQuickItem* parentItem = nullptr ):
|
||||
QskPushButton( parentItem )
|
||||
ControlButton( const char symbol, QQuickItem* parentItem = nullptr )
|
||||
: QskPushButton( parentItem )
|
||||
{
|
||||
setText( QChar( symbol ) );
|
||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
|
|
@ -172,9 +172,9 @@ public:
|
|||
class StackedControl final : public QskControl
|
||||
{
|
||||
public:
|
||||
StackedControl( QQuickItem* parent = nullptr ):
|
||||
QskControl( parent ),
|
||||
m_offset( 0.0, 0.0 )
|
||||
StackedControl( QQuickItem* parent = nullptr )
|
||||
: QskControl( parent )
|
||||
, m_offset( 0.0, 0.0 )
|
||||
{
|
||||
setPolishOnResize( true ); // we have t re-layout the crosshair
|
||||
setSizePolicy( QskSizePolicy::Expanding, QskSizePolicy::Expanding );
|
||||
|
|
@ -245,8 +245,8 @@ private:
|
|||
class SectionTitleBar final : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
SectionTitleBar( const char* title, QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, parentItem )
|
||||
SectionTitleBar( const char* title, QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, parentItem )
|
||||
{
|
||||
setSpacing( 10 );
|
||||
|
||||
|
|
@ -265,8 +265,8 @@ public:
|
|||
class SliderBox final : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
SliderBox( const char* title, qreal min, qreal max, QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Vertical, parentItem )
|
||||
SliderBox( const char* title, qreal min, qreal max, QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Vertical, parentItem )
|
||||
{
|
||||
auto label = new QskTextLabel( title );
|
||||
m_numberLabel = new QskTextLabel();
|
||||
|
|
@ -331,8 +331,8 @@ private:
|
|||
class ToneControlBox final : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
ToneControlBox( QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, parentItem )
|
||||
ToneControlBox( QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, parentItem )
|
||||
{
|
||||
auto bassControl = new SliderBox( "Bass", 0.0, 40.0, this );
|
||||
auto treebleControl = new SliderBox( "Treeble", 0.0, 40.0, this );
|
||||
|
|
@ -347,8 +347,8 @@ public:
|
|||
class BalanceFadeControlBox final : public QskGridBox
|
||||
{
|
||||
public:
|
||||
BalanceFadeControlBox( QQuickItem* parentItem = nullptr ):
|
||||
QskGridBox( parentItem )
|
||||
BalanceFadeControlBox( QQuickItem* parentItem = nullptr )
|
||||
: QskGridBox( parentItem )
|
||||
{
|
||||
MarkerControlButton* buttons[ 4 ];
|
||||
for ( int i = 0; i < 4; i++ )
|
||||
|
|
@ -382,8 +382,8 @@ public:
|
|||
StackedControl* m_carControl;
|
||||
};
|
||||
|
||||
SoundControl::SoundControl( QQuickItem* parent ):
|
||||
QskBox( parent )
|
||||
SoundControl::SoundControl( QQuickItem* parent )
|
||||
: QskBox( parent )
|
||||
{
|
||||
setAutoLayoutChildren( true );
|
||||
|
||||
|
|
@ -409,4 +409,3 @@ QskAspect::Subcontrol SoundControl::effectiveSubcontrol(
|
|||
|
||||
return subControl;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@ QSK_SUBCONTROL( Speedometer, Labels )
|
|||
QSK_SUBCONTROL( Speedometer, NeedleHead )
|
||||
QSK_SUBCONTROL( Speedometer, Needle )
|
||||
|
||||
Speedometer::Speedometer( QQuickItem* parent ) :
|
||||
QskRangeControl( parent )
|
||||
Speedometer::Speedometer( QQuickItem* parent )
|
||||
: QskRangeControl( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,15 +10,15 @@
|
|||
#include <QTimer>
|
||||
#include <QtGlobal>
|
||||
|
||||
SpeedometerDisplay::SpeedometerDisplay( QQuickItem *parent ) :
|
||||
QskControl( parent ),
|
||||
m_box( new QskLinearBox( Qt::Horizontal, this ) ),
|
||||
m_revCounter( new Speedometer( m_box ) ),
|
||||
m_revCounterText( new QskTextLabel( QStringLiteral( "x 1000 min^-1" ), m_revCounter ) ),
|
||||
m_speedometer( new Speedometer( m_box ) ),
|
||||
m_speedometerText( new QskTextLabel( QStringLiteral( "km/h" ), m_speedometer ) ),
|
||||
m_fuelGauge( new Speedometer( m_box ) ),
|
||||
m_fuelGaugeText( new QskTextLabel( QStringLiteral( "fuel" ), m_fuelGauge ) )
|
||||
SpeedometerDisplay::SpeedometerDisplay( QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
, m_box( new QskLinearBox( Qt::Horizontal, this ) )
|
||||
, m_revCounter( new Speedometer( m_box ) )
|
||||
, m_revCounterText( new QskTextLabel( QStringLiteral( "x 1000 min^-1" ), m_revCounter ) )
|
||||
, m_speedometer( new Speedometer( m_box ) )
|
||||
, m_speedometerText( new QskTextLabel( QStringLiteral( "km/h" ), m_speedometer ) )
|
||||
, m_fuelGauge( new Speedometer( m_box ) )
|
||||
, m_fuelGaugeText( new QskTextLabel( QStringLiteral( "fuel" ), m_fuelGauge ) )
|
||||
{
|
||||
qsrand( static_cast< uint >( QTime::currentTime().msec() ) );
|
||||
|
||||
|
|
@ -72,7 +72,6 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem *parent ) :
|
|||
timer->setInterval( 16 );
|
||||
timer->start();
|
||||
|
||||
|
||||
m_fuelGauge->setObjectName( QStringLiteral( "Fuel Gauge" ) );
|
||||
m_fuelGauge->setMinimum( 195 );
|
||||
m_fuelGauge->setMaximum( 345 );
|
||||
|
|
@ -83,7 +82,6 @@ SpeedometerDisplay::SpeedometerDisplay( QQuickItem *parent ) :
|
|||
|
||||
m_fuelGauge->setLabels( fuelGaugeLabels );
|
||||
|
||||
|
||||
m_revCounterText->setMargins( 50 );
|
||||
m_speedometerText->setMargins( 50 );
|
||||
m_fuelGaugeText->setMargins( 50 );
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ namespace
|
|||
class TicksNode : public QSGGeometryNode
|
||||
{
|
||||
public:
|
||||
TicksNode():
|
||||
m_geometry( QSGGeometry::defaultAttributes_Point2D(), 0 )
|
||||
TicksNode()
|
||||
: m_geometry( QSGGeometry::defaultAttributes_Point2D(), 0 )
|
||||
{
|
||||
m_geometry.setDrawingMode( GL_LINES );
|
||||
m_geometry.setVertexDataPattern( QSGGeometry::StaticPattern );
|
||||
|
|
@ -39,16 +39,16 @@ namespace
|
|||
};
|
||||
} // namespace
|
||||
|
||||
SpeedometerSkinlet::SpeedometerSkinlet( QskSkin* skin ) :
|
||||
QskSkinlet( skin )
|
||||
SpeedometerSkinlet::SpeedometerSkinlet( QskSkin* skin )
|
||||
: QskSkinlet( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole, LabelsRole, NeedleRole } );
|
||||
}
|
||||
|
||||
SpeedometerSkinlet::~SpeedometerSkinlet() = default;
|
||||
|
||||
QRectF SpeedometerSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
QskAspect::Subcontrol /*unused*/ ) const
|
||||
QRectF SpeedometerSkinlet::subControlRect(
|
||||
const QskSkinnable* skinnable, QskAspect::Subcontrol ) const
|
||||
{
|
||||
const auto speedometer = static_cast< const Speedometer* >( skinnable );
|
||||
|
||||
|
|
@ -56,8 +56,8 @@ QRectF SpeedometerSkinlet::subControlRect( const QskSkinnable* skinnable,
|
|||
return speedometer->contentsRect();
|
||||
}
|
||||
|
||||
QSGNode* SpeedometerSkinlet::updateSubNode( const QskSkinnable* skinnable, quint8 nodeRole,
|
||||
QSGNode* node ) const
|
||||
QSGNode* SpeedometerSkinlet::updateSubNode(
|
||||
const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const
|
||||
{
|
||||
const auto speedometer = static_cast< const Speedometer* >( skinnable );
|
||||
|
||||
|
|
@ -187,9 +187,8 @@ QSGNode* SpeedometerSkinlet::updateLabelsNode( const Speedometer* speedometer, Q
|
|||
}
|
||||
|
||||
QFont font = speedometer->effectiveFont( Speedometer::Labels );
|
||||
numbersNode->setTextData( speedometer, text, numbersRect, font,
|
||||
QskTextOptions(), QskTextColors( color ),
|
||||
Qt::AlignCenter | Qt::AlignHCenter, Qsk::Normal );
|
||||
numbersNode->setTextData( speedometer, text, numbersRect, font, QskTextOptions(),
|
||||
QskTextColors( color ), Qt::AlignCenter | Qt::AlignHCenter, Qsk::Normal );
|
||||
|
||||
if ( ticksNode->childCount() <= i )
|
||||
{
|
||||
|
|
@ -237,8 +236,7 @@ QSGNode* SpeedometerSkinlet::updateNeedleNode(
|
|||
QskBoxBorderMetrics borderMetrics = speedometer->boxBorderMetricsHint( Speedometer::NeedleHead );
|
||||
QskBoxBorderColors borderColors = speedometer->boxBorderColorsHint( Speedometer::NeedleHead );
|
||||
QskGradient gradient = speedometer->gradientHint( Speedometer::NeedleHead );
|
||||
QRectF centerNodeRect( center.x() - radius, center.y() - radius,
|
||||
2 * radius, 2 * radius );
|
||||
QRectF centerNodeRect( center.x() - radius, center.y() - radius, 2 * radius, 2 * radius );
|
||||
boxNode->setBoxData( centerNodeRect, shapeMetrics, borderMetrics, borderColors, gradient );
|
||||
|
||||
QColor color = speedometer->color( Speedometer::Needle );
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ class SpeedometerSkinlet : public QskSkinlet
|
|||
Q_GADGET
|
||||
|
||||
public:
|
||||
|
||||
enum NodeRole
|
||||
{
|
||||
PanelRole,
|
||||
|
|
@ -25,7 +24,8 @@ public:
|
|||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
protected:
|
||||
virtual QSGNode* updateSubNode( const QskSkinnable* skinnable, quint8 nodeRole, QSGNode* node ) const override;
|
||||
virtual QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* node ) const override;
|
||||
|
||||
private:
|
||||
QSGNode* updatePanelNode( const Speedometer*, QSGNode* ) const;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#include "MainWindow.h"
|
||||
#include "SkinFactory.h"
|
||||
|
||||
#include <QskSetup.h>
|
||||
#include <QskShortcutMap.h>
|
||||
#include <QskSkinManager.h>
|
||||
#include <QskSetup.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
#include "Box.h"
|
||||
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
|
||||
Box::Box( QQuickItem* parentItem ):
|
||||
QskBox( parentItem )
|
||||
Box::Box( QQuickItem* parentItem )
|
||||
: QskBox( parentItem )
|
||||
{
|
||||
setSizePolicy( QskSizePolicy::Ignored, QskSizePolicy::Ignored );
|
||||
|
||||
|
|
@ -102,8 +102,7 @@ void Box::setShape( const QskBoxShapeMetrics& shape )
|
|||
|
||||
void Box::setShape( qreal radius, Qt::SizeMode sizeMode )
|
||||
{
|
||||
setBoxShapeHint( QskBox::Panel,
|
||||
QskBoxShapeMetrics( radius, sizeMode ) );
|
||||
setBoxShapeHint( QskBox::Panel, QskBoxShapeMetrics( radius, sizeMode ) );
|
||||
}
|
||||
|
||||
void Box::setShape( qreal radiusX, qreal radiusY, Qt::SizeMode sizeMode )
|
||||
|
|
@ -179,8 +178,7 @@ void Box::setGradient(
|
|||
|
||||
QVector< QskGradientStop > stops;
|
||||
|
||||
stops += QskGradientStop(
|
||||
0.0, pal.color( static_cast<Palette::Weight>( 0 ) ) );
|
||||
stops += QskGradientStop( 0.0, pal.color( static_cast< Palette::Weight >( 0 ) ) );
|
||||
|
||||
const int count = Palette::NumWeights - 1;
|
||||
for ( int i = 1; i < count; i++ )
|
||||
|
|
@ -197,4 +195,3 @@ void Box::setGradient(
|
|||
|
||||
setGradient( QskGradient( orientation, stops ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,4 +51,3 @@ Palette Palette::palette( Color color )
|
|||
{
|
||||
return StandardPalette( static_cast< int >( color ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,6 @@ public:
|
|||
|
||||
protected:
|
||||
QRgb* m_rgb;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -12,9 +12,9 @@
|
|||
#include <QskTabView.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskRgbValue.h>
|
||||
|
||||
|
|
@ -25,8 +25,8 @@
|
|||
class Rectangle : public Box
|
||||
{
|
||||
public:
|
||||
Rectangle( QQuickItem* parentItem ):
|
||||
Box( parentItem )
|
||||
Rectangle( QQuickItem* parentItem )
|
||||
: Box( parentItem )
|
||||
{
|
||||
}
|
||||
};
|
||||
|
|
@ -34,8 +34,8 @@ public:
|
|||
class RoundedRectangle : public Box
|
||||
{
|
||||
public:
|
||||
RoundedRectangle( QQuickItem* parentItem ):
|
||||
Box( parentItem )
|
||||
RoundedRectangle( QQuickItem* parentItem )
|
||||
: Box( parentItem )
|
||||
{
|
||||
setShape( 20, Qt::AbsoluteSize );
|
||||
}
|
||||
|
|
@ -44,8 +44,8 @@ public:
|
|||
class Ellipse : public Box
|
||||
{
|
||||
public:
|
||||
Ellipse( QQuickItem* parentItem ):
|
||||
Box( parentItem )
|
||||
Ellipse( QQuickItem* parentItem )
|
||||
: Box( parentItem )
|
||||
{
|
||||
setShape( 100, Qt::RelativeSize );
|
||||
}
|
||||
|
|
@ -362,8 +362,8 @@ static void addRectanglesRest( QskLinearBox* parent )
|
|||
class TabView : public QskTabView
|
||||
{
|
||||
public:
|
||||
TabView( QQuickItem* parentItem = nullptr ):
|
||||
QskTabView( Qt::Vertical, parentItem )
|
||||
TabView( QQuickItem* parentItem = nullptr )
|
||||
: QskTabView( Qt::Vertical, parentItem )
|
||||
{
|
||||
setMargins( 10 );
|
||||
|
||||
|
|
@ -421,8 +421,7 @@ int main( int argc, char* argv[] )
|
|||
QGuiApplication app( argc, argv );
|
||||
|
||||
SkinnyFont::init( &app );
|
||||
SkinnyShortcut::enable( SkinnyShortcut::Quit |
|
||||
SkinnyShortcut::DebugShortcuts );
|
||||
SkinnyShortcut::enable( SkinnyShortcut::Quit | SkinnyShortcut::DebugShortcuts );
|
||||
|
||||
auto* tabView = new TabView();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,15 +3,15 @@
|
|||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include <SkinnyShapeProvider.h>
|
||||
#include <SkinnyFont.h>
|
||||
#include <SkinnyShapeProvider.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
#include "Theme.h"
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskListView.h>
|
||||
#include <QskSetup.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskSkinTransition.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskListView.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
|
||||
static void qskResetColors( QskSkin* skin, const QColor& accent )
|
||||
{
|
||||
|
|
@ -31,8 +31,8 @@ namespace
|
|||
class SkinTransition final : public QskSkinTransition
|
||||
{
|
||||
public:
|
||||
SkinTransition( const QColor& accent ):
|
||||
m_accent( accent )
|
||||
SkinTransition( const QColor& accent )
|
||||
: m_accent( accent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -47,9 +47,9 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
Theme::Theme( QObject* parent ):
|
||||
QObject( parent ),
|
||||
m_accent( qskSetup->skin()->color( QskAspect::Color ) )
|
||||
Theme::Theme( QObject* parent )
|
||||
: QObject( parent )
|
||||
, m_accent( qskSetup->skin()->color( QskAspect::Color ) )
|
||||
{
|
||||
connect( qskSetup, &QskSetup::skinChanged,
|
||||
this, [ this ]( QskSkin* ) { updateColors(); } );
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#ifndef THEME_H
|
||||
#define THEME_H 1
|
||||
|
||||
#include <QObject>
|
||||
#include <QColor>
|
||||
#include <QObject>
|
||||
|
||||
class Theme : public QObject
|
||||
{
|
||||
|
|
|
|||
|
|
@ -11,9 +11,9 @@
|
|||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QtQml>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QtQml>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,27 +3,27 @@
|
|||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include <SkinnyShortcut.h>
|
||||
#include <SkinnyShapeProvider.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskShortcutMap.h>
|
||||
#include <QskSubWindow.h>
|
||||
#include <QskSubWindowArea.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskShortcutMap.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QGuiApplication>
|
||||
#include <QKeySequence>
|
||||
#include <QDebug>
|
||||
|
||||
class SubWindow : public QskSubWindow
|
||||
{
|
||||
public:
|
||||
SubWindow( const QString& graphicSource, QQuickItem* parent = nullptr ):
|
||||
QskSubWindow( parent )
|
||||
SubWindow( const QString& graphicSource, QQuickItem* parent = nullptr )
|
||||
: QskSubWindow( parent )
|
||||
{
|
||||
setObjectName( graphicSource );
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ public:
|
|||
QskSizePolicy::MinimumExpanding );
|
||||
|
||||
QskShortcutMap::addShortcut( this, QKeySequence( Qt::Key_P ), true,
|
||||
[=] { qDebug() << graphicSource; } );
|
||||
[ graphicSource ] { qDebug() << graphicSource; } );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ int main( int argc, char* argv[] )
|
|||
{
|
||||
const qreal off = ( i + 1 ) * 100;
|
||||
|
||||
SubWindow* subWindow = new SubWindow( url + shapes[i], area );
|
||||
auto subWindow = new SubWindow( url + shapes[ i ], area );
|
||||
subWindow->setGeometry( windowRect.translated( off, off ) );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,14 @@
|
|||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskPushButton.h>
|
||||
#include "Window.h"
|
||||
|
||||
Window::Window( Qt::Orientation orientation ):
|
||||
m_orientation( orientation )
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskPushButton.h>
|
||||
|
||||
Window::Window( Qt::Orientation orientation )
|
||||
: m_orientation( orientation )
|
||||
{
|
||||
m_layoutBox = new QskLinearBox( invertedOrientation() );
|
||||
m_layoutBox->setObjectName( "MainBox" );
|
||||
|
|
@ -17,10 +18,14 @@ Window::Window( Qt::Orientation orientation ):
|
|||
m_layoutBox->setExtraSpacingAt( Qt::BottomEdge | Qt::RightEdge );
|
||||
|
||||
addBox( QskDialog::Ok );
|
||||
|
||||
addBox( QskDialog::StandardButtons( QskDialog::Ok | QskDialog::Cancel ) );
|
||||
|
||||
addBox( QskDialog::StandardButtons( QskDialog::Yes | QskDialog::No ) );
|
||||
|
||||
addBox( QskDialog::StandardButtons( QskDialog::Save | QskDialog::Discard
|
||||
| QskDialog::RestoreDefaults | QskDialog::Help ) );
|
||||
|
||||
addBox( QskDialog::StandardButtons( QskDialog::Abort
|
||||
| QskDialog::Retry | QskDialog::Ignore ) );
|
||||
|
||||
|
|
@ -90,8 +95,7 @@ QVector< QskDialogButtonBox* > Window::dialogBoxes() const
|
|||
QVector< QskDialogButtonBox* > boxes;
|
||||
for ( int i = 0; i < m_layoutBox->itemCount(); i++ )
|
||||
{
|
||||
if ( QskDialogButtonBox* box =
|
||||
qobject_cast< QskDialogButtonBox* >( m_layoutBox->itemAtIndex( i ) ) )
|
||||
if ( auto box = qobject_cast< QskDialogButtonBox* >( m_layoutBox->itemAtIndex( i ) ) )
|
||||
{
|
||||
boxes += box;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#ifndef WINDOW_H
|
||||
#define WINDOW_H 1
|
||||
|
||||
#include <QskWindow.h>
|
||||
#include <QskDialog.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
class QskDialogButtonBox;
|
||||
class QskLinearBox;
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#include "Frame.h"
|
||||
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxNode.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskSkinlet.h>
|
||||
|
||||
static inline qreal effectiveRadius( const QRectF& rect, qreal percentage )
|
||||
|
|
@ -17,12 +17,12 @@ static inline qreal effectiveRadius( const QRectF& rect, qreal percentage )
|
|||
return percentage / 100.0 * 0.5 * qMin( rect.width(), rect.height() );
|
||||
}
|
||||
|
||||
Frame::Frame( QQuickItem* parent ):
|
||||
Inherited( parent ),
|
||||
m_style( Frame::Plain ),
|
||||
m_color( Qt::gray ),
|
||||
m_frameWidth( 1.0 ),
|
||||
m_radius( 0.0 )
|
||||
Frame::Frame( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
, m_style( Frame::Plain )
|
||||
, m_color( Qt::gray )
|
||||
, m_frameWidth( 1.0 )
|
||||
, m_radius( 0.0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,14 +9,13 @@
|
|||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicTextureFactory.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QElapsedTimer>
|
||||
#include <QPainter>
|
||||
#include <QQuickWindow>
|
||||
#include <QStringList>
|
||||
#include <QSvgRenderer>
|
||||
#include <QSvgRenderer>
|
||||
#include <QDebug>
|
||||
#include <QElapsedTimer>
|
||||
#include <QQuickWindow>
|
||||
#include <QPainter>
|
||||
|
||||
bool Benchmark::run( const QString& dirName )
|
||||
{
|
||||
|
|
@ -78,7 +77,6 @@ bool Benchmark::run( const QString& dirName )
|
|||
painter.end();
|
||||
}
|
||||
|
||||
|
||||
msElapsed[ 1 ] = timer.elapsed();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,18 +5,18 @@
|
|||
|
||||
#include "Benchmark.h"
|
||||
|
||||
#include <QskWindow.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QCommandLineParser>
|
||||
#include <QGuiApplication>
|
||||
|
||||
class Button : public QskPushButton
|
||||
{
|
||||
public:
|
||||
Button( const QString& testDir ):
|
||||
m_testDir( testDir )
|
||||
Button( const QString& testDir )
|
||||
: m_testDir( testDir )
|
||||
{
|
||||
setText( QString( "Run: " ) + testDir );
|
||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
|
|
@ -47,8 +47,7 @@ int main( int argc, char* argv[] )
|
|||
if ( args.count() != 1 )
|
||||
parser.showHelp( 1 );
|
||||
|
||||
|
||||
Button* button = new Button( args[0] );
|
||||
auto button = new Button( args[ 0 ] );
|
||||
QObject::connect( button, &Button::clicked, button, &Button::run );
|
||||
|
||||
auto box = new QskLinearBox();
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,15 +6,15 @@
|
|||
#include "ButtonBox.h"
|
||||
#include <QskPushButton.h>
|
||||
|
||||
ButtonBox::ButtonBox( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Horizontal, parent )
|
||||
ButtonBox::ButtonBox( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setObjectName( "ButtonBox" );
|
||||
setSizePolicy( QskSizePolicy::Fixed, QskSizePolicy::Fixed );
|
||||
}
|
||||
|
||||
void ButtonBox::addButton( const QString& text,
|
||||
std::function< void() > func, bool autoRepeat )
|
||||
void ButtonBox::addButton(
|
||||
const QString& text, std::function< void() > func, bool autoRepeat )
|
||||
{
|
||||
QskPushButton* button = new QskPushButton( text );
|
||||
button->setAutoRepeat( autoRepeat );
|
||||
|
|
|
|||
|
|
@ -40,9 +40,9 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
Control::Control( const char* colorName, QQuickItem* parent ):
|
||||
QskControl( parent ),
|
||||
m_aspectRatio( 1.0 )
|
||||
Control::Control( const char* colorName, QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
, m_aspectRatio( 1.0 )
|
||||
{
|
||||
setObjectName( colorName );
|
||||
|
||||
|
|
@ -52,9 +52,9 @@ Control::Control( const char* colorName, QQuickItem* parent ):
|
|||
setPreferredSize( 80, 100 );
|
||||
}
|
||||
|
||||
Control::Control( const char* colorName, qreal aspectRatio, QQuickItem* parent ):
|
||||
QskControl( parent ),
|
||||
m_aspectRatio( aspectRatio )
|
||||
Control::Control( const char* colorName, qreal aspectRatio, QQuickItem* parent )
|
||||
: QskControl( parent )
|
||||
, m_aspectRatio( aspectRatio )
|
||||
{
|
||||
setObjectName( colorName );
|
||||
|
||||
|
|
@ -83,8 +83,8 @@ void Control::transpose()
|
|||
setSizePolicy( sizePolicy().verticalPolicy(), sizePolicy().horizontalPolicy() );
|
||||
}
|
||||
|
||||
Box::Box( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Horizontal, 2, parent )
|
||||
Box::Box( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Horizontal, 2, parent )
|
||||
{
|
||||
setObjectName( "Box" );
|
||||
|
||||
|
|
@ -122,8 +122,8 @@ void Box::addControl( Control* control )
|
|||
addItem( control, Qt::AlignCenter );
|
||||
}
|
||||
|
||||
DynamicConstraintsPage::DynamicConstraintsPage( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Vertical, parent )
|
||||
DynamicConstraintsPage::DynamicConstraintsPage( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setMargins( 10 );
|
||||
setBackgroundColor( QskRgbValue::LightSteelBlue );
|
||||
|
|
|
|||
|
|
@ -4,21 +4,21 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "FlowLayoutPage.h"
|
||||
#include "TestRectangle.h"
|
||||
#include "ButtonBox.h"
|
||||
#include "TestRectangle.h"
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
class Box : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
Box( QQuickItem* parent = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, 5, parent )
|
||||
Box( QQuickItem* parent = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, 5, parent )
|
||||
{
|
||||
setObjectName( "Box" );
|
||||
|
||||
|
|
@ -82,8 +82,8 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
FlowLayoutPage::FlowLayoutPage( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Vertical, parent )
|
||||
FlowLayoutPage::FlowLayoutPage( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setMargins( 10 );
|
||||
setBackgroundColor( QskRgbValue::LightSteelBlue );
|
||||
|
|
|
|||
|
|
@ -4,8 +4,8 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "LinearLayoutPage.h"
|
||||
#include "TestRectangle.h"
|
||||
#include "ButtonBox.h"
|
||||
#include "TestRectangle.h"
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskLinearBox.h>
|
||||
|
|
@ -16,8 +16,8 @@ namespace
|
|||
class Box : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
Box( QQuickItem* parent = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, parent )
|
||||
Box( QQuickItem* parent = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, parent )
|
||||
{
|
||||
setObjectName( "Box" );
|
||||
|
||||
|
|
@ -70,7 +70,6 @@ namespace
|
|||
}
|
||||
|
||||
private:
|
||||
|
||||
void addRectangle( const char* colorName )
|
||||
{
|
||||
TestRectangle* rect = new TestRectangle( colorName );
|
||||
|
|
@ -81,8 +80,8 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
LinearLayoutPage::LinearLayoutPage( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Vertical, parent )
|
||||
LinearLayoutPage::LinearLayoutPage( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setMargins( 10 );
|
||||
setBackgroundColor( QskRgbValue::LightSteelBlue );
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "StackLayoutPage.h"
|
||||
#include "TestRectangle.h"
|
||||
#include "ButtonBox.h"
|
||||
#include "TestRectangle.h"
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskPageIndicator.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskStackBox.h>
|
||||
#include <QskStackBoxAnimator.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskTextLabel.h>
|
||||
|
||||
namespace
|
||||
{
|
||||
class Box : public QskStackBox
|
||||
{
|
||||
public:
|
||||
Box( QQuickItem* parent = nullptr ):
|
||||
QskStackBox( parent )
|
||||
Box( QQuickItem* parent = nullptr )
|
||||
: QskStackBox( parent )
|
||||
{
|
||||
setObjectName( "StackBox" );
|
||||
|
||||
|
|
@ -96,8 +96,8 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
StackLayoutPage::StackLayoutPage( QQuickItem* parent ):
|
||||
QskLinearBox( Qt::Vertical, parent )
|
||||
StackLayoutPage::StackLayoutPage( QQuickItem* parent )
|
||||
: QskLinearBox( Qt::Vertical, parent )
|
||||
{
|
||||
setObjectName( "StackLayoutPage" );
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
#include <QskAspect.h>
|
||||
|
||||
TestRectangle::TestRectangle( const char* colorName, QQuickItem* parent ):
|
||||
QskTextLabel( parent )
|
||||
TestRectangle::TestRectangle( const char* colorName, QQuickItem* parent )
|
||||
: QskTextLabel( parent )
|
||||
{
|
||||
setObjectName( colorName );
|
||||
|
||||
|
|
|
|||
|
|
@ -3,31 +3,31 @@
|
|||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include "DynamicConstraintsPage.h"
|
||||
#include "FlowLayoutPage.h"
|
||||
#include "LinearLayoutPage.h"
|
||||
#include "DynamicConstraintsPage.h"
|
||||
#include "StackLayoutPage.h"
|
||||
|
||||
#include <SkinnyFont.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskTextOptions.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
class DummyLabel : public QskTextLabel
|
||||
{
|
||||
public:
|
||||
DummyLabel( const QString& text, QQuickItem* parent = nullptr ):
|
||||
QskTextLabel( text, parent )
|
||||
DummyLabel( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
setBackgroundColor( Qt::black );
|
||||
setTextColor( Qt::white );
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
#include <SkinnyFont.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskSimpleListBox.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskAspect.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QFontMetricsF>
|
||||
#include <QGuiApplication>
|
||||
|
||||
class ListBox : public QskSimpleListBox
|
||||
{
|
||||
|
|
@ -31,6 +31,7 @@ public:
|
|||
|
||||
setSelectedRow( 5 );
|
||||
}
|
||||
|
||||
private:
|
||||
void populate()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,23 +6,23 @@
|
|||
#include <SkinnyFont.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QFontDatabase>
|
||||
#include <QGuiApplication>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskDialog.h>
|
||||
#include <QskStandardSymbol.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskStandardSymbol.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
class Button : public QskPushButton
|
||||
{
|
||||
public:
|
||||
Button( const QString& text, QQuickItem* parent = nullptr ):
|
||||
QskPushButton( text, parent )
|
||||
Button( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskPushButton( text, parent )
|
||||
{
|
||||
setObjectName( text );
|
||||
setSizePolicy( QskSizePolicy::MinimumExpanding,
|
||||
|
|
@ -33,8 +33,8 @@ public:
|
|||
class ButtonBox : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
ButtonBox( QQuickItem* parent = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, 2, parent )
|
||||
ButtonBox( QQuickItem* parent = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, 2, parent )
|
||||
{
|
||||
setObjectName( "ButtonBox" );
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,19 +5,19 @@
|
|||
|
||||
#include "MainWindow.h"
|
||||
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskColorFilter.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskGraphic.h>
|
||||
#include <QskGraphicIO.h>
|
||||
#include <QskGraphicLabel.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskSetup.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskTabView.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QVariant>
|
||||
|
|
@ -31,8 +31,8 @@ public:
|
|||
Inverted
|
||||
};
|
||||
|
||||
GraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr ):
|
||||
QskGraphicLabel( graphic, parent )
|
||||
GraphicLabel( const QskGraphic& graphic, QQuickItem* parent = nullptr )
|
||||
: QskGraphicLabel( graphic, parent )
|
||||
{
|
||||
setAlignment( Qt::AlignCenter );
|
||||
setAutoFillBackground( true );
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
#include "Slider.h"
|
||||
#include "SliderSkinlet.h"
|
||||
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskRgbValue.h>
|
||||
|
||||
QSK_SUBCONTROL( Slider, Scale )
|
||||
QSK_SUBCONTROL( Slider, Decoration )
|
||||
|
||||
Slider::Slider( QQuickItem* parentItem ):
|
||||
QskSlider( parentItem )
|
||||
Slider::Slider( QQuickItem* parentItem )
|
||||
: QskSlider( parentItem )
|
||||
{
|
||||
using namespace QskAspect;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@
|
|||
#include "Slider.h"
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTextColors.h>
|
||||
#include <QskTextNode.h>
|
||||
#include <QskTextOptions.h>
|
||||
#include <QskTextColors.h>
|
||||
|
||||
#include <QSGFlatColorMaterial>
|
||||
#include <QFontMetricsF>
|
||||
#include <QSGFlatColorMaterial>
|
||||
|
||||
#include <cmath>
|
||||
|
||||
|
|
@ -31,8 +31,8 @@ static QFont qskLabelFont;
|
|||
class TicksNode : public QSGGeometryNode
|
||||
{
|
||||
public:
|
||||
TicksNode( const QColor& color ):
|
||||
m_geometry( QSGGeometry::defaultAttributes_Point2D(), 0 )
|
||||
TicksNode( const QColor& color )
|
||||
: m_geometry( QSGGeometry::defaultAttributes_Point2D(), 0 )
|
||||
{
|
||||
m_geometry.setDrawingMode( GL_LINES );
|
||||
m_geometry.setVertexDataPattern( QSGGeometry::StaticPattern );
|
||||
|
|
@ -51,8 +51,8 @@ private:
|
|||
class HandleNode : public QSGGeometryNode
|
||||
{
|
||||
public:
|
||||
HandleNode():
|
||||
m_geometry( QSGGeometry::defaultAttributes_Point2D(), 8 * 2 )
|
||||
HandleNode()
|
||||
: m_geometry( QSGGeometry::defaultAttributes_Point2D(), 8 * 2 )
|
||||
{
|
||||
setGeometry( &m_geometry );
|
||||
setMaterial( &m_material );
|
||||
|
|
@ -121,8 +121,8 @@ SliderSkinlet::~SliderSkinlet()
|
|||
{
|
||||
}
|
||||
|
||||
QRectF SliderSkinlet::subControlRect( const QskSkinnable* skinnable,
|
||||
QskAspect::Subcontrol subControl ) const
|
||||
QRectF SliderSkinlet::subControlRect(
|
||||
const QskSkinnable* skinnable, QskAspect::Subcontrol subControl ) const
|
||||
{
|
||||
const auto slider = static_cast< const QskSlider* >( skinnable );
|
||||
|
||||
|
|
@ -349,9 +349,8 @@ QSGNode* SliderSkinlet::updateHandleNode(
|
|||
|
||||
const QString text = QString::number( slider->value(), 'f', 0 );
|
||||
|
||||
labelNode->setTextData( slider, text, textRect,
|
||||
font, QskTextOptions(), QskTextColors( Qt::white ),
|
||||
Qt::AlignHCenter, Qsk::Normal );
|
||||
labelNode->setTextData( slider, text, textRect, font, QskTextOptions(),
|
||||
QskTextColors( Qt::white ), Qt::AlignHCenter, Qsk::Normal );
|
||||
|
||||
return handleNode;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ public:
|
|||
QskAspect::Subcontrol ) const override;
|
||||
|
||||
protected:
|
||||
QSGNode* updateSubNode(
|
||||
const QskSkinnable*, quint8 nodeRole, QSGNode* ) const override;
|
||||
QSGNode* updateSubNode( const QskSkinnable*,
|
||||
quint8 nodeRole, QSGNode* ) const override;
|
||||
|
||||
private:
|
||||
QSGNode* updateScaleNode( const QskSlider*, QSGNode* ) const;
|
||||
|
|
|
|||
|
|
@ -9,17 +9,17 @@
|
|||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QtMath>
|
||||
|
|
@ -32,8 +32,8 @@ public:
|
|||
"Preserved" is for horizontal, "Transposed" for vertical orientation
|
||||
*/
|
||||
|
||||
OtherSlider( QQuickItem* parentItem = nullptr ):
|
||||
QskSlider( parentItem )
|
||||
OtherSlider( QQuickItem* parentItem = nullptr )
|
||||
: QskSlider( parentItem )
|
||||
{
|
||||
using namespace QskAspect;
|
||||
using namespace QskRgbValue;
|
||||
|
|
@ -108,8 +108,8 @@ public:
|
|||
class SliderBox : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
SliderBox( QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Vertical, parentItem )
|
||||
SliderBox( QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Vertical, parentItem )
|
||||
{
|
||||
auto slider = new QskSlider( this );
|
||||
slider->setMinimum( 0 );
|
||||
|
|
|
|||
|
|
@ -7,24 +7,24 @@
|
|||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskSkin.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
|
||||
class Label : public QskTextLabel
|
||||
{
|
||||
public:
|
||||
Label( const QString& text, QQuickItem* parent = nullptr ):
|
||||
QskTextLabel( text, parent )
|
||||
Label( const QString& text, QQuickItem* parent = nullptr )
|
||||
: QskTextLabel( text, parent )
|
||||
{
|
||||
setTextColor( Qt::darkRed );
|
||||
setFontRole( QskSkin::LargeFont );
|
||||
|
|
@ -35,8 +35,8 @@ public:
|
|||
class TabView : public QskTabView
|
||||
{
|
||||
public:
|
||||
TabView( QQuickItem* parent = nullptr ):
|
||||
QskTabView( parent )
|
||||
TabView( QQuickItem* parent = nullptr )
|
||||
: QskTabView( parent )
|
||||
{
|
||||
for ( int i = 0; i < 6; i++ )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,20 +3,20 @@
|
|||
* This file may be used under the terms of the 3-clause BSD License
|
||||
*****************************************************************************/
|
||||
|
||||
#include <SkinnyShortcut.h>
|
||||
#include <SkinnyShapeFactory.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskScrollArea.h>
|
||||
#include <QskWindow.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskGraphic.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskGraphic.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskScrollArea.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QPainter>
|
||||
|
|
@ -62,8 +62,8 @@ static int randomShape()
|
|||
class Thumbnail : public QskPushButton
|
||||
{
|
||||
public:
|
||||
Thumbnail( const QColor& color, int shape, QQuickItem* parentItem ):
|
||||
QskPushButton( parentItem )
|
||||
Thumbnail( const QColor& color, int shape, QQuickItem* parentItem )
|
||||
: QskPushButton( parentItem )
|
||||
{
|
||||
using namespace SkinnyShapeFactory;
|
||||
|
||||
|
|
@ -93,8 +93,8 @@ public:
|
|||
class IconGrid : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
IconGrid( QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Horizontal, gridSize, parentItem )
|
||||
IconGrid( QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Horizontal, gridSize, parentItem )
|
||||
{
|
||||
setMargins( 20 );
|
||||
setSpacing( 20 );
|
||||
|
|
@ -110,8 +110,8 @@ public:
|
|||
class ScrollArea : public QskScrollArea
|
||||
{
|
||||
public:
|
||||
ScrollArea( QQuickItem* parentItem = nullptr ) :
|
||||
QskScrollArea( parentItem )
|
||||
ScrollArea( QQuickItem* parentItem = nullptr )
|
||||
: QskScrollArea( parentItem )
|
||||
{
|
||||
using namespace QskAspect;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include <SkinnyFont.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskObjectCounter.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
|
|
@ -16,11 +16,11 @@
|
|||
class TextBox : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
TextBox( QQuickItem* parent = nullptr ):
|
||||
QskLinearBox( Qt::Vertical, 3, parent )
|
||||
TextBox( QQuickItem* parent = nullptr )
|
||||
: QskLinearBox( Qt::Vertical, 3, parent )
|
||||
{
|
||||
const QStringList texts = { "Default", "Tiny", "Small",
|
||||
"Medium", "Large", "Huge" };
|
||||
const QStringList texts =
|
||||
{ "Default", "Tiny", "Small", "Medium", "Large", "Huge" };
|
||||
|
||||
for ( int i = 0; i < texts.size(); i++ )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,9 +10,9 @@ public:
|
|||
QVector< QString > candidates;
|
||||
};
|
||||
|
||||
QskHunspellTextPredictor::QskHunspellTextPredictor( QObject* object ):
|
||||
Inherited( Words, object ),
|
||||
m_data( new PrivateData() )
|
||||
QskHunspellTextPredictor::QskHunspellTextPredictor( QObject* object )
|
||||
: Inherited( Words, object )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
#if 1
|
||||
// TODO: loading the language specific one depending on the locale
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@
|
|||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#include <qpa/qplatforminputcontextplugin_p.h>
|
||||
#include <qpa/qplatforminputcontext.h>
|
||||
#include <qpa/qplatforminputcontextplugin_p.h>
|
||||
|
||||
#include "QskInputContext.h"
|
||||
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
#include "QskHunspellTextPredictor.h"
|
||||
#endif
|
||||
|
||||
#include <QEvent>
|
||||
#include <QLocale>
|
||||
#include <QRectF>
|
||||
#include <QEvent>
|
||||
|
||||
namespace
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include "pinyinime.h"
|
||||
|
||||
#include <QStringList>
|
||||
#include <QDebug>
|
||||
#include <QStringList>
|
||||
|
||||
class QskPinyinTextPredictor::PrivateData
|
||||
{
|
||||
|
|
@ -17,9 +17,9 @@ public:
|
|||
QStringList candidates;
|
||||
};
|
||||
|
||||
QskPinyinTextPredictor::QskPinyinTextPredictor( QObject* parent ):
|
||||
Inherited( Attributes(), parent ),
|
||||
m_data( new PrivateData )
|
||||
QskPinyinTextPredictor::QskPinyinTextPredictor( QObject* parent )
|
||||
: Inherited( Attributes(), parent )
|
||||
, m_data( new PrivateData )
|
||||
{
|
||||
#if 1
|
||||
const char dictionary[] = "XXX/3rdparty/pinyin/data/dict_pinyin.dat";
|
||||
|
|
@ -80,7 +80,6 @@ void QskPinyinTextPredictor::request( const QString& text )
|
|||
QVector< QChar > candidateBuffer;
|
||||
candidateBuffer.resize( ime_pinyin::kMaxSearchSteps + 1 );
|
||||
|
||||
|
||||
QStringList candidates;
|
||||
candidates.reserve( count );
|
||||
|
||||
|
|
|
|||
|
|
@ -11,11 +11,11 @@
|
|||
class Image::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData():
|
||||
sourceSizeAdjustment( false ),
|
||||
deferredUpdates( true ),
|
||||
dirtyPolish( false ),
|
||||
dirtyUpdate( false )
|
||||
PrivateData()
|
||||
: sourceSizeAdjustment( false )
|
||||
, deferredUpdates( true )
|
||||
, dirtyPolish( false )
|
||||
, dirtyUpdate( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -26,9 +26,9 @@ public:
|
|||
bool dirtyUpdate : 1;
|
||||
};
|
||||
|
||||
Image::Image( QQuickItem* parent ):
|
||||
Inherited( parent ),
|
||||
m_data( new PrivateData() )
|
||||
Image::Image( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -124,8 +124,8 @@ void Image::itemChange( QQuickItem::ItemChange change,
|
|||
}
|
||||
}
|
||||
|
||||
void Image::geometryChanged( const QRectF& newGeometry,
|
||||
const QRectF& oldGeometry )
|
||||
void Image::geometryChanged(
|
||||
const QRectF& newGeometry, const QRectF& oldGeometry )
|
||||
{
|
||||
Inherited::geometryChanged( newGeometry, oldGeometry );
|
||||
|
||||
|
|
|
|||
|
|
@ -8,12 +8,12 @@
|
|||
#include <SkinnyShapeProvider.h>
|
||||
#include <SkinnyShortcut.h>
|
||||
|
||||
#include <QskModule.h>
|
||||
#include <QskGraphicImageProvider.h>
|
||||
#include <QskModule.h>
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QQmlApplicationEngine>
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main( int argc, char* argv[] )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,19 +8,19 @@
|
|||
|
||||
#include <QskDialog.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskInputContext.h>
|
||||
#include <QskInputPanel.h>
|
||||
#include <QskLinearBox.h>
|
||||
#include <QskListView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskInputPanel.h>
|
||||
#include <QskInputContext.h>
|
||||
|
||||
#include <QskWindow.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskWindow.h>
|
||||
|
||||
#include <QskObjectCounter.h>
|
||||
|
||||
#include <QGuiApplication>
|
||||
#include <QFontMetricsF>
|
||||
#include <QGuiApplication>
|
||||
|
||||
#define STRINGIFY( x ) #x
|
||||
#define STRING( x ) STRINGIFY( x )
|
||||
|
|
@ -92,7 +92,7 @@ static inline QString nativeLocaleString( const QLocale& locale )
|
|||
case QLocale::Romanian:
|
||||
return QStringLiteral( "Română" );
|
||||
|
||||
case QLocale::Russia:
|
||||
case QLocale::Russian:
|
||||
return QStringLiteral( "Русский" );
|
||||
|
||||
case QLocale::Slovenian:
|
||||
|
|
@ -115,8 +115,8 @@ static inline QString nativeLocaleString( const QLocale& locale )
|
|||
class InputBox : public QskLinearBox
|
||||
{
|
||||
public:
|
||||
InputBox( QQuickItem* parentItem = nullptr ):
|
||||
QskLinearBox( Qt::Vertical, parentItem )
|
||||
InputBox( QQuickItem* parentItem = nullptr )
|
||||
: QskLinearBox( Qt::Vertical, parentItem )
|
||||
{
|
||||
setExtraSpacingAt( Qt::BottomEdge | Qt::RightEdge );
|
||||
|
||||
|
|
@ -151,9 +151,9 @@ class LocaleListView final : public QskListView
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
LocaleListView( QQuickItem* parentItem = nullptr ):
|
||||
QskListView( parentItem ),
|
||||
m_maxWidth( 0.0 )
|
||||
LocaleListView( QQuickItem* parentItem = nullptr )
|
||||
: QskListView( parentItem )
|
||||
, m_maxWidth( 0.0 )
|
||||
{
|
||||
for ( auto language :
|
||||
{
|
||||
|
|
@ -166,7 +166,6 @@ public:
|
|||
QLocale::Slovak, QLocale::Turkish, QLocale::Chinese
|
||||
} )
|
||||
{
|
||||
|
||||
if ( language == QLocale::English )
|
||||
{
|
||||
append( QLocale( QLocale::English, QLocale::UnitedStates ) );
|
||||
|
|
|
|||
|
|
@ -6,31 +6,31 @@
|
|||
#include "Callback.h"
|
||||
#include <QMetaMethod>
|
||||
|
||||
Callback::Callback():
|
||||
m_context( nullptr )
|
||||
Callback::Callback()
|
||||
: m_context( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
Callback::Callback( const QObject* context, const QMetaMethod& method ):
|
||||
m_context( const_cast< QObject* >( context ) ),
|
||||
m_invokable( method )
|
||||
Callback::Callback( const QObject* context, const QMetaMethod& method )
|
||||
: m_context( const_cast< QObject* >( context ) )
|
||||
, m_invokable( method )
|
||||
{
|
||||
}
|
||||
|
||||
Callback::Callback( const QObject* context, const char* methodName ):
|
||||
Callback( context, qskMetaMethod( context, methodName ) )
|
||||
Callback::Callback( const QObject* context, const char* methodName )
|
||||
: Callback( context, qskMetaMethod( context, methodName ) )
|
||||
{
|
||||
}
|
||||
|
||||
Callback::Callback( const QObject* context, const QMetaProperty& property ):
|
||||
m_context( const_cast< QObject* >( context ) ),
|
||||
m_invokable( property )
|
||||
Callback::Callback( const QObject* context, const QMetaProperty& property )
|
||||
: m_context( const_cast< QObject* >( context ) )
|
||||
, m_invokable( property )
|
||||
{
|
||||
}
|
||||
|
||||
Callback::Callback( const QObject* context, const QskMetaFunction& function ):
|
||||
m_context( const_cast< QObject* >( context ) ),
|
||||
m_invokable( function )
|
||||
Callback::Callback( const QObject* context, const QskMetaFunction& function )
|
||||
: m_context( const_cast< QObject* >( context ) )
|
||||
, m_invokable( function )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,28 +5,28 @@
|
|||
|
||||
#include "Invoker.h"
|
||||
|
||||
#include <QThread>
|
||||
#include <QMetaProperty>
|
||||
#include <QThread>
|
||||
|
||||
Invoker::Invoker( QObject* parent ):
|
||||
QObject( parent )
|
||||
Invoker::Invoker( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
||||
|
||||
void Invoker::addFunctionCall( const QObject* object,
|
||||
const QskMetaFunction& function )
|
||||
void Invoker::addFunctionCall(
|
||||
const QObject* object, const QskMetaFunction& function )
|
||||
{
|
||||
m_callbacks.append( Callback( object, function ) );
|
||||
}
|
||||
|
||||
void Invoker::addMethodCall( const QObject* object,
|
||||
const char* methodName )
|
||||
void Invoker::addMethodCall(
|
||||
const QObject* object, const char* methodName )
|
||||
{
|
||||
m_callbacks.append( Callback( object, methodName ) );
|
||||
}
|
||||
|
||||
void Invoker::addPropertyCall( const QObject* object,
|
||||
const char* property )
|
||||
void Invoker::addPropertyCall(
|
||||
const QObject* object, const char* property )
|
||||
{
|
||||
const auto metaProperty = object->metaObject()->property(
|
||||
object->metaObject()->indexOfProperty( property ) );
|
||||
|
|
@ -34,8 +34,8 @@ void Invoker::addPropertyCall( const QObject* object,
|
|||
m_callbacks.append( Callback( object, metaProperty ) );
|
||||
}
|
||||
|
||||
void Invoker::invoke( qreal realValue, int intValue,
|
||||
Qt::ConnectionType connectionType )
|
||||
void Invoker::invoke(
|
||||
qreal realValue, int intValue, Qt::ConnectionType connectionType )
|
||||
{
|
||||
QString s = QString( "S: %1 + %2" ).arg( realValue ).arg( intValue );
|
||||
|
||||
|
|
|
|||
|
|
@ -4,10 +4,11 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "Invoker.h"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QTimer>
|
||||
#include <QThread>
|
||||
#include <QTimer>
|
||||
|
||||
void debugNone1()
|
||||
{
|
||||
|
|
@ -48,8 +49,8 @@ class MyObject : public QObject
|
|||
Q_PROPERTY( QString valueString WRITE setValueString )
|
||||
|
||||
public:
|
||||
MyObject( QObject* parent = nullptr ):
|
||||
QObject( parent )
|
||||
MyObject( QObject* parent = nullptr )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -110,10 +111,10 @@ static auto fs = []( int i, double d ) { qDebug() << i << d; };
|
|||
class Application : public QCoreApplication
|
||||
{
|
||||
public:
|
||||
Application( int& argc, char* argv[] ):
|
||||
QCoreApplication( argc, argv ),
|
||||
m_object( new MyObject() ),
|
||||
m_thread( new QThread( this ) )
|
||||
Application( int& argc, char* argv[] )
|
||||
: QCoreApplication( argc, argv )
|
||||
, m_object( new MyObject() )
|
||||
, m_thread( new QThread( this ) )
|
||||
{
|
||||
#if 1
|
||||
m_invoker.addPropertyCall( m_object, "number" );
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
#include "QskMaterialSkin.h"
|
||||
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskDialogButton.h>
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskInputPanelBox.h>
|
||||
#include <QskListView.h>
|
||||
|
|
@ -16,24 +16,24 @@
|
|||
#include <QskSeparator.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskSubWindow.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabBar.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
|
||||
#include <QskSkinlet.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskNamespace.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskNamespace.h>
|
||||
#include <QskRgbValue.h>
|
||||
|
||||
#if 1
|
||||
// should be defined in the public header, so that
|
||||
|
|
@ -99,9 +99,9 @@ public:
|
|||
ColorPalette palette;
|
||||
};
|
||||
|
||||
QskMaterialSkin::QskMaterialSkin( QObject* parent ):
|
||||
Inherited( parent ),
|
||||
m_data( new PrivateData() )
|
||||
QskMaterialSkin::QskMaterialSkin( QObject* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
m_data->palette = ColorPalette( QskRgbValue::Grey100,
|
||||
QskRgbValue::Blue500, QskRgbValue::White );
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
static const QString materialSkinName = QStringLiteral( "material" );
|
||||
|
||||
QskMaterialSkinFactory::QskMaterialSkinFactory( QObject* parent ):
|
||||
QskSkinFactory( parent )
|
||||
QskMaterialSkinFactory::QskMaterialSkinFactory( QObject* parent )
|
||||
: QskSkinFactory( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,37 +5,37 @@
|
|||
|
||||
#include "QskSquiekSkin.h"
|
||||
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskDialogButton.h>
|
||||
#include <QskDialogButtonBox.h>
|
||||
#include <QskPageIndicator.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabBar.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskFocusIndicator.h>
|
||||
#include <QskInputPanelBox.h>
|
||||
#include <QskInputPredictionBar.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
#include <QskScrollView.h>
|
||||
#include <QskListView.h>
|
||||
#include <QskPageIndicator.h>
|
||||
#include <QskPushButton.h>
|
||||
#include <QskScrollView.h>
|
||||
#include <QskSeparator.h>
|
||||
#include <QskSlider.h>
|
||||
#include <QskSubWindow.h>
|
||||
#include <QskTabBar.h>
|
||||
#include <QskTabButton.h>
|
||||
#include <QskTabView.h>
|
||||
#include <QskTextInput.h>
|
||||
#include <QskTextLabel.h>
|
||||
#include <QskVirtualKeyboard.h>
|
||||
|
||||
#include <QskSkinlet.h>
|
||||
|
||||
#include <QskAspect.h>
|
||||
#include <QskNamespace.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskRgbValue.h>
|
||||
#include <QskAnimationHint.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskAspect.h>
|
||||
#include <QskBoxBorderColors.h>
|
||||
#include <QskBoxBorderMetrics.h>
|
||||
#include <QskBoxShapeMetrics.h>
|
||||
#include <QskFunctions.h>
|
||||
#include <QskGradient.h>
|
||||
#include <QskMargins.h>
|
||||
#include <QskNamespace.h>
|
||||
#include <QskRgbValue.h>
|
||||
|
||||
static const int qskDuration = 200;
|
||||
|
||||
|
|
@ -116,9 +116,9 @@ public:
|
|||
ColorPalette palette;
|
||||
};
|
||||
|
||||
QskSquiekSkin::QskSquiekSkin( QObject* parent ):
|
||||
Inherited( parent ),
|
||||
m_data( new PrivateData() )
|
||||
QskSquiekSkin::QskSquiekSkin( QObject* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
initHints();
|
||||
setupFonts( "DejaVuSans" );
|
||||
|
|
@ -208,12 +208,12 @@ void QskSquiekSkin::setPanel( QskAspect::Aspect aspect, PanelStyle style )
|
|||
setButton( aspect, style, 1 );
|
||||
}
|
||||
|
||||
void QskSquiekSkin::setTab( QskAspect::Aspect aspect,
|
||||
Qt::Orientation orientation )
|
||||
void QskSquiekSkin::setTab( QskAspect::Aspect aspect, Qt::Orientation orientation )
|
||||
{
|
||||
const ColorPalette& pal = m_data->palette;
|
||||
|
||||
setGradient( aspect, QskGradient( QskGradient::Vertical, pal.lighter125, pal.lighter150 ) );
|
||||
setGradient( aspect,
|
||||
QskGradient( QskGradient::Vertical, pal.lighter125, pal.lighter150 ) );
|
||||
setBoxBorderColors( aspect, pal.darker200 );
|
||||
|
||||
QskBoxBorderMetrics border( 1 );
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
static const QString squiekSkinName = QStringLiteral( "squiek" );
|
||||
|
||||
QskSquiekSkinFactory::QskSquiekSkinFactory( QObject* parent ):
|
||||
QskSkinFactory( parent )
|
||||
QskSquiekSkinFactory::QskSquiekSkinFactory( QObject* parent )
|
||||
: QskSkinFactory( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
#include "QskAspect.h"
|
||||
|
||||
#include <qalgorithms.h>
|
||||
#include <qdebug.h>
|
||||
#include <qmetaobject.h>
|
||||
#include <qalgorithms.h>
|
||||
#include <qvector.h>
|
||||
|
||||
#include <bitset>
|
||||
|
|
@ -57,8 +57,8 @@ QskAspect::Subcontrol QskAspect::nextSubcontrol(
|
|||
auto& names = qskAspectRegistry->subControlNames;
|
||||
auto& hashTable = qskAspectRegistry->subControlTable;
|
||||
|
||||
Q_ASSERT_X( names.size() <= LastSubcontrol,
|
||||
"QskAspect", "There are no free subcontrol aspects; please modify your"
|
||||
Q_ASSERT_X( names.size() <= LastSubcontrol, "QskAspect",
|
||||
"There are no free subcontrol aspects; please modify your"
|
||||
" application to declare fewer aspects, or increase the mask size of"
|
||||
" QskAspect::Subcontrol in QskAspect.h." );
|
||||
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@
|
|||
#ifndef QSK_ASPECT_H
|
||||
#define QSK_ASPECT_H
|
||||
|
||||
#include "QskGlobal.h"
|
||||
#include "QskFlags.h"
|
||||
|
||||
#include <qmetaobject.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#ifdef Q_MOC_RUN
|
||||
|
|
@ -177,6 +179,7 @@ namespace QskAspect
|
|||
|
||||
private:
|
||||
constexpr Aspect( Subcontrol, Type, Placement );
|
||||
|
||||
constexpr Aspect( uint subControl, uint type, bool isAnimator,
|
||||
uint primitive, uint placement, uint states );
|
||||
|
||||
|
|
@ -202,34 +205,35 @@ namespace QskAspect
|
|||
};
|
||||
};
|
||||
|
||||
inline constexpr Aspect::Aspect():
|
||||
Aspect( Control, Flag, Preserved )
|
||||
inline constexpr Aspect::Aspect()
|
||||
: Aspect( Control, Flag, Preserved )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr Aspect::Aspect( Subcontrol subControl ):
|
||||
Aspect( subControl, Flag, Preserved )
|
||||
inline constexpr Aspect::Aspect( Subcontrol subControl )
|
||||
: Aspect( subControl, Flag, Preserved )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr Aspect::Aspect( Type type ):
|
||||
Aspect( Control, type, Preserved )
|
||||
inline constexpr Aspect::Aspect( Type type )
|
||||
: Aspect( Control, type, Preserved )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr Aspect::Aspect( Placement placement ):
|
||||
Aspect( Control, Flag, placement )
|
||||
inline constexpr Aspect::Aspect( Placement placement )
|
||||
: Aspect( Control, Flag, placement )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr Aspect::Aspect( Subcontrol subControl, Type type, Placement placement ):
|
||||
Aspect( subControl, type, false, 0, placement, NoState )
|
||||
inline constexpr Aspect::Aspect(
|
||||
Subcontrol subControl, Type type, Placement placement )
|
||||
: Aspect( subControl, type, false, 0, placement, NoState )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr Aspect::Aspect( uint subControl, uint type, bool isAnimator,
|
||||
uint primitive, uint placement, uint states ):
|
||||
m_bits { subControl, type, isAnimator, primitive, placement, 0, states, 0 }
|
||||
uint primitive, uint placement, uint states )
|
||||
: m_bits { subControl, type, isAnimator, primitive, placement, 0, states, 0 }
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,10 +58,10 @@ QskBoxBorderColors::~QskBoxBorderColors()
|
|||
|
||||
bool QskBoxBorderColors::operator==( const QskBoxBorderColors& other ) const
|
||||
{
|
||||
return ( m_colors[0] == other.m_colors[0] )
|
||||
&& ( m_colors[1] == other.m_colors[1] )
|
||||
&& ( m_colors[2] == other.m_colors[2] )
|
||||
&& ( m_colors[3] == other.m_colors[3] );
|
||||
return ( m_colors[ 0 ] == other.m_colors[ 0 ] ) &&
|
||||
( m_colors[ 1 ] == other.m_colors[ 1 ] ) &&
|
||||
( m_colors[ 2 ] == other.m_colors[ 2 ] ) &&
|
||||
( m_colors[ 3 ] == other.m_colors[ 3 ] );
|
||||
}
|
||||
|
||||
void QskBoxBorderColors::setAlpha( int alpha )
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ class QSK_EXPORT QskBoxBorderColors
|
|||
{
|
||||
public:
|
||||
QskBoxBorderColors();
|
||||
|
||||
QskBoxBorderColors( const QColor& left, const QColor& top,
|
||||
const QColor& right, const QColor& bottom );
|
||||
|
||||
|
|
@ -59,13 +60,13 @@ private:
|
|||
QColor m_colors[ 4 ];
|
||||
};
|
||||
|
||||
inline QskBoxBorderColors::QskBoxBorderColors( Qt::GlobalColor color ):
|
||||
QskBoxBorderColors( QColor( color ) )
|
||||
inline QskBoxBorderColors::QskBoxBorderColors( Qt::GlobalColor color )
|
||||
: QskBoxBorderColors( QColor( color ) )
|
||||
{
|
||||
}
|
||||
|
||||
inline QskBoxBorderColors::QskBoxBorderColors( QRgb rgb ):
|
||||
QskBoxBorderColors( QColor::fromRgba( rgb ) )
|
||||
inline QskBoxBorderColors::QskBoxBorderColors( QRgb rgb )
|
||||
: QskBoxBorderColors( QColor::fromRgba( rgb ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,8 +88,9 @@ QskBoxBorderMetrics QskBoxBorderMetrics::interpolated(
|
|||
return QskBoxBorderMetrics( widths, m_sizeMode );
|
||||
}
|
||||
|
||||
QVariant QskBoxBorderMetrics::interpolate( const QskBoxBorderMetrics& from,
|
||||
const QskBoxBorderMetrics& to, qreal progress )
|
||||
QVariant QskBoxBorderMetrics::interpolate(
|
||||
const QskBoxBorderMetrics& from, const QskBoxBorderMetrics& to,
|
||||
qreal progress )
|
||||
{
|
||||
return QVariant::fromValue( from.interpolated( to, progress ) );
|
||||
}
|
||||
|
|
@ -119,4 +120,3 @@ QDebug operator<<( QDebug debug, const QskBoxBorderMetrics& metrics )
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include "QskGlobal.h"
|
||||
#include "QskMargins.h"
|
||||
|
||||
#include <qnamespace.h>
|
||||
#include <qmetatype.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qsize.h>
|
||||
|
||||
class QDebug;
|
||||
|
|
@ -20,10 +20,15 @@ class QSK_EXPORT QskBoxBorderMetrics
|
|||
{
|
||||
public:
|
||||
constexpr QskBoxBorderMetrics();
|
||||
constexpr QskBoxBorderMetrics( qreal width, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
|
||||
constexpr QskBoxBorderMetrics(
|
||||
qreal width, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
|
||||
constexpr QskBoxBorderMetrics( qreal left, qreal top,
|
||||
qreal right, qreal bottom, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
constexpr QskBoxBorderMetrics( const QskMargins& widths, Qt::SizeMode sizeMode = Qt::AbsoluteSize );
|
||||
|
||||
constexpr QskBoxBorderMetrics(
|
||||
const QskMargins& widths, Qt::SizeMode sizeMode = Qt::AbsoluteSize );
|
||||
|
||||
~QskBoxBorderMetrics();
|
||||
|
||||
|
|
@ -41,7 +46,9 @@ public:
|
|||
void setSizeMode( Qt::SizeMode );
|
||||
Qt::SizeMode sizeMode() const;
|
||||
|
||||
QskBoxBorderMetrics interpolated( const QskBoxBorderMetrics&, qreal value ) const;
|
||||
QskBoxBorderMetrics interpolated(
|
||||
const QskBoxBorderMetrics&, qreal value ) const;
|
||||
|
||||
QskBoxBorderMetrics toAbsolute( const QSizeF& ) const;
|
||||
|
||||
uint hash( uint seed = 0 ) const;
|
||||
|
|
@ -54,28 +61,29 @@ private:
|
|||
Qt::SizeMode m_sizeMode : 2;
|
||||
};
|
||||
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics():
|
||||
m_sizeMode( Qt::AbsoluteSize )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics( qreal width, Qt::SizeMode sizeMode ):
|
||||
m_widths( width ),
|
||||
m_sizeMode( sizeMode )
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics()
|
||||
: m_sizeMode( Qt::AbsoluteSize )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
|
||||
const QskMargins& widths, Qt::SizeMode sizeMode ):
|
||||
m_widths( widths ),
|
||||
m_sizeMode( sizeMode )
|
||||
qreal width, Qt::SizeMode sizeMode )
|
||||
: m_widths( width )
|
||||
, m_sizeMode( sizeMode )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics( qreal left, qreal top,
|
||||
qreal right, qreal bottom, Qt::SizeMode sizeMode ):
|
||||
m_widths( left, top, right, bottom ),
|
||||
m_sizeMode( sizeMode )
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
|
||||
const QskMargins& widths, Qt::SizeMode sizeMode )
|
||||
: m_widths( widths )
|
||||
, m_sizeMode( sizeMode )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskBoxBorderMetrics::QskBoxBorderMetrics(
|
||||
qreal left, qreal top, qreal right, qreal bottom, Qt::SizeMode sizeMode )
|
||||
: m_widths( left, top, right, bottom )
|
||||
, m_sizeMode( sizeMode )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,9 @@ static inline qreal qskAbsoluted( qreal length, qreal percentage )
|
|||
}
|
||||
|
||||
QskBoxShapeMetrics::QskBoxShapeMetrics(
|
||||
qreal radiusX, qreal radiusY, Qt::SizeMode sizeMode ):
|
||||
m_sizeMode( sizeMode ),
|
||||
m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
qreal radiusX, qreal radiusY, Qt::SizeMode sizeMode )
|
||||
: m_sizeMode( sizeMode )
|
||||
, m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
{
|
||||
setRadius( radiusX, radiusY );
|
||||
}
|
||||
|
|
@ -68,8 +68,10 @@ void QskBoxShapeMetrics::setAspectRatioMode( Qt::AspectRatioMode aspectRatioMode
|
|||
}
|
||||
|
||||
void QskBoxShapeMetrics::setRadius(
|
||||
qreal topLeftX, qreal topLeftY, qreal topRightX, qreal topRightY,
|
||||
qreal bottomLeftX, qreal bottomLeftY, qreal bottomRightX, qreal bottomRightY )
|
||||
qreal topLeftX, qreal topLeftY,
|
||||
qreal topRightX, qreal topRightY,
|
||||
qreal bottomLeftX, qreal bottomLeftY,
|
||||
qreal bottomRightX, qreal bottomRightY )
|
||||
{
|
||||
m_radii[ Qt::TopLeftCorner ].setWidth( qMax( topLeftX, 0.0 ) );
|
||||
m_radii[ Qt::TopLeftCorner ].setHeight( qMax( topLeftY, 0.0 ) );
|
||||
|
|
@ -194,8 +196,8 @@ QskBoxShapeMetrics QskBoxShapeMetrics::interpolated(
|
|||
return QskBoxShapeMetrics( to.m_sizeMode, radii );
|
||||
}
|
||||
|
||||
QVariant QskBoxShapeMetrics::interpolate( const QskBoxShapeMetrics& from,
|
||||
const QskBoxShapeMetrics& to, qreal progress )
|
||||
QVariant QskBoxShapeMetrics::interpolate(
|
||||
const QskBoxShapeMetrics& from, const QskBoxShapeMetrics& to, qreal progress )
|
||||
{
|
||||
return QVariant::fromValue( from.interpolated( to, progress ) );
|
||||
}
|
||||
|
|
@ -232,4 +234,3 @@ QDebug operator<<( QDebug debug, const QskBoxShapeMetrics& metrics )
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include "QskGlobal.h"
|
||||
|
||||
#include <qnamespace.h>
|
||||
#include <qmetatype.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qsize.h>
|
||||
|
||||
class QVariant;
|
||||
|
|
@ -19,6 +19,7 @@ class QSK_EXPORT QskBoxShapeMetrics
|
|||
{
|
||||
public:
|
||||
constexpr QskBoxShapeMetrics();
|
||||
|
||||
constexpr QskBoxShapeMetrics( qreal topLeft, qreal topRight,
|
||||
qreal bottomLeft, qreal bottomRight, Qt::SizeMode = Qt::AbsoluteSize );
|
||||
|
||||
|
|
@ -62,8 +63,11 @@ public:
|
|||
void setAspectRatioMode( Qt::AspectRatioMode );
|
||||
Qt::AspectRatioMode aspectRatioMode() const;
|
||||
|
||||
QskBoxShapeMetrics interpolated( const QskBoxShapeMetrics&, qreal value ) const;
|
||||
QskBoxShapeMetrics interpolated(
|
||||
const QskBoxShapeMetrics&, qreal value ) const;
|
||||
|
||||
QskBoxShapeMetrics toAbsolute( const QSizeF& ) const;
|
||||
|
||||
QskBoxShapeMetrics rotated() const;
|
||||
|
||||
QMarginsF padding( const QSizeF& ) const;
|
||||
|
|
@ -74,10 +78,10 @@ public:
|
|||
const QskBoxShapeMetrics&, qreal progress );
|
||||
|
||||
private:
|
||||
inline constexpr QskBoxShapeMetrics( Qt::SizeMode sizeMode, const QSizeF radii[4] ):
|
||||
m_radii{ radii[0], radii[1], radii[2], radii[3] },
|
||||
m_sizeMode( sizeMode ),
|
||||
m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
inline constexpr QskBoxShapeMetrics( Qt::SizeMode sizeMode, const QSizeF radii[ 4 ] )
|
||||
: m_radii{ radii[ 0 ], radii[ 1 ], radii[ 2 ], radii[ 3 ] }
|
||||
, m_sizeMode( sizeMode )
|
||||
, m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -86,24 +90,24 @@ private:
|
|||
Qt::AspectRatioMode m_aspectRatioMode : 2;
|
||||
};
|
||||
|
||||
inline constexpr QskBoxShapeMetrics::QskBoxShapeMetrics():
|
||||
m_radii{ { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } },
|
||||
m_sizeMode( Qt::AbsoluteSize ),
|
||||
m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
inline constexpr QskBoxShapeMetrics::QskBoxShapeMetrics()
|
||||
: m_radii{ { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 }, { 0.0, 0.0 } }
|
||||
, m_sizeMode( Qt::AbsoluteSize )
|
||||
, m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
{
|
||||
}
|
||||
|
||||
inline QskBoxShapeMetrics::QskBoxShapeMetrics( qreal radius, Qt::SizeMode sizeMode ):
|
||||
QskBoxShapeMetrics( radius, radius, sizeMode )
|
||||
inline QskBoxShapeMetrics::QskBoxShapeMetrics( qreal radius, Qt::SizeMode sizeMode )
|
||||
: QskBoxShapeMetrics( radius, radius, sizeMode )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskBoxShapeMetrics::QskBoxShapeMetrics( qreal topLeft, qreal topRight,
|
||||
qreal bottomLeft, qreal bottomRight, Qt::SizeMode sizeMode ):
|
||||
m_radii{ { topLeft, topLeft }, { topRight, topRight },
|
||||
{ bottomLeft, bottomLeft }, { bottomRight, bottomRight } },
|
||||
m_sizeMode( sizeMode ),
|
||||
m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
qreal bottomLeft, qreal bottomRight, Qt::SizeMode sizeMode )
|
||||
: m_radii{ { topLeft, topLeft }, { topRight, topRight },
|
||||
{ bottomLeft, bottomLeft }, { bottomRight, bottomRight } }
|
||||
, m_sizeMode( sizeMode )
|
||||
, m_aspectRatioMode( Qt::KeepAspectRatio )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -145,8 +149,7 @@ inline void QskBoxShapeMetrics::setRadius( Qt::Corner corner, const QSizeF& radi
|
|||
}
|
||||
|
||||
inline void QskBoxShapeMetrics::setRadius(
|
||||
qreal topLeft, qreal topRight,
|
||||
qreal bottomLeft, qreal bottomRight )
|
||||
qreal topLeft, qreal topRight, qreal bottomLeft, qreal bottomRight )
|
||||
{
|
||||
setRadius( topLeft, topLeft, topRight, topRight,
|
||||
bottomLeft, bottomLeft, bottomRight, bottomRight );
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
#include "QskFunctions.h"
|
||||
|
||||
#include <qguiapplication.h>
|
||||
#include <qscreen.h>
|
||||
#include <qmath.h>
|
||||
#include <qscreen.h>
|
||||
|
||||
template< class Rect, class Value >
|
||||
static inline Rect qskAlignedRect( const Rect& outerRect,
|
||||
|
|
|
|||
|
|
@ -41,8 +41,7 @@ inline QMarginsF qskMargins( const QRectF& rect, const QRectF& innerRect )
|
|||
innerRect.left() - rect.left(),
|
||||
innerRect.top() - rect.top(),
|
||||
rect.right() - innerRect.right(),
|
||||
rect.bottom() - innerRect.bottom()
|
||||
);
|
||||
rect.bottom() - innerRect.bottom() );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#ifndef QSK_GLOBAL_H
|
||||
#define QSK_GLOBAL_H
|
||||
|
||||
#include <qglobal.h>
|
||||
#include <qcompilerdetection.h>
|
||||
#include <qglobal.h>
|
||||
|
||||
// QSK_VERSION is (major << 16) + (minor << 8) + patch.
|
||||
|
||||
|
|
@ -45,7 +45,8 @@
|
|||
|
||||
#else
|
||||
|
||||
template <typename T> struct QskAddConst { typedef const T Type; };
|
||||
template < typename T >
|
||||
struct QskAddConst { typedef const T Type; };
|
||||
|
||||
template < typename T >
|
||||
constexpr typename QskAddConst< T >::Type& qskAsConst( T& t ) noexcept { return t; }
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include "QskGradient.h"
|
||||
#include "QskRgbValue.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qhashfunctions.h>
|
||||
#include <qvariant.h>
|
||||
|
||||
static void qskRegisterGradient()
|
||||
{
|
||||
|
|
@ -21,8 +21,7 @@ static inline bool qskIsGradientValid( const QVector< QskGradientStop >& stops )
|
|||
if ( stops.size() < 2 )
|
||||
return false;
|
||||
|
||||
if ( stops.first().position() != 0.0 ||
|
||||
stops.last().position() != 1.0 )
|
||||
if ( stops.first().position() != 0.0 || stops.last().position() != 1.0 )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -110,14 +109,14 @@ static inline QVector< QskGradientStop > qskExpandedStops(
|
|||
return stops;
|
||||
}
|
||||
|
||||
QskGradientStop::QskGradientStop():
|
||||
m_position( -1.0 )
|
||||
QskGradientStop::QskGradientStop()
|
||||
: m_position( -1.0 )
|
||||
{
|
||||
}
|
||||
|
||||
QskGradientStop::QskGradientStop( qreal position, const QColor& color ):
|
||||
m_position( position ),
|
||||
m_color( color )
|
||||
QskGradientStop::QskGradientStop( qreal position, const QColor& color )
|
||||
: m_position( position )
|
||||
, m_color( color )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -169,28 +168,28 @@ QColor QskGradientStop::interpolated(
|
|||
return QskRgbValue::interpolated( min->color(), max->color(), r );
|
||||
}
|
||||
|
||||
QskGradient::QskGradient():
|
||||
m_orientation( Vertical )
|
||||
QskGradient::QskGradient()
|
||||
: m_orientation( Vertical )
|
||||
{
|
||||
}
|
||||
|
||||
QskGradient::QskGradient( const QColor& color ):
|
||||
m_orientation( Vertical )
|
||||
QskGradient::QskGradient( const QColor& color )
|
||||
: m_orientation( Vertical )
|
||||
{
|
||||
setColor( color );
|
||||
}
|
||||
|
||||
QskGradient::QskGradient( Orientation orientation,
|
||||
const QColor& startColor, const QColor& stopColor ):
|
||||
m_orientation( orientation )
|
||||
const QColor& startColor, const QColor& stopColor )
|
||||
: m_orientation( orientation )
|
||||
{
|
||||
setColors( startColor, stopColor );
|
||||
}
|
||||
|
||||
QskGradient::QskGradient( Orientation orientation,
|
||||
const QVector< QskGradientStop >& stops ):
|
||||
m_orientation( orientation ),
|
||||
m_stops( stops )
|
||||
const QVector< QskGradientStop >& stops )
|
||||
: m_orientation( orientation )
|
||||
, m_stops( stops )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -406,8 +405,8 @@ QskGradient QskGradient::interpolated(
|
|||
at the same positions
|
||||
*/
|
||||
|
||||
const QVector< QskGradientStop > s1 = qskExpandedStops( m_stops, to.m_stops );
|
||||
QVector< QskGradientStop > s2 = qskExpandedStops( to.m_stops, m_stops );
|
||||
const auto s1 = qskExpandedStops( m_stops, to.m_stops );
|
||||
auto s2 = qskExpandedStops( to.m_stops, m_stops );
|
||||
|
||||
for ( int i = 0; i < s1.count(); i++ )
|
||||
{
|
||||
|
|
@ -467,7 +466,6 @@ QVariant QskGradient::interpolate(
|
|||
return QVariant::fromValue( from.interpolated( to, progress ) );
|
||||
}
|
||||
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
|
||||
#include <qdebug.h>
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include "QskGlobal.h"
|
||||
|
||||
#include <qmetatype.h>
|
||||
#include <qcolor.h>
|
||||
#include <qmetatype.h>
|
||||
#include <qvector.h>
|
||||
|
||||
class QDebug;
|
||||
|
|
@ -119,13 +119,13 @@ private:
|
|||
QVector< QskGradientStop > m_stops;
|
||||
};
|
||||
|
||||
inline QskGradient::QskGradient( Qt::GlobalColor color ):
|
||||
QskGradient( QColor( color ) )
|
||||
inline QskGradient::QskGradient( Qt::GlobalColor color )
|
||||
: QskGradient( QColor( color ) )
|
||||
{
|
||||
}
|
||||
|
||||
inline QskGradient::QskGradient( QRgb rgb ):
|
||||
QskGradient( QColor::fromRgba( rgb ) )
|
||||
inline QskGradient::QskGradient( QRgb rgb )
|
||||
: QskGradient( QColor::fromRgba( rgb ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,4 +63,3 @@ qreal QskMargins::marginAt( Qt::Edge edge ) const noexcept
|
|||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@
|
|||
#include "QskGlobal.h"
|
||||
|
||||
#include <qmargins.h>
|
||||
#include <qnamespace.h>
|
||||
#include <qmetatype.h>
|
||||
#include <qnamespace.h>
|
||||
|
||||
class QVariant;
|
||||
|
||||
|
|
@ -52,29 +52,30 @@ public:
|
|||
const QskMargins&, qreal progress ) noexcept;
|
||||
};
|
||||
|
||||
constexpr inline QskMargins::QskMargins( qreal margin ) noexcept:
|
||||
QskMargins( margin, margin, margin, margin )
|
||||
constexpr inline QskMargins::QskMargins( qreal margin ) noexcept
|
||||
: QskMargins( margin, margin, margin, margin )
|
||||
{
|
||||
}
|
||||
|
||||
constexpr inline QskMargins::QskMargins( qreal horizontal, qreal vertical ) noexcept:
|
||||
QskMargins( horizontal, vertical, horizontal, vertical )
|
||||
constexpr inline QskMargins::QskMargins(
|
||||
qreal horizontal, qreal vertical ) noexcept
|
||||
: QskMargins( horizontal, vertical, horizontal, vertical )
|
||||
{
|
||||
}
|
||||
|
||||
constexpr QskMargins::QskMargins(
|
||||
qreal left, qreal top, qreal right, qreal bottom ) noexcept:
|
||||
QMarginsF( left, top, right, bottom )
|
||||
qreal left, qreal top, qreal right, qreal bottom ) noexcept
|
||||
: QMarginsF( left, top, right, bottom )
|
||||
{
|
||||
}
|
||||
|
||||
constexpr inline QskMargins::QskMargins( const QMarginsF& margins ) noexcept:
|
||||
QMarginsF( margins )
|
||||
constexpr inline QskMargins::QskMargins( const QMarginsF& margins ) noexcept
|
||||
: QMarginsF( margins )
|
||||
{
|
||||
}
|
||||
|
||||
constexpr inline QskMargins::QskMargins( const QMargins& margins ) noexcept:
|
||||
QMarginsF( margins )
|
||||
constexpr inline QskMargins::QskMargins( const QMargins& margins ) noexcept
|
||||
: QMarginsF( margins )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@
|
|||
#include "QskMetaFunction.h"
|
||||
|
||||
#include <qcoreapplication.h>
|
||||
#include <qthread.h>
|
||||
#include <qobject.h>
|
||||
#include <qsemaphore.h>
|
||||
#include <qthread.h>
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qobject_p.h>
|
||||
|
|
@ -50,8 +50,8 @@ int QskMetaFunction::FunctionCall::typeInfo() const
|
|||
|
||||
int value;
|
||||
|
||||
reinterpret_cast< SlotObject* >( that )->invoke( TypeInfo, that,
|
||||
nullptr, reinterpret_cast< void** >( &value ), nullptr );
|
||||
reinterpret_cast< SlotObject* >( that )->invoke(
|
||||
TypeInfo, that, nullptr, reinterpret_cast< void** >( &value ), nullptr );
|
||||
|
||||
return value;
|
||||
}
|
||||
|
|
@ -62,27 +62,27 @@ int QskMetaFunction::FunctionCall::refCount() const
|
|||
return reinterpret_cast< SlotObject* >( that )->ref.load();
|
||||
}
|
||||
|
||||
QskMetaFunction::QskMetaFunction():
|
||||
m_functionCall( nullptr )
|
||||
QskMetaFunction::QskMetaFunction()
|
||||
: m_functionCall( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
QskMetaFunction::QskMetaFunction( FunctionCall* functionCall ):
|
||||
m_functionCall( functionCall )
|
||||
QskMetaFunction::QskMetaFunction( FunctionCall* functionCall )
|
||||
: m_functionCall( functionCall )
|
||||
{
|
||||
if ( m_functionCall )
|
||||
m_functionCall->ref();
|
||||
}
|
||||
|
||||
QskMetaFunction::QskMetaFunction( const QskMetaFunction& other ):
|
||||
m_functionCall( other.m_functionCall )
|
||||
QskMetaFunction::QskMetaFunction( const QskMetaFunction& other )
|
||||
: m_functionCall( other.m_functionCall )
|
||||
{
|
||||
if ( m_functionCall )
|
||||
m_functionCall->ref();
|
||||
}
|
||||
|
||||
QskMetaFunction::QskMetaFunction( QskMetaFunction&& other ):
|
||||
m_functionCall( other.m_functionCall )
|
||||
QskMetaFunction::QskMetaFunction( QskMetaFunction&& other )
|
||||
: m_functionCall( other.m_functionCall )
|
||||
{
|
||||
other.m_functionCall = nullptr;
|
||||
}
|
||||
|
|
@ -177,8 +177,8 @@ QskMetaFunction::Type QskMetaFunction::functionType() const
|
|||
return static_cast< QskMetaFunction::Type >( m_functionCall->typeInfo() );
|
||||
}
|
||||
|
||||
void QskMetaFunction::invoke(
|
||||
QObject* object, void* argv[], Qt::ConnectionType connectionType )
|
||||
void QskMetaFunction::invoke( QObject* object,
|
||||
void* argv[], Qt::ConnectionType connectionType )
|
||||
{
|
||||
#if 1
|
||||
/*
|
||||
|
|
@ -211,8 +211,8 @@ void QskMetaFunction::invoke(
|
|||
}
|
||||
case Qt::BlockingQueuedConnection:
|
||||
{
|
||||
if ( receiver.isNull()
|
||||
|| ( receiver->thread() == QThread::currentThread() ) )
|
||||
if ( receiver.isNull() ||
|
||||
( receiver->thread() == QThread::currentThread() ) )
|
||||
{
|
||||
// We would end up in a deadlock, better do nothing
|
||||
return;
|
||||
|
|
@ -220,8 +220,8 @@ void QskMetaFunction::invoke(
|
|||
|
||||
QSemaphore semaphore;
|
||||
|
||||
qskInvokeFunctionQueued( receiver, m_functionCall,
|
||||
0, nullptr, argv, &semaphore );
|
||||
qskInvokeFunctionQueued( receiver,
|
||||
m_functionCall, 0, nullptr, argv, &semaphore );
|
||||
|
||||
semaphore.acquire();
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@
|
|||
|
||||
#include <qmetaobject.h>
|
||||
#include <qobject.h>
|
||||
|
||||
#include <qthread.h>
|
||||
#include <qcoreapplication.h>
|
||||
#include <qsemaphore.h>
|
||||
#include <qthread.h>
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qobject_p.h>
|
||||
|
|
@ -24,8 +23,8 @@ namespace
|
|||
class Function : public QskMetaFunction
|
||||
{
|
||||
public:
|
||||
inline Function( void* functionCall ):
|
||||
QskMetaFunction( static_cast< FunctionCall* >( functionCall ) )
|
||||
inline Function( void* functionCall )
|
||||
: QskMetaFunction( static_cast< FunctionCall* >( functionCall ) )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -45,14 +44,15 @@ namespace
|
|||
class MetaCallEvent final : public QMetaCallEvent
|
||||
{
|
||||
public:
|
||||
MetaCallEvent( QMetaObject::Call call, CallFunction callFunction,
|
||||
ushort offset, ushort index,
|
||||
int nargs, int* types, void* args[], QSemaphore* semaphore = nullptr ):
|
||||
QMetaCallEvent( offset, index, callFunction, nullptr, -1,
|
||||
nargs, types, args, semaphore ),
|
||||
m_call( call ),
|
||||
m_callFunction( callFunction ),
|
||||
m_index( index )
|
||||
MetaCallEvent(
|
||||
QMetaObject::Call call, CallFunction callFunction, ushort offset,
|
||||
ushort index, int nargs, int* types, void* args[],
|
||||
QSemaphore* semaphore = nullptr )
|
||||
: QMetaCallEvent( offset, index, callFunction, nullptr, -1,
|
||||
nargs, types, args, semaphore )
|
||||
, m_call( call )
|
||||
, m_callFunction( callFunction )
|
||||
, m_index( index )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -70,9 +70,10 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
static inline void qskInvokeMetaCallQueued( QObject* object,
|
||||
QMetaObject::Call call, ushort offset, ushort index,
|
||||
int nargs, int* types, void* args[], QSemaphore* semaphore = nullptr )
|
||||
static inline void qskInvokeMetaCallQueued(
|
||||
QObject* object, QMetaObject::Call call, ushort offset,
|
||||
ushort index, int nargs, int* types, void* args[],
|
||||
QSemaphore* semaphore = nullptr )
|
||||
{
|
||||
const auto callFunction = object->metaObject()->d.static_metacall;
|
||||
|
||||
|
|
@ -136,9 +137,10 @@ QMetaMethod qskNotifySignal( const QMetaObject* metaObject, const char* property
|
|||
return QMetaMethod();
|
||||
}
|
||||
|
||||
static void qskInvokeMetaCall( QObject* object,
|
||||
const QMetaObject* metaObject, QMetaObject::Call call,
|
||||
int offset, int index, void* argv[], Qt::ConnectionType connectionType )
|
||||
static void qskInvokeMetaCall(
|
||||
QObject* object, const QMetaObject* metaObject,
|
||||
QMetaObject::Call call, int offset, int index, void* argv[],
|
||||
Qt::ConnectionType connectionType )
|
||||
{
|
||||
QPointer< QObject > receiver( object );
|
||||
|
||||
|
|
@ -172,8 +174,8 @@ static void qskInvokeMetaCall( QObject* object,
|
|||
}
|
||||
case Qt::BlockingQueuedConnection:
|
||||
{
|
||||
if ( receiver.isNull()
|
||||
|| ( receiver->thread() == QThread::currentThread() ) )
|
||||
if ( receiver.isNull() ||
|
||||
( receiver->thread() == QThread::currentThread() ) )
|
||||
{
|
||||
// We would end up in a deadlock, better do nothing
|
||||
return;
|
||||
|
|
@ -181,8 +183,8 @@ static void qskInvokeMetaCall( QObject* object,
|
|||
|
||||
QSemaphore semaphore;
|
||||
|
||||
qskInvokeMetaCallQueued( receiver, call, offset, index,
|
||||
0, nullptr, argv, &semaphore );
|
||||
qskInvokeMetaCallQueued( receiver, call,
|
||||
offset, index, 0, nullptr, argv, &semaphore );
|
||||
|
||||
semaphore.acquire();
|
||||
|
||||
|
|
@ -260,21 +262,20 @@ static void qskInvokeMetaCall( QObject* object,
|
|||
}
|
||||
}
|
||||
|
||||
void qskInvokeMetaPropertyWrite( QObject* context,
|
||||
const QMetaProperty& property, void* args[], Qt::ConnectionType connectionType )
|
||||
void qskInvokeMetaPropertyWrite( QObject* context, const QMetaProperty& property,
|
||||
void* args[], Qt::ConnectionType connectionType )
|
||||
{
|
||||
qskInvokeMetaPropertyWrite( context, property.enclosingMetaObject(),
|
||||
property.propertyIndex(), args, connectionType );
|
||||
}
|
||||
|
||||
void qskInvokeMetaPropertyWrite( QObject* context,
|
||||
const QMetaObject* metaObject, int propertyIndex,
|
||||
void* args[], Qt::ConnectionType connectionType )
|
||||
void qskInvokeMetaPropertyWrite( QObject* context, const QMetaObject* metaObject,
|
||||
int propertyIndex, void* args[], Qt::ConnectionType connectionType )
|
||||
{
|
||||
// check for is writable ???
|
||||
|
||||
if ( metaObject && ( propertyIndex >= 0 )
|
||||
&& ( propertyIndex < metaObject->propertyCount() ) )
|
||||
if ( metaObject && ( propertyIndex >= 0 ) &&
|
||||
( propertyIndex < metaObject->propertyCount() ) )
|
||||
{
|
||||
const auto offset = metaObject->propertyOffset();
|
||||
const auto index = propertyIndex - offset;
|
||||
|
|
@ -296,10 +297,9 @@ void qskInvokeMetaMethod( QObject* object,
|
|||
const QMetaObject* metaObject, int methodIndex, void* argv[],
|
||||
Qt::ConnectionType connectionType )
|
||||
{
|
||||
if ( metaObject && ( methodIndex >= 0 )
|
||||
&& ( methodIndex < metaObject->methodCount() ) )
|
||||
if ( metaObject && ( methodIndex >= 0 ) &&
|
||||
( methodIndex < metaObject->methodCount() ) )
|
||||
{
|
||||
|
||||
const auto offset = metaObject->methodOffset();
|
||||
const auto index = methodIndex - offset;
|
||||
|
||||
|
|
@ -308,37 +308,37 @@ void qskInvokeMetaMethod( QObject* object,
|
|||
}
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaMethod& method ):
|
||||
m_metaData { method.enclosingMetaObject(), method.methodIndex() },
|
||||
m_type( MetaMethod )
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaMethod& method )
|
||||
: m_metaData{ method.enclosingMetaObject(), method.methodIndex() }
|
||||
, m_type( MetaMethod )
|
||||
{
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QObject* object, const char* methodName ):
|
||||
QskMetaInvokable( qskMetaMethod( object, methodName ) )
|
||||
QskMetaInvokable::QskMetaInvokable( const QObject* object, const char* methodName )
|
||||
: QskMetaInvokable( qskMetaMethod( object, methodName ) )
|
||||
{
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaObject* metaObject, const char* methodName ):
|
||||
QskMetaInvokable( qskMetaMethod( metaObject, methodName ) )
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaObject* metaObject, const char* methodName )
|
||||
: QskMetaInvokable( qskMetaMethod( metaObject, methodName ) )
|
||||
{
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaProperty& property ):
|
||||
m_metaData { property.enclosingMetaObject(), property.propertyIndex() },
|
||||
m_type( MetaProperty )
|
||||
QskMetaInvokable::QskMetaInvokable( const QMetaProperty& property )
|
||||
: m_metaData{ property.enclosingMetaObject(), property.propertyIndex() }
|
||||
, m_type( MetaProperty )
|
||||
{
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QskMetaFunction& function ):
|
||||
m_functionData { function.functionCall() },
|
||||
m_type( MetaFunction )
|
||||
QskMetaInvokable::QskMetaInvokable( const QskMetaFunction& function )
|
||||
: m_functionData{ function.functionCall() }
|
||||
, m_type( MetaFunction )
|
||||
{
|
||||
Function::ref( m_functionData.functionCall );
|
||||
}
|
||||
|
||||
QskMetaInvokable::QskMetaInvokable( const QskMetaInvokable& other ):
|
||||
m_type( other.m_type )
|
||||
QskMetaInvokable::QskMetaInvokable( const QskMetaInvokable& other )
|
||||
: m_type( other.m_type )
|
||||
{
|
||||
switch ( m_type )
|
||||
{
|
||||
|
|
@ -415,8 +415,8 @@ bool QskMetaInvokable::operator==( const QskMetaInvokable& other ) const
|
|||
case MetaMethod:
|
||||
case MetaProperty:
|
||||
{
|
||||
return ( m_metaData.metaObject == other.m_metaData.metaObject )
|
||||
&& ( m_metaData.index == other.m_metaData.index );
|
||||
return ( m_metaData.metaObject == other.m_metaData.metaObject ) &&
|
||||
( m_metaData.index == other.m_metaData.index );
|
||||
}
|
||||
case MetaFunction:
|
||||
{
|
||||
|
|
@ -606,9 +606,8 @@ void QskMetaInvokable::invoke( QObject* object, void* args[],
|
|||
}
|
||||
case MetaProperty:
|
||||
{
|
||||
qskInvokeMetaPropertyWrite( object,
|
||||
m_metaData.metaObject, m_metaData.index,
|
||||
args, connectionType );
|
||||
qskInvokeMetaPropertyWrite(
|
||||
object, m_metaData.metaObject, m_metaData.index, args, connectionType );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ private:
|
|||
int m_type : 3;
|
||||
};
|
||||
|
||||
inline QskMetaInvokable::QskMetaInvokable():
|
||||
m_type( Invalid )
|
||||
inline QskMetaInvokable::QskMetaInvokable()
|
||||
: m_type( Invalid )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -135,11 +135,9 @@ QSK_EXPORT void qskInvokeMetaPropertyWrite(
|
|||
const QObject* object, const QMetaProperty&,
|
||||
void* args[], Qt::ConnectionType = Qt::AutoConnection );
|
||||
|
||||
|
||||
QSK_EXPORT QMetaMethod qskNotifySignal( const QMetaObject*, const char* propertyName );
|
||||
QSK_EXPORT QMetaMethod qskNotifySignal( const QObject*, const char* propertyName );
|
||||
|
||||
|
||||
Q_DECLARE_METATYPE( QskMetaInvokable )
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -5,33 +5,34 @@
|
|||
|
||||
#include "QskModule.h"
|
||||
|
||||
#include "QskSetup.h"
|
||||
#include "QskSkinManager.h"
|
||||
#include "QskSkin.h"
|
||||
#include "QskPushButton.h"
|
||||
#include "QskCorner.h"
|
||||
#include "QskDialog.h"
|
||||
#include "QskDialogButton.h"
|
||||
#include "QskDialogButtonBox.h"
|
||||
#include "QskDialogWindow.h"
|
||||
#include "QskDialogSubWindow.h"
|
||||
#include "QskDialogWindow.h"
|
||||
#include "QskFocusIndicator.h"
|
||||
#include "QskGradient.h"
|
||||
#include "QskGraphicLabel.h"
|
||||
#include "QskGridBox.h"
|
||||
#include "QskVirtualKeyboard.h"
|
||||
#include "QskLinearBox.h"
|
||||
#include "QskMessageWindow.h"
|
||||
#include "QskPopup.h"
|
||||
#include "QskPushButton.h"
|
||||
#include "QskRgbValue.h"
|
||||
#include "QskScrollView.h"
|
||||
#include "QskScrollArea.h"
|
||||
#include "QskScrollView.h"
|
||||
#include "QskSelectionWindow.h"
|
||||
#include "QskSeparator.h"
|
||||
#include "QskSimpleListBox.h"
|
||||
#include "QskSetup.h"
|
||||
#include "QskShortcut.h"
|
||||
#include "QskSimpleListBox.h"
|
||||
#include "QskSkin.h"
|
||||
#include "QskSkinManager.h"
|
||||
#include "QskSlider.h"
|
||||
#include "QskStackBox.h"
|
||||
#include "QskStandardSymbol.h"
|
||||
#include "QskStatusIndicator.h"
|
||||
#include "QskLinearBox.h"
|
||||
#include "QskPopup.h"
|
||||
#include "QskSubWindow.h"
|
||||
#include "QskSubWindowArea.h"
|
||||
#include "QskTabBar.h"
|
||||
|
|
@ -39,17 +40,16 @@
|
|||
#include "QskTabView.h"
|
||||
#include "QskTextLabel.h"
|
||||
#include "QskTextOptions.h"
|
||||
#include "QskMessageWindow.h"
|
||||
#include "QskSelectionWindow.h"
|
||||
#include "QskVirtualKeyboard.h"
|
||||
#include "QskWindow.h"
|
||||
|
||||
#include <qstringlist.h>
|
||||
#include <qmargins.h>
|
||||
#include <qjsvalueiterator.h>
|
||||
#include <qmargins.h>
|
||||
#include <qstringlist.h>
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qqmlmetatype_p.h>
|
||||
#include <private/qqmlglobal_p.h>
|
||||
#include <private/qqmlmetatype_p.h>
|
||||
#include <private/qvariantanimation_p.h>
|
||||
QSK_QT_PRIVATE_END
|
||||
|
||||
|
|
@ -105,7 +105,8 @@ public:
|
|||
// Expose values in QskRgbValue to QML
|
||||
struct QskRgbValue_Gadget
|
||||
{
|
||||
enum Enum {
|
||||
enum Enum
|
||||
{
|
||||
#define RGB( name, value ) name = value,
|
||||
QSK_RGB_VALUES
|
||||
#undef RGB
|
||||
|
|
@ -138,8 +139,8 @@ class QskSetupFlagsProvider : public QskSetup::Flags
|
|||
Q_GADGET
|
||||
public:
|
||||
template< typename... Args >
|
||||
QskSetupFlagsProvider( Args&& ... args ):
|
||||
QskSetup::Flags( std::forward< Args >( args ) ... )
|
||||
QskSetupFlagsProvider( Args&&... args )
|
||||
: QskSetup::Flags( std::forward< Args >( args )... )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -163,8 +164,8 @@ public:
|
|||
Q_CLASSINFO( "DefaultProperty", "data" )
|
||||
|
||||
public:
|
||||
QskMain( QObject* parent = nullptr ):
|
||||
QObject( parent )
|
||||
QskMain( QObject* parent = nullptr )
|
||||
: QObject( parent )
|
||||
{
|
||||
// how to supress warnings about a missing skinListChanged
|
||||
// as we don't have it ??
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
|
||||
#include "QskObjectCounter.h"
|
||||
|
||||
#include <qset.h>
|
||||
#include <qdebug.h>
|
||||
#include <qset.h>
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qhooks_p.h>
|
||||
#include <private/qquickitem_p.h>
|
||||
#include <private/qobject_p.h>
|
||||
#include <private/qquickitem_p.h>
|
||||
QSK_QT_PRIVATE_END
|
||||
|
||||
static inline bool qskIsItem( const QObject* object )
|
||||
|
|
@ -148,8 +148,8 @@ static void qskInstallCleanupHookHandler()
|
|||
|
||||
Q_COREAPP_STARTUP_FUNCTION( qskInstallCleanupHookHandler )
|
||||
|
||||
QskObjectCounter::QskObjectCounter( bool debugAtDestruction ):
|
||||
m_debugAtDestruction( debugAtDestruction )
|
||||
QskObjectCounter::QskObjectCounter( bool debugAtDestruction )
|
||||
: m_debugAtDestruction( debugAtDestruction )
|
||||
{
|
||||
setActive( true );
|
||||
}
|
||||
|
|
@ -271,4 +271,3 @@ QDebug operator<<( QDebug debug, const QskObjectCounter& counter )
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#define QSK_SIZE_POLICY_H_
|
||||
|
||||
#include "QskGlobal.h"
|
||||
|
||||
#include <qmetatype.h>
|
||||
|
||||
class QDebug;
|
||||
|
|
@ -15,8 +16,11 @@ class QSK_EXPORT QskSizePolicy
|
|||
{
|
||||
Q_GADGET
|
||||
|
||||
Q_PROPERTY( Policy horizontalPolicy READ horizontalPolicy WRITE setHorizontalPolicy )
|
||||
Q_PROPERTY( Policy verticalPolicy READ verticalPolicy WRITE setVerticalPolicy )
|
||||
Q_PROPERTY( Policy horizontalPolicy
|
||||
READ horizontalPolicy WRITE setHorizontalPolicy )
|
||||
|
||||
Q_PROPERTY( Policy verticalPolicy
|
||||
READ verticalPolicy WRITE setVerticalPolicy )
|
||||
|
||||
public:
|
||||
enum Flag
|
||||
|
|
@ -62,22 +66,23 @@ private:
|
|||
quint32 m_verticalPolicy : 4;
|
||||
};
|
||||
|
||||
inline QskSizePolicy::QskSizePolicy():
|
||||
m_horizontalPolicy( Ignored ),
|
||||
m_verticalPolicy( Ignored )
|
||||
inline QskSizePolicy::QskSizePolicy()
|
||||
: m_horizontalPolicy( Ignored )
|
||||
, m_verticalPolicy( Ignored )
|
||||
{
|
||||
}
|
||||
|
||||
inline QskSizePolicy::QskSizePolicy( Policy horizontalPolicy, Policy verticalPolicy ):
|
||||
m_horizontalPolicy( horizontalPolicy ),
|
||||
m_verticalPolicy( verticalPolicy )
|
||||
inline QskSizePolicy::QskSizePolicy(
|
||||
Policy horizontalPolicy, Policy verticalPolicy )
|
||||
: m_horizontalPolicy( horizontalPolicy )
|
||||
, m_verticalPolicy( verticalPolicy )
|
||||
{
|
||||
}
|
||||
|
||||
inline bool QskSizePolicy::operator==( const QskSizePolicy& other ) const
|
||||
{
|
||||
return ( other.m_horizontalPolicy == m_horizontalPolicy )
|
||||
&& ( other.m_verticalPolicy == m_verticalPolicy );
|
||||
return ( other.m_horizontalPolicy == m_horizontalPolicy ) &&
|
||||
( other.m_verticalPolicy == m_verticalPolicy );
|
||||
}
|
||||
|
||||
inline bool QskSizePolicy::operator!=( const QskSizePolicy& other ) const
|
||||
|
|
|
|||
|
|
@ -6,18 +6,12 @@
|
|||
#include "QskTextColors.h"
|
||||
#include "QskRgbValue.h"
|
||||
|
||||
#include <qvariant.h>
|
||||
#include <qhashfunctions.h>
|
||||
#include <qvariant.h>
|
||||
|
||||
uint QskTextColors::hash( uint seed ) const
|
||||
{
|
||||
const QRgb rgb[] =
|
||||
{
|
||||
textColor.rgba(),
|
||||
styleColor.rgba(),
|
||||
linkColor.rgba()
|
||||
};
|
||||
|
||||
const QRgb rgb[] = { textColor.rgba(), styleColor.rgba(), linkColor.rgba() };
|
||||
return qHashBits( rgb, sizeof( rgb ), seed );
|
||||
}
|
||||
|
||||
|
|
@ -30,11 +24,10 @@ QskTextColors QskTextColors::interpolated(
|
|||
colors.linkColor = QskRgbValue::interpolated( linkColor, to.linkColor, ratio );
|
||||
|
||||
return colors;
|
||||
|
||||
}
|
||||
|
||||
QVariant QskTextColors::interpolate( const QskTextColors& from,
|
||||
const QskTextColors& to, qreal ratio )
|
||||
QVariant QskTextColors::interpolate(
|
||||
const QskTextColors& from, const QskTextColors& to, qreal ratio )
|
||||
{
|
||||
return QVariant::fromValue( from.interpolated( to, ratio ) );
|
||||
}
|
||||
|
|
@ -74,5 +67,3 @@ QDebug operator<<( QDebug debug, const QskTextColors& colors )
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#define QSK_TEXT_COLORS_H
|
||||
|
||||
#include "QskGlobal.h"
|
||||
|
||||
#include <qcolor.h>
|
||||
#include <qmetatype.h>
|
||||
|
||||
|
|
@ -32,10 +33,10 @@ public:
|
|||
};
|
||||
|
||||
inline QskTextColors::QskTextColors(
|
||||
const QColor& text, const QColor& style, const QColor& link ):
|
||||
textColor( text ),
|
||||
styleColor( style ),
|
||||
linkColor( link )
|
||||
const QColor& text, const QColor& style, const QColor& link )
|
||||
: textColor( text )
|
||||
, styleColor( style )
|
||||
, linkColor( link )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@
|
|||
#include <qtextdocument.h>
|
||||
#include <limits>
|
||||
|
||||
QskTextOptions::QskTextOptions():
|
||||
m_maximumLineCount( std::numeric_limits< int >::max() ),
|
||||
m_fontSizeMode( QskTextOptions::FixedSize ),
|
||||
m_wrapMode( QskTextOptions::NoWrap ),
|
||||
m_format( PlainText ), // AutoText ???
|
||||
m_elideMode( Qt::ElideNone )
|
||||
QskTextOptions::QskTextOptions()
|
||||
: m_maximumLineCount( std::numeric_limits< int >::max() )
|
||||
, m_fontSizeMode( QskTextOptions::FixedSize )
|
||||
, m_wrapMode( QskTextOptions::NoWrap )
|
||||
, m_format( PlainText ) // AutoText ???
|
||||
, m_elideMode( Qt::ElideNone )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ int QskTextOptions::textFlags() const
|
|||
|
||||
switch ( m_wrapMode )
|
||||
{
|
||||
case QTextOption::NoWrap:
|
||||
case QskTextOptions::NoWrap:
|
||||
{
|
||||
flags |= Qt::TextSingleLine;
|
||||
break;
|
||||
|
|
@ -101,11 +101,11 @@ int QskTextOptions::textFlags() const
|
|||
|
||||
bool QskTextOptions::operator==( const QskTextOptions& other ) const
|
||||
{
|
||||
return ( m_format == other.m_format )
|
||||
&& ( m_elideMode == other.m_elideMode )
|
||||
&& ( m_wrapMode == other.m_wrapMode )
|
||||
&& ( m_fontSizeMode == other.m_fontSizeMode )
|
||||
&& ( m_maximumLineCount == other.m_maximumLineCount );
|
||||
return ( m_format == other.m_format ) &&
|
||||
( m_elideMode == other.m_elideMode ) &&
|
||||
( m_wrapMode == other.m_wrapMode ) &&
|
||||
( m_fontSizeMode == other.m_fontSizeMode ) &&
|
||||
( m_maximumLineCount == other.m_maximumLineCount );
|
||||
}
|
||||
|
||||
QskTextOptions::TextFormat QskTextOptions::effectiveFormat( const QString& text ) const
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ static QskAbstractButton* qskCheckedSibling( const QskAbstractButton* button )
|
|||
class QskAbstractButton::PrivateData
|
||||
{
|
||||
public:
|
||||
PrivateData():
|
||||
autoRepeatDelay( 300 ),
|
||||
autoRepeatInterval( 100 ),
|
||||
exclusive( false ),
|
||||
autoRepeat( false )
|
||||
PrivateData()
|
||||
: autoRepeatDelay( 300 )
|
||||
, autoRepeatInterval( 100 )
|
||||
, exclusive( false )
|
||||
, autoRepeat( false )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -54,9 +54,9 @@ public:
|
|||
bool autoRepeat : 1;
|
||||
};
|
||||
|
||||
QskAbstractButton::QskAbstractButton( QQuickItem* parent ):
|
||||
Inherited( parent ),
|
||||
m_data( new PrivateData() )
|
||||
QskAbstractButton::QskAbstractButton( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setAcceptedMouseButtons( Qt::LeftButton );
|
||||
|
|
|
|||
|
|
@ -13,19 +13,26 @@ class QSK_EXPORT QskAbstractButton : public QskControl
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL )
|
||||
Q_PROPERTY( bool checkable READ isCheckable
|
||||
WRITE setCheckable NOTIFY checkableChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool autoRepeat READ autoRepeat
|
||||
WRITE setAutoRepeat NOTIFY autoRepeatChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool autoRepeat READ autoRepeat WRITE setAutoRepeat NOTIFY autoRepeatChanged FINAL )
|
||||
Q_PROPERTY( int autoRepeatDelay READ autoRepeatDelay
|
||||
WRITE setAutoRepeatDelay NOTIFY autoRepeatDelayChanged FINAL )
|
||||
|
||||
Q_PROPERTY( int autoRepeatInterval READ autoRepeatInterval
|
||||
WRITE setAutoRepeatInterval NOTIFY autoRepeatIntervalChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool exclusive READ exclusive
|
||||
WRITE setExclusive NOTIFY exclusiveChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool pressed READ isPressed WRITE setPressed NOTIFY pressedChanged FINAL )
|
||||
Q_PROPERTY( bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL )
|
||||
Q_PROPERTY( bool pressed READ isPressed
|
||||
WRITE setPressed NOTIFY pressedChanged FINAL )
|
||||
|
||||
Q_PROPERTY( bool checked READ isChecked
|
||||
WRITE setChecked NOTIFY checkedChanged FINAL )
|
||||
|
||||
using Inherited = QskControl;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,16 +14,16 @@
|
|||
class QSK_EXPORT QskAnimationHint
|
||||
{
|
||||
public:
|
||||
inline constexpr QskAnimationHint() noexcept:
|
||||
duration( 0 ),
|
||||
type( QEasingCurve::Linear )
|
||||
inline constexpr QskAnimationHint() noexcept
|
||||
: duration( 0 )
|
||||
, type( QEasingCurve::Linear )
|
||||
{
|
||||
}
|
||||
|
||||
inline constexpr QskAnimationHint( uint duration,
|
||||
QEasingCurve::Type type = QEasingCurve::Linear ) noexcept:
|
||||
duration( duration ),
|
||||
type( type )
|
||||
QEasingCurve::Type type = QEasingCurve::Linear ) noexcept
|
||||
: duration( duration )
|
||||
, type( type )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@
|
|||
|
||||
#include "QskAnimator.h"
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qvector.h>
|
||||
#include <qquickwindow.h>
|
||||
#include <qelapsedtimer.h>
|
||||
#include <qglobalstatic.h>
|
||||
#include <qobject.h>
|
||||
#include <qquickwindow.h>
|
||||
#include <qvector.h>
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
#include <qdebug.h>
|
||||
|
|
@ -106,8 +106,8 @@ private:
|
|||
mutable int m_index; // current value, when iterating
|
||||
};
|
||||
|
||||
QskAnimatorDriver::QskAnimatorDriver():
|
||||
m_index( -1 )
|
||||
QskAnimatorDriver::QskAnimatorDriver()
|
||||
: m_index( -1 )
|
||||
{
|
||||
m_referenceTime.start();
|
||||
}
|
||||
|
|
@ -198,7 +198,7 @@ void QskAnimatorDriver::advanceAnimators( QQuickWindow* window )
|
|||
// Advancing animators might create/remove animators, what is handled by
|
||||
// adjusting m_index in register/unregister
|
||||
|
||||
QskAnimator* animator = m_animators[m_index];
|
||||
auto animator = m_animators[ m_index ];
|
||||
if ( animator->window() == window )
|
||||
{
|
||||
hasAnimators = true;
|
||||
|
|
@ -230,10 +230,10 @@ void QskAnimatorDriver::advanceAnimators( QQuickWindow* window )
|
|||
Q_GLOBAL_STATIC( QskAnimatorDriver, qskAnimatorDriver )
|
||||
Q_GLOBAL_STATIC( Statistics, qskStatistics )
|
||||
|
||||
QskAnimator::QskAnimator():
|
||||
m_window( nullptr ),
|
||||
m_duration( 200 ),
|
||||
m_startTime( -1 )
|
||||
QskAnimator::QskAnimator()
|
||||
: m_window( nullptr )
|
||||
, m_duration( 200 )
|
||||
, m_startTime( -1 )
|
||||
{
|
||||
if ( qskStatistics )
|
||||
qskStatistics->increment();
|
||||
|
|
@ -362,15 +362,15 @@ void QskAnimator::done()
|
|||
// we should also have functor based callbacks too. TODO ...
|
||||
#endif
|
||||
|
||||
QMetaObject::Connection QskAnimator::addCleanupHandler( QObject* receiver,
|
||||
const char* method, Qt::ConnectionType type )
|
||||
QMetaObject::Connection QskAnimator::addCleanupHandler(
|
||||
QObject* receiver, const char* method, Qt::ConnectionType type )
|
||||
{
|
||||
return QObject::connect( qskAnimatorDriver,
|
||||
SIGNAL(terminated(QQuickWindow*)), receiver, method, type );
|
||||
}
|
||||
|
||||
QMetaObject::Connection QskAnimator::addAdvanceHandler( QObject* receiver,
|
||||
const char* method, Qt::ConnectionType type )
|
||||
QMetaObject::Connection QskAnimator::addAdvanceHandler(
|
||||
QObject* receiver, const char* method, Qt::ConnectionType type )
|
||||
{
|
||||
return QObject::connect( qskAnimatorDriver,
|
||||
SIGNAL(advanced(QQuickWindow*)), receiver, method, type );
|
||||
|
|
|
|||
|
|
@ -38,11 +38,13 @@ public:
|
|||
void stop();
|
||||
void update();
|
||||
|
||||
static QMetaObject::Connection addCleanupHandler( QObject* receiver,
|
||||
const char* method, Qt::ConnectionType type = Qt::AutoConnection );
|
||||
static QMetaObject::Connection addCleanupHandler(
|
||||
QObject* receiver, const char* method,
|
||||
Qt::ConnectionType type = Qt::AutoConnection );
|
||||
|
||||
static QMetaObject::Connection addAdvanceHandler( QObject* receiver,
|
||||
const char* method, Qt::ConnectionType type = Qt::AutoConnection );
|
||||
static QMetaObject::Connection addAdvanceHandler(
|
||||
QObject* receiver, const char* method,
|
||||
Qt::ConnectionType type = Qt::AutoConnection );
|
||||
|
||||
#ifndef QT_NO_DEBUG_STREAM
|
||||
static void debugStatistics( QDebug );
|
||||
|
|
@ -72,4 +74,3 @@ inline int QskAnimator::duration() const
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
|
||||
QSK_SUBCONTROL( QskBox, Panel )
|
||||
|
||||
QskBox::QskBox( QQuickItem* parent ):
|
||||
Inherited( parent )
|
||||
QskBox::QskBox( QQuickItem* parent )
|
||||
: Inherited( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include "QskBoxSkinlet.h"
|
||||
#include "QskBox.h"
|
||||
|
||||
QskBoxSkinlet::QskBoxSkinlet( QskSkin* skin ):
|
||||
Inherited( skin )
|
||||
QskBoxSkinlet::QskBoxSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { PanelRole } );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,4 +33,3 @@ protected:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -4,17 +4,17 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "QskControl.h"
|
||||
#include "QskQuick.h"
|
||||
#include "QskAspect.h"
|
||||
#include "QskSetup.h"
|
||||
#include "QskEvent.h"
|
||||
#include "QskDirtyItemFilter.h"
|
||||
#include "QskSkinHintTable.h"
|
||||
#include "QskEvent.h"
|
||||
#include "QskQuick.h"
|
||||
#include "QskSetup.h"
|
||||
#include "QskSkin.h"
|
||||
#include "QskSkinHintTable.h"
|
||||
|
||||
#include <qglobalstatic.h>
|
||||
#include <qlocale.h>
|
||||
#include <qvector.h>
|
||||
#include <qglobalstatic.h>
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qquickitem_p.h>
|
||||
|
|
@ -70,9 +70,9 @@ namespace
|
|||
class QskWindowStore
|
||||
{
|
||||
public:
|
||||
QskWindowStore():
|
||||
m_refCount( 0 ),
|
||||
m_window( nullptr )
|
||||
QskWindowStore()
|
||||
: m_refCount( 0 )
|
||||
, m_window( nullptr )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -171,22 +171,22 @@ public:
|
|||
{ qskDefaultSizeHints[ 0 ], qskDefaultSizeHints[ 1 ], qskDefaultSizeHints[ 2 ] };
|
||||
};
|
||||
|
||||
QskControlPrivate():
|
||||
explicitSizeData( nullptr ),
|
||||
sizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Preferred ),
|
||||
controlFlags( qskControlFlags() ),
|
||||
controlFlagsMask( 0 ),
|
||||
explicitLocale( false ),
|
||||
autoFillBackground( false ),
|
||||
autoLayoutChildren( false ),
|
||||
polishOnResize( false ),
|
||||
blockedPolish( false ),
|
||||
blockedImplicitSize( true ),
|
||||
clearPreviousNodes( false ),
|
||||
blockImplicitSizeNotification( false ),
|
||||
isInitiallyPainted( false ),
|
||||
focusPolicy( Qt::NoFocus ),
|
||||
isWheelEnabled( false )
|
||||
QskControlPrivate()
|
||||
: explicitSizeData( nullptr )
|
||||
, sizePolicy( QskSizePolicy::Preferred, QskSizePolicy::Preferred )
|
||||
, controlFlags( qskControlFlags() )
|
||||
, controlFlagsMask( 0 )
|
||||
, explicitLocale( false )
|
||||
, autoFillBackground( false )
|
||||
, autoLayoutChildren( false )
|
||||
, polishOnResize( false )
|
||||
, blockedPolish( false )
|
||||
, blockedImplicitSize( true )
|
||||
, clearPreviousNodes( false )
|
||||
, blockImplicitSizeNotification( false )
|
||||
, isInitiallyPainted( false )
|
||||
, focusPolicy( Qt::NoFocus )
|
||||
, isWheelEnabled( false )
|
||||
{
|
||||
if ( controlFlags & QskControl::DeferredLayout )
|
||||
{
|
||||
|
|
@ -273,7 +273,6 @@ public:
|
|||
return qskDefaultSizeHints[ whichHint ];
|
||||
}
|
||||
|
||||
|
||||
bool maybeGesture( QQuickItem* child, QEvent* event )
|
||||
{
|
||||
Q_Q( QskControl );
|
||||
|
|
@ -364,8 +363,8 @@ static void qskUpdateControlFlags( QskControl::Flags flags, QskControl* control
|
|||
d->updateControlFlags( flags );
|
||||
}
|
||||
|
||||
QskControl::QskControl( QQuickItem* parent ):
|
||||
Inherited( *( new QskControlPrivate() ), parent )
|
||||
QskControl::QskControl( QQuickItem* parent )
|
||||
: Inherited( *( new QskControlPrivate() ), parent )
|
||||
{
|
||||
setFlag( QQuickItem::ItemHasContents, true );
|
||||
QQuickItem::setActiveFocusOnTab( false );
|
||||
|
|
@ -672,8 +671,8 @@ void QskControl::updateControlFlag( uint flag, bool on )
|
|||
{
|
||||
Q_D( QskControl );
|
||||
|
||||
if ( ( flag > std::numeric_limits< controlFlags_t >::max() )
|
||||
|| ( bool( d->controlFlags & flag ) == on ) )
|
||||
if ( ( flag > std::numeric_limits< controlFlags_t >::max() ) ||
|
||||
( bool( d->controlFlags & flag ) == on ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
@ -1119,8 +1118,8 @@ void QskControl::setFixedWidth( qreal width )
|
|||
|
||||
auto size = d->explicitSizeHint( Qt::PreferredSize );
|
||||
|
||||
if ( ( d->sizePolicy.horizontalPolicy() != QskSizePolicy::Fixed )
|
||||
|| ( size.width() != width ) )
|
||||
if ( ( d->sizePolicy.horizontalPolicy() != QskSizePolicy::Fixed ) ||
|
||||
( size.width() != width ) )
|
||||
{
|
||||
size.setWidth( width );
|
||||
|
||||
|
|
@ -1140,8 +1139,8 @@ void QskControl::setFixedHeight( qreal height )
|
|||
|
||||
auto size = d->explicitSizeHint( Qt::PreferredSize );
|
||||
|
||||
if ( ( d->sizePolicy.verticalPolicy() != QskSizePolicy::Fixed )
|
||||
|| ( size.height() != height ) )
|
||||
if ( ( d->sizePolicy.verticalPolicy() != QskSizePolicy::Fixed ) ||
|
||||
( size.height() != height ) )
|
||||
{
|
||||
size.setHeight( height );
|
||||
|
||||
|
|
@ -1807,8 +1806,8 @@ bool QskControl::isUpdateNodeScheduled() const
|
|||
{
|
||||
Q_D( const QskControl );
|
||||
|
||||
return ( d->dirtyAttributes & QQuickItemPrivate::ContentUpdateMask )
|
||||
&& ( d->flags & QQuickItem::ItemHasContents );
|
||||
return ( d->dirtyAttributes & QQuickItemPrivate::ContentUpdateMask ) &&
|
||||
( d->flags & QQuickItem::ItemHasContents );
|
||||
}
|
||||
|
||||
bool QskControl::isInitiallyPainted() const
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
#define QSK_CONTROL_H 1
|
||||
|
||||
#include "QskGlobal.h"
|
||||
#include "QskSkinnable.h"
|
||||
#include "QskAspect.h"
|
||||
#include "QskGradient.h"
|
||||
#include "QskSizePolicy.h"
|
||||
#include "QskAspect.h"
|
||||
#include "QskSkinnable.h"
|
||||
|
||||
#include <qquickitem.h>
|
||||
#include <qlocale.h>
|
||||
#include <qquickitem.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
|
|
@ -60,8 +60,11 @@ class QSK_EXPORT QskControl : public QQuickItem, public QskSkinnable
|
|||
WRITE setBackground RESET resetBackground NOTIFY backgroundChanged )
|
||||
|
||||
Q_PROPERTY( QskSizePolicy sizePolicy READ sizePolicy WRITE setSizePolicy )
|
||||
|
||||
Q_PROPERTY( QSizeF minimumSize READ minimumSize WRITE setMinimumSize )
|
||||
|
||||
Q_PROPERTY( QSizeF maximumSize READ maximumSize WRITE setMaximumSize )
|
||||
|
||||
Q_PROPERTY( QSizeF preferredSize READ preferredSize WRITE setPreferredSize )
|
||||
|
||||
Q_PROPERTY( QRectF geometry READ geometry WRITE setGeometry )
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@
|
|||
#include "QskControl.h"
|
||||
|
||||
QSK_QT_PRIVATE_BEGIN
|
||||
#include <private/qquickwindow_p.h>
|
||||
#include <private/qquickitem_p.h>
|
||||
#include <private/qquickwindow_p.h>
|
||||
QSK_QT_PRIVATE_END
|
||||
|
||||
static inline bool qskIsUpdateBlocked( const QQuickItem* item )
|
||||
|
|
@ -52,8 +52,8 @@ namespace
|
|||
class ResetBlockedDirtyJob final : public QRunnable
|
||||
{
|
||||
public:
|
||||
inline ResetBlockedDirtyJob( QQuickWindow* window ):
|
||||
m_window( window )
|
||||
inline ResetBlockedDirtyJob( QQuickWindow* window )
|
||||
: m_window( window )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -67,8 +67,8 @@ namespace
|
|||
};
|
||||
}
|
||||
|
||||
QskDirtyItemFilter::QskDirtyItemFilter( QObject* parent ):
|
||||
QObject( parent )
|
||||
QskDirtyItemFilter::QskDirtyItemFilter( QObject* parent )
|
||||
: QObject( parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -120,8 +120,8 @@ void QskDirtyItemFilter::beforeSynchronizing( QQuickWindow* window )
|
|||
}
|
||||
}
|
||||
|
||||
void QskDirtyItemFilter::filterDirtyList( QQuickWindow* window,
|
||||
bool ( *isBlocked )( const QQuickItem* ) )
|
||||
void QskDirtyItemFilter::filterDirtyList(
|
||||
QQuickWindow* window, bool ( *isBlocked )( const QQuickItem* ) )
|
||||
{
|
||||
if ( window == nullptr )
|
||||
return;
|
||||
|
|
@ -137,4 +137,3 @@ void QskDirtyItemFilter::filterDirtyList( QQuickWindow* window,
|
|||
item = nextItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/******************************************************************************
|
||||
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
||||
* This file may be used under the terms of the QSkinny License, Version 1.0
|
||||
*****************************************************************************/
|
||||
|
||||
#include "QskEvent.h"
|
||||
#include "QskGesture.h"
|
||||
|
||||
|
|
@ -40,18 +45,18 @@ int qskTabChainIncrement( const QEvent* event )
|
|||
return 0;
|
||||
}
|
||||
|
||||
QskEvent::QskEvent( QskEvent::Type type ):
|
||||
QEvent( static_cast< QEvent::Type >( type ) )
|
||||
QskEvent::QskEvent( QskEvent::Type type )
|
||||
: QEvent( static_cast< QEvent::Type >( type ) )
|
||||
{
|
||||
}
|
||||
|
||||
// -- QskGeometryChangeEvent
|
||||
|
||||
QskGeometryChangeEvent::QskGeometryChangeEvent(
|
||||
const QRectF& rect, const QRectF& oldRect ):
|
||||
QskEvent( QskEvent::GeometryChange ),
|
||||
m_rect( rect ),
|
||||
m_oldRect( oldRect )
|
||||
const QRectF& rect, const QRectF& oldRect )
|
||||
: QskEvent( QskEvent::GeometryChange )
|
||||
, m_rect( rect )
|
||||
, m_oldRect( oldRect )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -70,19 +75,20 @@ bool QskGeometryChangeEvent::isMoved() const
|
|||
// -- QskWindowChangeEvent
|
||||
|
||||
QskWindowChangeEvent::QskWindowChangeEvent(
|
||||
QQuickWindow* oldWindow, QQuickWindow* window ):
|
||||
QskEvent( QskEvent::WindowChange ),
|
||||
m_oldWindow( oldWindow ),
|
||||
m_window( window )
|
||||
QQuickWindow* oldWindow, QQuickWindow* window )
|
||||
: QskEvent( QskEvent::WindowChange )
|
||||
, m_oldWindow( oldWindow )
|
||||
, m_window( window )
|
||||
{
|
||||
}
|
||||
|
||||
// -- QskGestureEvent
|
||||
|
||||
QskGestureEvent::QskGestureEvent( const QskGesture* gesture, bool ownedByEvent ):
|
||||
QskEvent( QskEvent::Gesture ),
|
||||
m_gesture( gesture ),
|
||||
m_gestureOwnedByEvent( ownedByEvent )
|
||||
QskGestureEvent::QskGestureEvent(
|
||||
const QskGesture* gesture, bool ownedByEvent )
|
||||
: QskEvent( QskEvent::Gesture )
|
||||
, m_gesture( gesture )
|
||||
, m_gestureOwnedByEvent( ownedByEvent )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -94,10 +100,10 @@ QskGestureEvent::~QskGestureEvent()
|
|||
|
||||
// -- QskAnimatorEvent
|
||||
|
||||
QskAnimatorEvent::QskAnimatorEvent( QskAspect::Aspect aspect, State state ):
|
||||
QskEvent( QskEvent::Animator ),
|
||||
m_aspect( aspect ),
|
||||
m_state( state )
|
||||
QskAnimatorEvent::QskAnimatorEvent( QskAspect::Aspect aspect, State state )
|
||||
: QskEvent( QskEvent::Animator )
|
||||
, m_aspect( aspect )
|
||||
, m_state( state )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,7 @@ private:
|
|||
class QSK_EXPORT QskWindowChangeEvent : public QskEvent
|
||||
{
|
||||
public:
|
||||
QskWindowChangeEvent( QQuickWindow* oldWindow,
|
||||
QQuickWindow* window );
|
||||
QskWindowChangeEvent( QQuickWindow* oldWindow, QQuickWindow* window );
|
||||
|
||||
inline QQuickWindow* window() const { return m_window; }
|
||||
inline QQuickWindow* oldWindow() const { return m_oldWindow; }
|
||||
|
|
|
|||
|
|
@ -20,11 +20,11 @@ static inline qreal qskAligned( qreal value )
|
|||
return value;
|
||||
}
|
||||
|
||||
QskFlickAnimator::QskFlickAnimator():
|
||||
m_velocity{ 0.0, 0.0 },
|
||||
m_degrees( 0.0 ),
|
||||
m_cos( 1.0 ),
|
||||
m_sin( 0.0 )
|
||||
QskFlickAnimator::QskFlickAnimator()
|
||||
: m_velocity{ 0.0, 0.0 }
|
||||
, m_degrees( 0.0 )
|
||||
, m_cos( 1.0 )
|
||||
, m_sin( 0.0 )
|
||||
{
|
||||
setDuration( 1000 );
|
||||
setEasingCurve( QEasingCurve::OutCubic );
|
||||
|
|
|
|||
|
|
@ -4,9 +4,9 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "QskFocusIndicator.h"
|
||||
#include "QskQuick.h"
|
||||
#include "QskAspect.h"
|
||||
#include "QskEvent.h"
|
||||
#include "QskQuick.h"
|
||||
|
||||
#include <qquickwindow.h>
|
||||
|
||||
|
|
@ -38,9 +38,9 @@ public:
|
|||
QVector< QMetaObject::Connection > connections;
|
||||
};
|
||||
|
||||
QskFocusIndicator::QskFocusIndicator( QQuickItem* parent ):
|
||||
Inherited( parent ), // parentItem() might change, but parent() stays
|
||||
m_data( new PrivateData() )
|
||||
QskFocusIndicator::QskFocusIndicator( QQuickItem* parent )
|
||||
: Inherited( parent ) // parentItem() might change, but parent() stays
|
||||
, m_data( new PrivateData() )
|
||||
{
|
||||
setTransparentForPositioner( true );
|
||||
connectWindow( window(), true );
|
||||
|
|
@ -145,8 +145,8 @@ QRectF QskFocusIndicator::focusRect() const
|
|||
{
|
||||
const QQuickItem* item = window()->activeFocusItem();
|
||||
|
||||
if ( item && ( item != this ) && item->isVisible()
|
||||
&& ( item != window()->contentItem() ) )
|
||||
if ( item && ( item != this ) && item->isVisible() &&
|
||||
( item != window()->contentItem() ) )
|
||||
{
|
||||
const auto rect = qskFocusIndicatorRect( item );
|
||||
return parentItem()->mapRectFromItem( item, rect );
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@
|
|||
#include "QskFocusIndicatorSkinlet.h"
|
||||
#include "QskFocusIndicator.h"
|
||||
|
||||
QskFocusIndicatorSkinlet::QskFocusIndicatorSkinlet( QskSkin* skin ):
|
||||
Inherited( skin )
|
||||
QskFocusIndicatorSkinlet::QskFocusIndicatorSkinlet( QskSkin* skin )
|
||||
: Inherited( skin )
|
||||
{
|
||||
setNodeRoles( { FrameRole } );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,4 +38,3 @@ private:
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
|
||||
#include "QskGesture.h"
|
||||
|
||||
QskGesture::QskGesture( Type type ):
|
||||
m_type( type ),
|
||||
m_state( NoGesture )
|
||||
QskGesture::QskGesture( Type type )
|
||||
: m_type( type )
|
||||
, m_state( NoGesture )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -20,8 +20,8 @@ void QskGesture::setState( State state )
|
|||
m_state = state;
|
||||
}
|
||||
|
||||
QskTapGesture::QskTapGesture():
|
||||
QskGesture( Tap )
|
||||
QskTapGesture::QskTapGesture()
|
||||
: QskGesture( Tap )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -34,9 +34,9 @@ void QskTapGesture::setPosition( const QPointF& position )
|
|||
m_position = position;
|
||||
}
|
||||
|
||||
QskTapAndHoldGesture::QskTapAndHoldGesture():
|
||||
QskGesture( TapAndHold ),
|
||||
m_timeout( 0 )
|
||||
QskTapAndHoldGesture::QskTapAndHoldGesture()
|
||||
: QskGesture( TapAndHold )
|
||||
, m_timeout( 0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -54,10 +54,10 @@ void QskTapAndHoldGesture::setTimeout( int timeout )
|
|||
m_timeout = timeout;
|
||||
}
|
||||
|
||||
QskPanGesture::QskPanGesture():
|
||||
QskGesture( Pan ),
|
||||
m_angle( 0.0 ),
|
||||
m_velocity( 0.0 )
|
||||
QskPanGesture::QskPanGesture()
|
||||
: QskGesture( Pan )
|
||||
, m_angle( 0.0 )
|
||||
, m_velocity( 0.0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -90,10 +90,10 @@ void QskPanGesture::setPosition( const QPointF& pos )
|
|||
m_position = pos;
|
||||
}
|
||||
|
||||
QskSwipeGesture::QskSwipeGesture():
|
||||
QskGesture( Swipe ),
|
||||
m_velocity( 0.0 ),
|
||||
m_angle( 0.0 )
|
||||
QskSwipeGesture::QskSwipeGesture()
|
||||
: QskGesture( Swipe )
|
||||
, m_velocity( 0.0 )
|
||||
, m_angle( 0.0 )
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
#include "QskGlobal.h"
|
||||
|
||||
#include <qpoint.h>
|
||||
#include <qmetatype.h>
|
||||
#include <qpoint.h>
|
||||
|
||||
class QSK_EXPORT QskGesture
|
||||
{
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue