Make QML imports consistent
Open, LowPublic

Description

QML imports are currently not all consistent.
We should use this example as a base (versions can of course be different, only use needed imports) and apply it everywhere:

import QtQuick 2.5
import QtQuick.Controls 2.5 as QQC2
import QtQuick.Dialogs 1.1 as QtDialogs
import QtQuick.Layouts 1.0

import org.kde.kirigami 2.5 as Kirigami
import org.kde.plasma.components 2.0 as PlasmaComponents2
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras
GB_2 created this task.Apr 29 2019, 7:02 PM
GB_2 updated the task description. (Show Details)

Like QtQuickControls, PlasmaComponents comes multiple versions: 2 and 3. Maybe the following?

import org.kde.plasma.components 2.0 as PC2
import org.kde.plasma.components 2.0 as PC3
GB_2 added a comment.EditedApr 29 2019, 7:06 PM

Like QtQuickControls, PlasmaComponents comes multiple versions: 2 and 3. Maybe the following?

import org.kde.plasma.components 2.0 as PC2
import org.kde.plasma.components 2.0 as PC3

Ok, the only problem I see is that we already use PlasmaComponents in all places.

GB_2 added a comment.Apr 29 2019, 7:08 PM

Oh, and then PlasmaCore (PC) would conflict with PlasmaComponents (PC).

GB_2 added a comment.EditedApr 29 2019, 7:15 PM

We'll just leave the Plasma names, but add the major version number to the PlasmaComponents import name.

GB_2 updated the task description. (Show Details)Apr 29 2019, 7:15 PM
GB_2 triaged this task as Low priority.Apr 30 2019, 8:29 PM
GB_2 updated the task description. (Show Details)
GB_2 updated the task description. (Show Details)May 1 2019, 9:21 AM

What about PlasmaComponents3?

GB_2 added a comment.May 1 2019, 7:44 PM

What about PlasmaComponents3?

Of course just change the 2 to 3.

ognarb added a subscriber: ognarb.May 2 2019, 12:10 PM

I saw the script extras/scripts/checkqmlimports.py in D20953. Maybe this can be helpful and could be moved to ECM.

GB_2 renamed this task from Make QML imports/import names consistent to Make QML imports consistent.May 26 2019, 4:32 PM

I saw the script extras/scripts/checkqmlimports.py in D20953. Maybe this can be helpful and could be moved to ECM.

Good idea