move tutorials images
|
|
@ -75,7 +75,8 @@ cp doxygen-awesome.css ~/dev/qskinny/doc/
|
|||
First copy the generated files from above to the website repo:
|
||||
|
||||
```
|
||||
cp -r api ~/dev/qskinny-website/docs/
|
||||
cp -r html ~/dev/qskinny-website/docs/
|
||||
cp -r images ~/dev/qskinny-website/docs/
|
||||
```
|
||||
|
||||
Then test the website locally:
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 94 KiB After Width: | Height: | Size: 94 KiB |
|
Before Width: | Height: | Size: 129 KiB After Width: | Height: | Size: 129 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 214 KiB After Width: | Height: | Size: 214 KiB |
|
Before Width: | Height: | Size: 109 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 75 KiB After Width: | Height: | Size: 75 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 9.1 KiB After Width: | Height: | Size: 9.1 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 64 KiB |
|
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
|
@ -16,4 +16,4 @@ into the Qt architecture is depicted below:
|
|||
|
||||
**QSkinny sits on top of QtQuick, while QML is optional**
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ int main( int argc, char* argv[] )
|
|||
|
||||
Now the app is displaying the two buttons:
|
||||
|
||||

|
||||

|
||||
|
||||
That’s it; you just created a QSkinny application from scratch.
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ margins:
|
|||
|
||||
**implicit horizontal size hint of a button**
|
||||
|
||||

|
||||

|
||||
|
||||
The implicit width of a composited UI element containing a
|
||||
graphic on the left and a text on the right would be the sum of the elements’
|
||||
|
|
@ -70,7 +70,7 @@ label1->setBackgroundColor( Qt::magenta );
|
|||
|
||||
**control without explicit size hint**
|
||||
|
||||

|
||||

|
||||
|
||||
If we set an explicit size hint of 150x60 pixels ourselves for the
|
||||
preferred size, the control will be rendered differently:
|
||||
|
|
@ -81,7 +81,7 @@ label1->setExplicitSizeHint( Qt::PreferredSize, { 150, 60 } );
|
|||
|
||||
**control with explicit size hint**
|
||||
|
||||

|
||||

