How to use Style property in QtQuick.Controls 2.2 in Qt 5.9



  • Hello developers,
    Previously we was using QtQuick.Controls 1.4 in our code. In some machines ComboBox and ScrollView got freeze while using. While searching it has mentioned that in QtQuick.Controls 2.2 this freezing was resolved. But in Controls 2.2 i can't access the style property in Qt 5.9 .

    Existing Code

    import QtQuick 2.0
    import QtQuick.Controls 1.4
    import QtQuick.Controls.Styles 1.2
    ScrollView {
        id: control
        anchors.fill: parent
        clip: true
        style: FusionScrollViewStyle {
        }
    }
    

    Within this FusionScrollViewStyle we was using our custom styles in qml.

    Trying to implement:

    import QtQuick 2.0
    import QtQuick.Controls 2.2
    import QtQuick.Controls.Styles 1.2
    ScrollView {
        id: control
        anchors.fill: parent
        clip: true
        style: FusionScrollViewStyle {
        }
    }
    

    In above code Style property was not accessible.
    Showing Error Cannot assign to non-existent property "style"
    Is there any possibility to use style property QtQuick.Controls 2.2 in Qt 5.9 ?
    Or How can I give custom style to any component.

    Thank You!!!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.