Skip to content

Commit c2ec7b8

Browse files
committed
Update example-1.
Update `Readme.md`. Add custom styles for `RadioButton`, `Switch` and `CheckBox`.
1 parent c7f32d6 commit c2ec7b8

28 files changed

+844
-578
lines changed

CMakeLists.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
cmake_minimum_required(VERSION 3.26)
2+
project(qube_master)
3+
4+
add_subdirectory(${CMAKE_SOURCE_DIR}/example/example-1)

Qube/Qube.pri

-5
This file was deleted.

Qube/Qube.pro

-11
This file was deleted.

Qube/qmldir

-24
This file was deleted.

README.md

+22-49
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,46 @@
11
# QML Qube
2-
<p><img src="https://img.shields.io/github/v/tag/smr76/qube?sort=semver&label=version&labelColor=0bd&color=07b" alt="version tag">
3-
<img src="https://img.shields.io/github/license/smr76/qube?color=36b245" alt="license">
2+
<p><img src="https://img.shields.io/github/v/tag/0smr/qube?sort=semver&label=version&labelColor=0bd&color=07b" alt="version tag">
3+
<img src="https://img.shields.io/github/license/0smr/qube?color=36b245" alt="license">
44
<a href="https://www.blockchain.com/bch/address/bitcoincash:qrnwtxsk79kv6mt2hv8zdxy3phkqpkmcxgjzqktwa3">
55
<img src="https://img.shields.io/badge/BCH-Donate-f0992e?logo=BitcoinCash&logoColor=f0992e" alt="BCH donate"></a></p>
66

7-
**Qube** QtQuick2/QML theme.
7+
**Qube** QtQuick/QML theme (under development).
88

99
*If you liked these components, please consider givin a star :star2:.*
1010

11-
<!-- ## Preview -->
12-
<!-- <div align="center">&nbsp;
13-
<img src="https://img.shields.io/badge/light-blue-49aaff">
14-
<img src="https://img.shields.io/badge/dark-green-08d7a1"><br>
15-
<img src="extra/preview/preview-1.webp" width="45%">
16-
<img src="extra/preview/preview-2.webp" width="45%">
17-
</div> -->
18-
1911
## How to use
20-
> **Warning**<br>
21-
> This components hava only been tested on **Qt version 5.15.2** and *Windows OS* at *3840x2160 resolution* with a *scaling factor of 250 percent*; ***USAGE OF THIS COMPONENTS CARRIES NO WARRANTY***.
22-
> <br>&nbsp;
12+
> [!WARNING]
13+
> Components in this repository are still in development, thus changes over each update may be significant.
2314
2415
### Usage
2516