|
||||
|
||||
When dealing with standard controls or layouts, the size hints don’t
|
||||
need to be specified explicitly, as it can be deduced from its standard
|
||||
|
|
@ -105,48 +105,21 @@ The size policies of QSkinny correspond to the
|
|||
*https://doc.qt.io/qt-5/qsizepolicy.html#Policy-enum[size policies from
|
||||
QtWidgets]*:
|
||||
|
||||
|=======================================================================
|
||||
|`QskSizePolicy::Policy` |description
|
||||
|`Fixed` |The control has a fixed size and can neither grow nor shrink.
|
||||
|
||||
|`Minimum` |The control cannot shrink beyond its minimum size, but it
|
||||
can grow if needed.
|
||||
|
||||
|`Maximum` |The control cannot grow beyond its maximum size, but it can
|
||||
shrink if needed.
|
||||
|
||||
|`Preferred` |The control can grow and shrink, but it should be of the
|
||||
size given by `sizeHint()`.
|
||||
|
||||
|`MinimumExpanding` |The control cannot shrink beyond its minimum size,
|
||||
but it can grow and should get as much space as possible.
|
||||
|
||||
|`Expanding` |The control can shrink and grow, and it should get as much
|
||||
space as possible.
|
||||
|
||||
|`Ignored` |The `sizeHint()` is ignored, and the control will get as
|
||||
much space as possible.
|
||||
|
||||
|`Constrained` |The size of the control depends on a constraint,
|
||||
i.e. the width is depending on the height or vice versa. For this policy
|
||||
and the other `Constrained*` ones below, `QskControl::widthForHeight()`
|
||||
or `QskControl::heightForWidth()` will be queried.
|
||||
|
||||
|`ConstrainedMinimum` |The size of the control depends on a constraint,
|
||||
but it can grow if needed.
|
||||
|
||||
|`ConstrainedMaximum` |The size of the control depends on a constraint,
|
||||
but it can shrink if needed.
|
||||
|
||||
|`ConstrainedPreferred` |The size of the control depends on a
|
||||
constraint, but it can grow and srhink if needed.
|
||||
|
||||
|`ConstrainedMinimumExpanding` |The size of the control depends on a
|
||||
constraint, but it can grow and should get as much space as possible.
|
||||
|
||||
|`ConstrainedExpanding` |The size of the control depends on a
|
||||
constraint, and it should get as much space as possible.
|
||||
|=======================================================================
|
||||
|`QskSizePolicy::Policy` | description |
|
||||
| ---------------------- | ----------- |
|
||||
|`Fixed` |The control has a fixed size and can neither grow nor shrink. |
|
||||
|`Minimum` |The control cannot shrink beyond its minimum size, but it can grow if needed. |
|
||||
|`Maximum` |The control cannot grow beyond its maximum size, but it can shrink if needed. |
|
||||
|`Preferred` |The control can grow and shrink, but it should be of the size given by `sizeHint()`. |
|
||||
|`MinimumExpanding` |The control cannot shrink beyond its minimum size, but it can grow and should get as much space as possible. |
|
||||
|`Expanding` |The control can shrink and grow, and it should get as much space as possible. |
|
||||
|`Ignored` |The `sizeHint()` is ignored, and the control will get as much space as possible. |
|
||||
|`Constrained` |The size of the control depends on a constraint, i.e. the width is depending on the height or vice versa. For this policy and the other `Constrained*` ones below, `QskControl::widthForHeight()` or `QskControl::heightForWidth()` will be queried. |
|
||||
|`ConstrainedMinimum` |The size of the control depends on a constraint, but it can grow if needed. |
|
||||
|`ConstrainedMaximum` |The size of the control depends on a constraint, but it can shrink if needed. |
|
||||
|`ConstrainedPreferred` |The size of the control depends on a constraint, but it can grow and srhink if needed. |
|
||||
|`ConstrainedMinimumExpanding` |The size of the control depends on a constraint, but it can grow and should get as much space as possible. |
|
||||
|`ConstrainedExpanding` |The size of the control depends on a constraint, and it should get as much space as possible. |
|
||||
|
||||
All the `Constrained*` policies correspond to Qt’s
|
||||
[QSizePolicy::hasHeightForWidth()](https://doc.qt.io/qt-5/qsizepolicy.html#hasHeightForWidth)
|
||||
|
|
@ -180,7 +153,7 @@ margins:
|
|||
|
||||
**Size policies with preferred size**
|
||||
|
||||

|
||||

|
||||
|
||||
After growing the window horizontally, the button with the Fixed
|
||||
horizontal size policy keeps its width, while the button with the
|
||||
|
|
@ -188,7 +161,7 @@ Minimum policy will grow:
|
|||
|
||||
**Size policies when increasing window width**
|
||||
|
||||

|
||||

|
||||
|
||||
When shrinking the window below its original size, both buttons stay
|
||||
with their width: The one on the left because of its `Fixed` size policy,
|
||||
|
|
@ -197,7 +170,7 @@ due to the `Minimum` size policy.
|
|||
|
||||
**Size policies when shrinking window width**
|
||||
|
||||

|
||||

|
||||
|
||||
If we change the policy of the right button to `Preferred`, it will shrink
|
||||
below its original size (even though the text is too wide now):
|
||||
|
|
@ -209,7 +182,7 @@ label2->setText( "size policy: preferred" );
|
|||
|
||||
**Size policies when changing to preferred size policy**
|
||||
|
||||

|
||||

|
||||
|
||||
### Types of layouts
|
||||
|
||||
|
|
@ -238,7 +211,7 @@ horizontalBox->addItem( label3 );
|
|||
|
||||
**Horizontal layout**
|
||||
|
||||

|
||||

|
||||
|
||||
```
|
||||
auto verticalBox = new QskLinearBox( Qt::Vertical );
|
||||
|
|
@ -256,7 +229,7 @@ verticalBox->addItem( label3 );
|
|||
|
||||
**Vertical layout**
|
||||
|
||||

|
||||

|
||||
|
||||
#### Grid layouts (QskGridBox)
|
||||
|
||||
|
|
@ -290,7 +263,7 @@ gridBox->addItem( label7, 2, 1, 1, 2 );
|
|||
|
||||
**Grid layout**
|
||||
|
||||

|
||||

|
||||
|
||||
#### Stack layouts (QskStackBox)
|
||||
|
||||
|
|
@ -319,12 +292,12 @@ stackBox->setCurrentIndex( 2 );
|
|||
|
||||
**Stack layout (symbolized)**
|
||||
|
||||

|
||||

|
||||
|
||||
In this example, "control 3" is stacked on top of the blue and the
|
||||
cyan control. Controls in a stacked layout can be of different sizes.
|
||||
|
||||
**📌 NOTE**\
|
||||
**NOTE**:
|
||||
The image above is just for illustrating purposes. In practice
|
||||
the topmost control ("control 3" here) is completely covering the ones
|
||||
below it.
|
||||
|
|
@ -365,13 +338,13 @@ are rendered with their preferred size:
|
|||
|
||||
**Stretch factors with preferred size**
|
||||
|
||||

|
||||

|
||||
|
||||
When the layout gets more width, the stretch factors come into play:
|
||||
|
||||
**A stretch factor of 1:2**
|
||||
|
||||

|
||||

|
||||
|
||||
No matter how wide the layout is, the aspect ratio of 1:2 will always be
|
||||
kept, meaning that the label on the left will get 33% of the space, and
|
||||
|
|
@ -379,7 +352,7 @@ the label on the right 67%:
|
|||
|
||||
**A stretch factor of 1:2 with different widths**
|
||||
|
||||

|
||||

|
||||
|
||||
Stretch factors in QSkinny are the same as in the Qt Graphics View
|
||||
Framework, see
|
||||
|
|
@ -394,7 +367,7 @@ on the left:
|
|||
|
||||
**A UI with nested layouts**
|
||||
|
||||

|
||||

|
||||
|
||||
The code to produce the above UI could look like this (setting colors
|
||||
etc. omitted for brevity):
|
||||
|
|
@ -430,7 +403,7 @@ The following diagram makes the layouts visible:
|
|||
|
||||
**The layout structure of the UI**
|
||||
|
||||

|
||||

|
||||
|
||||
### Anchoring in QSkinny
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ itself as well as read the skin hints from the skin:
|
|||
|
||||
**Skinlets query the control and the skin**
|
||||
|
||||

|
||||

|
||||
|
||||
For instance, a button skinlet will read the margins from the skin and
|
||||
the text to render from the button.
|
||||
|
|
@ -39,11 +39,11 @@ often found in mobile devices.
|
|||
|
||||
**desktop style button**
|
||||
|
||||

|
||||

|
||||
|
||||
**flat button**
|
||||
|
||||

|
||||

|
||||
|
||||
### Skin hints
|
||||
|
||||
|
|
@ -81,7 +81,7 @@ public:
|
|||
|
||||
**A button styled with skin hints**
|
||||
|
||||

|
||||

|
||||
|
||||
When writing a new skin, a developer needs to know which hints to set
|
||||
for which control. This usually depends on the control itself; however,
|
||||
|
|
@ -149,11 +149,11 @@ public:
|
|||
|
||||
**button in normal state**
|
||||
|
||||

|
||||

|
||||
|
||||
**button in hovered state**
|
||||
|
||||

|
||||

|
||||
|
||||
#### Local skin hints
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ diagram now looks like this:
|
|||
|
||||
**Skinlets can also read from local skinlets and animators**
|
||||
|
||||

|
||||

|
||||
|
||||
### Skinlets
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ diagram looks like this:
|
|||
|
||||
**There is one skinlet for each atomic control**
|
||||
|
||||

|
||||

|
||||
|
||||
### Skin factories and switching between skins
|
||||
|
||||
|
|
@ -293,8 +293,8 @@ instances:
|
|||
|
||||
**button in `MySkin` (as above)**
|
||||
|
||||

|
||||

|
||||
|
||||
**button in `OtherSkin`**
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -27,18 +27,18 @@ label2->setSizePolicy( QskSizePolicy::ConstrainedPreferred, QskSizePolicy::Expan
|
|||
|
||||
**graphics with preferred size**
|
||||
|
||||

|
||||

|
||||
|
||||
When resizing the window, the graphics will scale according to the size
|
||||
available in the layout:
|
||||
|
||||
**graphics bounded by width**
|
||||
|
||||

|
||||

|
||||
|
||||
**graphics bounded by height**
|
||||
|
||||

|
||||

|
||||
|
||||
Since we set the horizontal size policy of the graphics to
|
||||
`ConstrainedPreferred`, the scaling is done through QskGraphic’s
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ The full Buttons example is depicted below.
|
|||
|
||||
**The buttons example shows how to mix QSkinny and QML**
|
||||
|
||||

|
||||

|
||||
|
||||
For more information on using C++ classes from QML, see the article about exposing attributes of {cpp} types to QML in the
|
||||
[Qt documentation](https://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html).
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ public:
|
|||
|
||||
**A subclassed control with local skin hints**
|
||||
|
||||

|
||||

|
||||
|
||||
Then there is no need to set the margins and background color for every
|
||||
instance of the custom text label.
|
||||
|
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
**A subclassed control with skin hints defined in the skin**
|
||||
|
||||

|
||||

|
||||
|
||||
The styling described above has the same effect as in the simpler
|
||||
example, but now the `TextLabel` control can be given a different style
|
||||
|
|
@ -142,7 +142,7 @@ auto* textAndGraphic = new TextAndGraphic( "Text", "cloud" );
|
|||
|
||||
**A composited control**
|
||||
|
||||

|
||||

|
||||
|
||||
### Writing controls with a skinlet
|
||||
|
||||
|
|
@ -300,4 +300,4 @@ colors etc. can be written with less code.
|
|||
|
||||
**A class with an own skinlet**
|
||||
|
||||

|
||||

|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ For this example, the scene graph will contain the following nodes:
|
|||
|
||||
**Scene graph representation of a button**
|
||||
|
||||

|
||||

|
||||
|
||||
The top two nodes (root and Quick root item) are created for every
|
||||
QtQuick application. The button itself consists of 5 nodes in our case:
|
||||
|
|
@ -54,7 +54,7 @@ Then the scene graph has the following structure:
|
|||
|
||||
**Scene graph representation of a button inside a box**
|
||||
|
||||

|
||||

|
||||
|
||||
Here we can see that since the box is a parent of the button, the `box
|
||||
node` is also a parent of the `button node` in the scene graph. Also, the
|
||||
|
|
|
|||
|
|
@ -39,4 +39,4 @@ Qt creates the HTML wrappers automatically, so there is not much to do except le
|
|||
|
||||
**The IOT dashboard example in a browser**
|
||||
|
||||

|
||||

|
||||
|
|
|
|||