Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.5k Posts
  • 0 Votes
    2 Posts
    486 Views
    TobiasT
    I got an answer that fixes the problem on Stackoverflow https://stackoverflow.com/a/75522782/5134351
  • how can I get mesh information!

    Unsolved
    2
    0 Votes
    2 Posts
    163 Views
    S
    @safylee when a mesh model was loaded, the value of mesh.geometry.attributes is null ; the error description was "TypeError: Cannot read property 'attributes' of null"
  • TextArea in a Flickable resets scroll position when contents change.

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    mzimmersM
    @preiter said in TextArea in a Flickable resets scroll position when contents change.: think I'm going to change it from a simple string in a TextArea to a ListModel/ListView Yeah, I was thinking about that, too. If the information in your TextArea is at all of a list variety, that's probably a better way to go anyway. After all, if the entire contents were to change (for example), keeping the original scroll position doesn't make much sense anyway.
  • Printing a QMap with a ListView

    Unsolved
    2
    0 Votes
    2 Posts
    531 Views
    dheerendraD
    You can try something like this. ListView { id: userListView spacing: 5 anchors.fill: parent property var maps : user.usersMap(); property var keyss : Object.keys(user.usersMap()) model: keyss delegate:Text { text: modelData + " Value = "+userListView.maps[modelData] anchors.leftMargin: 75 font.pixelSize: 28 } }
  • get gps current location using PositionSource:

    Unsolved
    3
    0 Votes
    3 Posts
    870 Views
    M
    @Mohamad-Ayrot thank you for answering. i was thinking if we can get the location using internet (Network) connection as Microsoft or Google do. there are some applications that uses location services on windows like maps or weather, so i thought it can be the same situation. it does not provide the exact location but very close to the real one.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Dialog gets not resized with loader

    Solved
    7
    0 Votes
    7 Posts
    853 Views
    RusticusR
    Still I havent found a solution What I have found out so far, the Item I load gets the height of 101 but why?
  • common way to sort code?

    Unsolved
    8
    0 Votes
    8 Posts
    615 Views
    L
    @MaStaSk you have to make each non-root item accessible by using an alias: Item { property alias timerSlide: timerSlide property alias timerZoom: timerZoom Timer { id: timerSlide } Timer { id: timerZoom } } personally, I would try to avoid timers as much as possible. try using animations/animators for such tasks. e.g. ScaleAnimator
  • rotating rectangle causes bad view on edges

    Solved
    3
    0 Votes
    3 Posts
    285 Views
    MarkkyboyM
    @Yunus - you can also add smooth: true but smooth and antialiasing can cause poor/slow performance.
  • Want to read data from excel files and write them into PostgreSQL

    Solved
    3
    0 Votes
    3 Posts
    315 Views
    M
    @JonB Dear JonB Oh, thank you very much for your valuable answers and kindness You saved my time a lot ! I learned important facts from you, so I will focus on Qt itself now Also thank you for those links you suggest Have a nice Sunday and see you again, Jon Take care
  • Remove current directory from selectedFolder

    Solved
    9
    0 Votes
    9 Posts
    692 Views
    JM baubetJ
    Thank you for your help import QtCore ... FolderDialog { id: folderDialog selectedFolder.toString().replace(Qt.resolvedUrl("./../.."), "") alertEvenement.opacity = 0 // Il faut enregistrer le setting dnas le fichier python console.log("./" + selectedFolder.toString().replace(Qt.resolvedUrl("./../.."), "")) } }
  • can I do the same things of qtwidget in qml app ?

    Solved
    3
    0 Votes
    3 Posts
    215 Views
    M
    @GrecKo Dear GrecKo: Thank you so much for your kindness and your answers. You helped me a lot ! For question no. 3, I am just a beginner to QML, so I want to use signal-slot mechanism under QML's beautiful UI. Especially QML offers nice 3D rendering together with 2D graphics. So I want to use QML. But I already knew how to use signal-slot mechanism, I just want to use this for those QML's controls. Have a nice weekend and see you again, GrecKo Take care
  • Use the Repeater element to Create a Listmodel with various ListElements

    Unsolved
    6
    0 Votes
    6 Posts
    513 Views
    GrecKoG
    @smeik something like this : ListView { model: [ { foo: "hello", bar: "red" }, { foo: "world", bar: "orange" } ] delegate: ItemDelegate { text: modelData.foo color: modelData.bar } } Alternatively you could use JsonListModel from https://github.com/benlau/qsyncable if you want to transform a js array to a proper QAbstractListModel JsonListModel { id: myModel source: [ { foo: "hello", bar: "red" }, { foo: "world", bar: "orange" } ] } ListView { model: myModel delegate: ItemDelegate { text: model.foo color: model.bar } }
  • Qt SVG : Dynamic Modification

    Unsolved
    17
    0 Votes
    17 Posts
    4k Views
    JKSHJ
    @mzimmers said in Qt SVG : Dynamic Modification: (I'll need to build around this, as I'm currently using the icon property of TabButton.) @fcarney @JKSH this has been educational; thanks. You're welcome. Works for button icons too! TabButton { text: "Click Me" icon.source: `data:image/svg+xml;base64,${Qt.btoa(svgStr)}` }
  • Round time to hour

    Unsolved
    3
    0 Votes
    3 Posts
    456 Views
    RusticusR
    You can check if the minutes are bigger than X and just set hour and minutes https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date?retiredLocale=de hour = date.getHours() minute = date.getMinutes() if(minute > 0){ date.setMinutes(0) date.setHours(hour+1) }
  • how to change background and border color of checkbox in qml menuitem

    Solved
    2
    0 Votes
    2 Posts
    870 Views
    JoeCFDJ
    @JoeCFD this page helps. https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#customizing-popup
  • QML filename as a variable

    Solved
    11
    0 Votes
    11 Posts
    781 Views
    JKSHJ
    @mzimmers said in QML filename as a variable: the entry copies to the clipboard as "://Pump.qml" for some reason Sounds like you clicked "Copy path" instead of "Copy URL" I guess I need to embed all the files into the app. This would seem to be a good time to ask again, am I doing this the right way, or is there a preferred method I'm not aware of? The best practice is to always embed QML files as resources, instead of having your application load and run files from disk. The latter makes it very easy for someone to accidentally (or maliciously) change the program. If you're using Qt 6, qt_add_qml_module() takes care of resource embedding for you (plus it gives the additional benefit of compiling your QML code into C++ where it can): https://forum.qt.io/topic/141780/reopened-using-subdirectories-in-a-cmake-project
  • How to scroll two text areas, individually?

    Unsolved
    6
    0 Votes
    6 Posts
    505 Views
    mzimmersM
    @Shankar-B can you post some code? I don't see how you'd be getting individual scrollbars. If you're explicitly declaring them, the policy property should cause them not to appear (though it's kind of a weird way of achieving that). As @GrecKo pointed out, you can declare independent scroll bars. Just follow the directions in the link he posted.
  • how to do Qml graph in QGuiApplication?

    Unsolved
    5
    0 Votes
    5 Posts
    418 Views
    S
    @dheerendra ok thanks for update
  • QML desktop app layout not adapting to window size

    Unsolved
    4
    0 Votes
    4 Posts
    727 Views
    B
    @mjsmithers sorry, I had missed that you were using Design Studio. I'm afraid I have never used it so I can't help. Is there any way to hand edit what it generates?