26-
Clone the repository first.
27-
```bash
28-
git clone "https://github.com/SMR76/qube.git"
29-
```
30-
Then include `Qube.pri` in your project. <sub>[see example-1](example/example-1/example-1.pro#L11)</sub>
31-
```make
32-
include("path/to/Qube.pri")
33-
```
34-
Add `qrc:/` to the engine import path. <sub>[see example-1](example/example-1/main.cpp#L17)</sub>
35-
```cpp
36-
engine.addImportPath("qrc:/");
37-
```
38-
And finally import the `Qube` module. <sub>[see example-1](example/example-1/main.qml#L6)</sub>
39-
```qml
40-
import Qube 1.0
41-
```
17+
+ Clone the repository first.
18+
```bash
19+
git clone "https://github.com/0smr/qube.git"
20+
```
21+
+ Then add `qube` to your makefile. <sub>[see example-1](example/example-1/CMakeLists.txt#L11)</sub>
22+
```cmake
23+
add_subdirectory(/path/to/qube/)
24+
target_link_libraries(my-target PRIVATE qubeplugin)
25+
```
26+
+ And finally import the `Qube` module. <sub>[see example-1](example/example-1/Root.qml#L5)</sub>
27+
```qml
28+
import qube
29+
```
4230

4331
If you are confused, please refer to [example-1](example/example-1/) for a clearer understanding of what you should do.
4432

4533
## Components
4634

47-
<details open>
48-
<summary>Pending</summary>
49-
35+
- [x] Radio Button
36+
- [x] Switch
37+
- [x] CheckBox
5038
- [ ] Button
51-
- [ ] Radio Button
52-
- [ ] CheckBox
53-
- [ ] Slider
54-
- [ ] ProgressBar
55-
- [ ] RadioButton
56-
- [ ] Switch
57-
- [ ] RangeSlider
58-
- [ ] SpinBox
59-
- [ ] Tumbler
6039
- [ ] Dial
61-
- [ ] BusyIndicator
62-
- [ ] TextArea
63-
- [ ] TextField
64-
- [ ] ComboBox
65-
66-
</details>
6740

6841
## Issues
6942

70-
Please file an issue on [issues page](https://github.com/SMR76/qube/issues) if you have any problems.
43+
Please file an issue on [issues page](https://github.com/0smr/qube/issues) if you have any problems.
7144

7245
## Documentation
7346

example/example-1/CMakeLists.txt

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cmake_minimum_required(VERSION 3.26)
2+
3+
project(example-1)
4+
5+
set(CMAKE_AUTOMOC ON)
6+
set(CMAKE_AUTORCC ON)
7+
set(CMAKE_AUTOUIC ON)
8+
set(CMAKE_AUTOGEN_PARALLEL AUTO)
9+
10+
set(CMAKE_CXX_STANDARD 17)
11+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
12+
13+
set(CMAKE_INCLUDE_CURRENT_DIR ON)
14+
15+
find_package(Qt6 6.5 REQUIRED COMPONENTS Quick)
16+
17+
qt_standard_project_setup(REQUIRES 6.5)
18+
19+
qt_add_executable(example-1
20+
main.cpp
21+
)
22+
23+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
24+
set(NoCache NO_CACHEGEN)
25+
endif()
26+
27+
qt_add_qml_module(${PROJECT_NAME}
28+
URI example
29+
${NoCache}
30+
QML_FILES
31+
Main.qml
32+
Root.qml
33+
)
34+
35+
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../../qube/ ${CMAKE_CURRENT_BINARY_DIR}/qube)
36+
target_link_libraries(example-1 PRIVATE qubeplugin)
37+
38+
target_link_libraries(example-1 PRIVATE Qt::Core Qt::Quick)

example/example-1/ColorPicker.qml

-92
This file was deleted.

example/example-1/Root.qml

+118
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import QtCore
2+
import QtQuick
3+
import QtQuick.Controls.Basic
4+
5+
import qube
6+
7+
Page {
8+
id: root
9+
10+
width: 260
11+
height: 420
12+
visible: true
13+
14+
palette {
15+
button: "#4af"
16+
buttonText: "#fff"
17+
highlight: "#57f"
18+
highlightedText: "#fff"
19+
20+
base: "#1d1c21"
21+
text: "#eee"
22+
window: '#1d1c21'
23+
windowText: "#eee"
24+
placeholderText: '#eee'
25+
}
26+
27+
component ButtonColor: Button {
28+
width: 20; height: width; text: '\u2022'
29+
onClicked: {
30+
root.palette.button = palette.button
31+
root.palette.buttonText = palette.buttonText
32+
root.palette.highlight = palette.button
33+
root.palette.highlightedText = palette.buttonText
34+
}
35+
}
36+
37+
component BackColor: Button {
38+
width: 20; height: width; text: '\u2022'
39+
onClicked: {
40+
root.palette.base = palette.button
41+
root.palette.text = palette.buttonText
42+
root.palette.window = palette.button
43+
root.palette.windowText = palette.buttonText
44+
root.palette.placeholderText = palette.buttonText
45+
}
46+
}
47+
48+
component Title: Label {
49+
color: palette.windowText
50+
font.bold: true
51+
opacity: 0.3
52+
}
53+
54+
component HLine: Rectangle {
55+
color: palette.windowText
56+
width: parent && parent.width
57+
opacity: 0.3
58+
}
59+
60+
Control {
61+
x: 5; y: root.height - height - 5; z: 3
62+
padding: 5
63+
background: Rectangle { color: palette.windowText; opacity: 0.2; radius: 3 }
64+
contentItem: Row {
65+
spacing: 4
66+
ButtonColor { palette { button:'#48abff';buttonText:'#1d1c21' }}
67+
ButtonColor { palette { button:'#edc9aa';buttonText:'#1d1c21' }}
68+
ButtonColor { palette { button:'#4ce0b3';buttonText:'#1d1c21' }}
69+
ButtonColor { palette { button:'#1d1c21';buttonText:'#f5f6f7' }}
70+
Item { width: 4; height: parent.height }
71+
BackColor { palette { button: '#f5f6f7'; buttonText:'#1d1c21' }}
72+
BackColor { palette { button: '#1d1c21'; buttonText:'#f5f6f7' }}
73+
}
74+
}
75+
76+
Settings {
77+
id: settings
78+
location: 'config.conf'
79+
property alias cindex: swipview.currentIndex
80+
}
81+
82+
PageIndicator {
83+
x: parent.width - width - 25
84+
y: parent.height - height - 5
85+
count: swipview.count
86+
currentIndex: swipview.currentIndex
87+
88+
palette.dark: '#fff'
89+
}
90+
91+
SwipeView {
92+
id: swipview
93+
padding: 5
94+
spacing: padding
95+
anchors.fill: parent
96+
97+
Grid {
98+
columns: 1; rows: -1; spacing: 5
99+
100+
RadioButton { text: 'CheckBox' }
101+
RadioButton { text: 'CheckBox' }
102+
CheckBox {
103+
text: 'CheckBox'
104+
tristate: true
105+
}
106+
Switch {
107+
text: 'CheckBox'
108+
}
109+
110+
Title { text: 'MultiRangeSlider' }
111+
}
112+
113+
Grid {
114+
columns: 1; rows: -1; spacing: 5
115+
Title { text: 'MultiRangeSlider' }
116+
}
117+
}
118+
}

0 commit comments

Comments
 (0)