Skip to content
  • 0 Votes
    2 Posts
    300 Views
    SGaistS

    Hi,

    Might be a silly idea (and I currently don't know the performance hit for that one) but why not have one mouse area per Text object ?

  • 0 Votes
    2 Posts
    928 Views
    Gojir4G

    Hi, it seems ConicalGradient has been removed from Qt 6. There is probably a new alternative for that. Anyway you can still accessing it using the Qt5Compat module.
    See details here: https://doc.qt.io/qt-6/qml-qt5compat-graphicaleffects-conicalgradient.html

    Note you'll probably need to install the Qt5Compat module corresponding to your Qt version from the Maintenance Tools if that's not already the case.

  • 1 Votes
    6 Posts
    2k Views
    aarelovichA

    @mingr This is the right answer to my question. As this fixed my issue. Thank you!!

  • 0 Votes
    1 Posts
    314 Views
    No one has replied
  • 0 Votes
    4 Posts
    1k Views
    K

    Thanks guys!
    Im on Qt 5.10, that explains why the "=>" is not working. Had not known about the old style syntax.

    Settings this to closed.

  • 0 Votes
    9 Posts
    997 Views
    Crawl.WC

    @GrecKo Same code with qmlscene.exe will report error and can not preview UI.

  • 0 Votes
    2 Posts
    424 Views
    K

    @porridgechef

    Hi and welcome to devnet forum

    This is a user driven forum where you might get help in case you need better understanding of functionality.
    Basically nobody in this forum is able to predict exactly what features may come.

    There is the bugreporting tool where also feature requests may be placed. https://bugreports.qt.io/secure/Dashboard.jspa
    Have a look there and check if the feature is already placed. Otherwise you may it and it may be implemented some time in the future.

  • 0 Votes
    4 Posts
    1k Views
    ODБOïO

    Use 'Component.onCompleted' handler to assign directly your url, or to call a function which will do that.

    function setUrl(idOfWebView){

    idOfWebView.url = "https://forum.qt.io"

    }

    WebView {
    id: myWebView
    anchors.fill: parent
    // url: "set url here "

    Component.onCompleted : { /* any JavaScript function or expressions */ // myWebView.url = "https://forum.qt.io" ( DIRECT ) //or u can call a function like this : // setUrl(myWebView) // pass id of your webView to the function. ( FUNCTION ) } }

    LA

  • QML Tab and State

    Unsolved QML and Qt Quick
    2
    0 Votes
    2 Posts
    1k Views
    D

    Hi again,

    I got something working and I thought I would share how I proceeded.

    In my application, the active/visible Tab is selected programmatically. As stated in the original message, the content of the Tab is dependent on the result/state of an external test. That test might be completed before the Tab is made visible.

    So, I first defined a set of enumerators in C++, made available to my QML code by using Q_ENUM macro and used Q_PROPERTY to define a variable in C++ that can be accessed in QML. Let's refer to this variable as testResult.

    I also used a set of (internal) State in my QML Tab content (see original post). In the QML file defining the Tab content, I added a Component.onCompleted which is used to the internal State based on the value of testResult. Once the Tab is visible, different controls (BUTTON) are used to let the operator select different operations, repeating the execution of the test for example, setting a new value to the internal State.

    Using QML State allows me to take advantage of onStateChange, and consequently set the visible content of the Tab according to the internal State.

    Communication between C++ and QML when the value of testResult changes is achieved using an emit notification.

    This solution avoids exposing internal QML State values and the variable testResult to the javascript code I am using.

    Thanks,
    Daniel

  • 0 Votes
    5 Posts
    3k Views
    QjayQ

    It's just that i had a thought i can write this whole application with QML/JS . SO i was trying to stick to it .

    But now it seems i will have to use C++ .

  • 0 Votes
    2 Posts
    4k Views
    Gregoire BorelG

    Solution can be found here: http://stackoverflow.com/questions/36335481/dynamically-change-qml-theme-at-runtime/36399339#36399339

  • 0 Votes
    4 Posts
    2k Views
    F

    @mcosta
    Thanks

    Put your example

    js object

    var exemple = { "store": { "book": [ { "category": "reference", "author": "Nigel Rees", "title": "Sayings of the Century", "price": 8.90 }, { "category": "fiction", "author": "Evelyn Waugh", "title": "Sword of Honour", "price": 12.90 }, { "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "isbn": "0-553-21311-3", "price": 8.90 }, { "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "isbn": "0-395-19395-8", "price": 22.90 }] } }

    main.qml

    import QtQuick 1.1 import "./data_list.js" as Js Rectangle { id: mainwindow width: 700 height: 360 property string fontName: "Arial" ListModel{ id: model_l ListElement { category:""; author :""; title :""; price :""; } } ListView{ id: view_l model: model_l delegate: my_delegate anchors.fill: parent } Component { id: my_delegate PageDele { str_p_category: model.category str_p_author : model.author str_p_title : model.title str_p_price : model.price } } Component.onCompleted: { model_l.append({ title: "1st title", category: "1st cathegory", author: "1st author" }); var menu = Js.exemple.store.book; for (var i = 0; i < menu.length; i++ ) { model_l.append(menu[i]); } model_l.append({ title: "last title", category: "last cathegory" }); } }

    PagaDele.qml

    import QtQuick 1.1 Rectangle { height: 20 property int marg: 5 property alias str_p_author: author.text property alias str_p_category: category.text property alias str_p_title: title.text property alias str_p_price: price.text Row{ Text { id: author font{ family: mainwindow.fontName bold: true pixelSize: 14 } color: "black" text: "" anchors.left: parent.left anchors.leftMargin: marg } Text { id: category font{ family: mainwindow.fontName bold: true pixelSize: 14 } color: "black" text: "" anchors.left: category.right anchors.leftMargin: marg + author.text.length } Text { id: title font{ family: mainwindow.fontName bold: true pixelSize: 14 } color: "black" text: "" anchors.left: category.right anchors.leftMargin: marg + category.text.length } Text { id: price font{ family: mainwindow.fontName bold: true pixelSize: 14 } color: "black" text: "" anchors.left: title.right anchors.leftMargin: marg + title.text.length } } }