Skip to content

Commit 32ed1c5

Browse files
committed
Fix qmllint warnings
1 parent b9bc565 commit 32ed1c5

File tree

15 files changed

+96
-85
lines changed

15 files changed

+96
-85
lines changed

src/framework/learn/qml/Muse/Learn/internal/ClassesPage.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Item {
7979
anchors.fill: parent
8080

8181
contentWidth: parent.width
82-
contentHeight: authorInfo.height + sideMargin
82+
contentHeight: authorInfo.height + root.sideMargin
8383

8484
topMargin: topGradient.height
8585

src/framework/uicomponents/qml/Muse/UiComponents/ButtonBox.qml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
23-
import QtQml 2.14
24-
import QtQuick.Controls 2.15
25-
import QtQuick.Layouts 1.15
22+
import QtQuick
23+
import QtQml
24+
import QtQuick.Controls
25+
import QtQuick.Layouts
2626

27-
import Muse.Ui 1.0
27+
import Muse.Ui
2828
import Muse.UiComponents
2929

3030
Container {
@@ -71,7 +71,7 @@ Container {
7171

7272
function accentButton() {
7373
for (var i = 0; i < root.count; i++) {
74-
var btn = root.itemAt(i)
74+
var btn = root.itemAt(i) as FlatButton
7575
if (btn.accentButton) {
7676
return btn
7777
}
@@ -81,10 +81,7 @@ Container {
8181
}
8282

8383
function addButton(text, buttonId, buttonRole, isAccent, isLeftSide) {
84-
const button = Qt.createQmlObject('
85-
import Muse.UiComponents
86-
FlatButton {
87-
}', root)
84+
const button = Qt.createQmlObject("import Muse.UiComponents; FlatButton {}", root) as FlatButton
8885
button.text = text
8986
button.accentButton = isAccent
9087

@@ -103,7 +100,7 @@ Container {
103100

104101
function restoreAccessibility() {
105102
for (var i = 0; i < root.count; i++) {
106-
var btn = root.itemAt(i)
103+
var btn = root.itemAt(i) as FlatButton
107104
if (!Boolean(btn.navigation)) {
108105
continue
109106
}
@@ -163,7 +160,7 @@ Container {
163160
continue
164161
}
165162

166-
var btn = root.itemAt(i)
163+
var btn = root.itemAt(i) as FlatButton
167164
if (buttonInfo.button !== btn) {
168165
root.moveItem(buttonInfo.index, i)
169166
}
@@ -193,7 +190,7 @@ Container {
193190

194191
function buttonInfo(buttonType) {
195192
for (var i = 0; i < root.count; i++) {
196-
var btn = root.itemAt(i)
193+
var btn = root.itemAt(i) as FlatButton
197194
if (!Boolean(btn)) {
198195
continue
199196
}
@@ -237,7 +234,7 @@ Container {
237234
root.addItem(separator)
238235

239236
for (var i = root.count - 2; i >= 0; i--) {
240-
var button = root.itemAt(i)
237+
var button = root.itemAt(i) as FlatButton
241238
if (button.buttonId === lastLeftSideButtonType) {
242239
break;
243240
}

src/framework/uicomponents/qml/Muse/UiComponents/CheckBox.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ FocusScope {
122122
z: label.z - 1 // enable clicking on links in label text
123123

124124
onClicked: {
125-
navigation.requestActiveByInteraction()
125+
navCtrl.requestActiveByInteraction()
126126

127127
root.clicked()
128128
}

src/framework/uicomponents/qml/Muse/UiComponents/ColorPicker.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Rectangle {
7878
StyledIconLabel {
7979
anchors.fill: parent
8080
iconCode: IconCode.QUESTION_MARK
81-
visible: isIndeterminate
81+
visible: root.isIndeterminate
8282
}
8383

8484
MouseArea {
@@ -89,7 +89,7 @@ Rectangle {
8989
hoverEnabled: true
9090

9191
onClicked: {
92-
navigation.requestActiveByInteraction()
92+
navCtrl.requestActiveByInteraction()
9393

9494
prv.selectColor()
9595
}

src/framework/uicomponents/qml/Muse/UiComponents/ExpandableBlank.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
22+
import QtQuick
2323

24-
import Muse.Ui 1.0
2524
import Muse.UiComponents
2625

2726
FocusScope {

src/framework/uicomponents/qml/Muse/UiComponents/FlatButton.qml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
23-
import QtQuick.Layouts 1.15
22+
pragma ComponentBehavior: Bound
2423

25-
import Muse.Ui 1.0
24+
import QtQuick
25+
import QtQuick.Layouts
26+
27+
import Muse.Ui
2628
import Muse.UiComponents
2729

2830
FocusScope {
@@ -194,8 +196,8 @@ FocusScope {
194196
anchors.verticalCenter: parent ? parent.verticalCenter : undefined
195197
anchors.horizontalCenter: parent ? parent.horizontalCenter : undefined
196198

197-
readonly property real itemImplicitWidth: item ? item.implicitWidth : 0
198-
readonly property real itemImplicitHeight: item ? item.implicitHeight : 0
199+
readonly property real itemImplicitWidth: (item as Item)?.implicitWidth ?? 0
200+
readonly property real itemImplicitHeight: (item as Item)?.implicitHeight ?? 0
199201

200202
sourceComponent: root.contentItem ? root.contentItem : defaultContentComponent
201203
readonly property Component defaultContentComponent: root.isVertical ? verticalContentComponent : horizontalContentComponent
@@ -213,7 +215,7 @@ FocusScope {
213215
iconCode: root.icon
214216
font: root.iconFont
215217
color: root.iconColor
216-
visible: !isEmpty && buttonType != FlatButton.TextOnly
218+
visible: !isEmpty && root.buttonType != FlatButton.TextOnly
217219
}
218220

219221
StyledTextLabel {
@@ -224,7 +226,7 @@ FocusScope {
224226
textFormat: root.textFormat
225227
wrapMode: Text.Wrap
226228
maximumLineCount: root.maximumLineCount
227-
visible: !isEmpty && buttonType != FlatButton.IconOnly
229+
visible: !isEmpty && root.buttonType != FlatButton.IconOnly
228230
}
229231
}
230232
}
@@ -311,8 +313,8 @@ FocusScope {
311313
hoverEnabled: true
312314

313315
onClicked: function(mouse) {
314-
navigation.requestActiveByInteraction()
315-
navigation.notifyAboutControlWasTriggered()
316+
root.navigation.requestActiveByInteraction()
317+
root.navigation.notifyAboutControlWasTriggered()
316318

317319
root.doClicked(mouse)
318320
}

src/framework/uicomponents/qml/Muse/UiComponents/FlatRadioButton.qml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
23-
import QtQuick.Controls 2.15
22+
pragma ComponentBehavior: Bound
2423

25-
import Muse.Ui 1.0
24+
import QtQuick
25+
import QtQuick.Controls
26+
27+
import Muse.Ui
2628

2729
RadioDelegate {
2830
id: root

src/framework/uicomponents/qml/Muse/UiComponents/FlatRadioButtonList.qml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,12 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
22+
pragma ComponentBehavior: Bound
23+
24+
import QtQuick
2325

2426
import Muse.UiComponents
25-
import Muse.Ui 1.0
27+
import Muse.Ui
2628

2729
RadioButtonGroup {
2830
id: root
@@ -44,12 +46,15 @@ RadioButtonGroup {
4446
return
4547
}
4648

47-
root.itemAtIndex(0).navigation.requestActive()
49+
(root.itemAtIndex(0) as FlatRadioButton).navigation.requestActive()
4850
}
4951

5052
implicitHeight: ui.theme.defaultButtonSize
5153

5254
delegate: FlatRadioButton {
55+
required property var modelData
56+
required property int index
57+
5358
checked: root.currentValue === modelData.value
5459

5560
text: modelData.text ?? ""
@@ -63,7 +68,7 @@ RadioButtonGroup {
6368

6469
navigation.name: "FlatRadioButtonList_" + (Boolean(text) ? text : modelData.title)
6570
navigation.panel: root.navigationPanel
66-
navigation.row: root.navigationRowStart + 1 + model.index
71+
navigation.row: root.navigationRowStart + 1 + index
6772
navigation.accessible.name: root.accessibleName + " " + (Boolean(text) ? text : modelData.title)
6873
navigation.accessible.description: modelData.description ?? ""
6974

src/framework/uicomponents/qml/Muse/UiComponents/StyledMenuLoader.qml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
* You should have received a copy of the GNU General Public License
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
22-
import QtQuick 2.15
22+
pragma ComponentBehavior: Bound
23+
24+
import QtQuick
2325

2426
import Muse.UiComponents
2527

@@ -65,7 +67,7 @@ Loader {
6567
focusPolicies: PopupView.NoFocus
6668

6769
accessibleName: loader.accessibleName
68-
70+
hasSiblingMenus: loader.hasSiblingMenus
6971
parentWindow: loader.parentWindow
7072

7173
onHandleMenuItem: function(itemId) {

src/framework/uicomponents/qml/Muse/UiComponents/internal/StyledDropdownView.qml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
* along with this program. If not, see <https://www.gnu.org/licenses/>.
2121
*/
2222

23-
import QtQuick 2.15
23+
pragma ComponentBehavior: Bound
2424

25-
import Muse.Ui 1.0
25+
import QtQuick
26+
27+
import Muse.Ui
2628
import Muse.UiComponents
2729

2830
DropdownView {

0 commit comments

Comments
 (0)