Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.6k Posts
  • How to open files with QFileDialog or something?

    Unsolved
    3
    0 Votes
    3 Posts
    431 Views
    B
    As far as I know there is no direct way to read file content from QML, so some sort of C++ extension is needed, as indicated by @Dannick-Stark. This StackOverflow answer describes an approach that exposes a "FileIO" object to QML from C++.
  • How to know which line the specified position is in the TextArea

    Unsolved
    2
    0 Votes
    2 Posts
    239 Views
    D
    You can try to get the whole text from the start to the position of the cursor. Then split it into a list of lines and return the length of the list. function currentLine(){ let list = text.text.substring(0, text.cursorPosition).split(/\n/gm) return list.length }
  • End of MenuBar not visible if window is not wide enough.

    Unsolved qml menubar style
    1
    0 Votes
    1 Posts
    259 Views
    No one has replied
  • Distinguish between the models 'id' and the local/view 'id'.

    Unsolved
    4
    0 Votes
    4 Posts
    401 Views
    fcarneyF
    I have run into serious problems when I shadow names of features or properties in Item or derived from Item. It is better to just name it something that cannot clash. static const QHash<int, QByteArray> roles { {NameRole, "nameRole"}, {IdRole, "idRole"}, {ChildCountRole, "childCountRole"}, {ActiveRole, "activeRole"}, }; Putting role in the name automatically documents this is coming from the model. Using simple names that have a chance to clash just opens you up to failing later because something is added to an object later. Analogous to using i, j, and k in every loop. It is a pain to diagnose. It is a bad habit that will cost you time months from now. Text is cheap, descriptive names don't cost you anything, but can cost you hours if you collide with other names. Search and replace is a thing. Autocomplete is a thing. Use them to supplement having to type in long variable names.
  • How to load a secure html image in a Text item

    Unsolved
    8
    0 Votes
    8 Posts
    711 Views
    M
    Ah sorry @raven-worx I thought I had it in my example but I did not. Text { id: descriptionLabel text: "Description:" font.bold: true wrapMode: Text.Wrap textFormat: Text.RichText text: "<p><span class=\"image-wrap\" style=\"\"><img src=\"https://ommitted.atlassian.net/secure/attachment/10000/10000_reply.png\" height=\"17\" width=\"22\" style=\"border: 0px solid black\" /></span></p>" } Running on Windows 10 @GrecKo yes I suspect the cookies are being added correctly but I just have the wrong cookies and will need to discuss with atlassian
  • Regarding Slider in QML

    Solved
    14
    0 Votes
    14 Posts
    5k Views
    M
    Ok I helped myself right now by creating a Rectangle and setting the anchor to the handle. Then I rendered everything necessary on top. Rectangle{ anchors.centerIn: handle z: 1 width: 76 height: 76 radius: width / 2 border.width: 3 border.color: temperatureControlSlider.pressed ? "green" : "white" color: "black" } Text{ anchors.centerIn: handle z: 1 color: "red" font.pixelSize: 30 text: temperatureControlSlider.value } } It's a bit strange because I found only solutions similar to my previous post. But maybe it's because of Qt6 or so. You need to grab the handle (which is now "invisible") but yeah. It works x)
  • Moving qml Map from first SplitView to second SplitView using takeItem and addItem

    Unsolved
    1
    0 Votes
    1 Posts
    149 Views
    No one has replied
  • spike in CPU usage replotting qml chart

    Unsolved
    1
    0 Votes
    1 Posts
    119 Views
    No one has replied
  • Import a figma design after changes didn't reflect

    Unsolved
    2
    0 Votes
    2 Posts
    184 Views
    mrjjM
    Hi and welcome to the forums. Nothing wrong with the post as such, but always good to include the Qt version used. Forgive my ignorance but Is Figma from figma.com ?
  • 0 Votes
    6 Posts
    3k Views
    J
    After updating to GCC 10, I am not facing that issue still now. Thanks for the support
  • libvlc wrapper The program has unexpectedly finished.

    Unsolved
    3
    0 Votes
    3 Posts
    335 Views
    T
    thanks is fixed i forgot to put vlc in enveirment path
  • Have Qt creator stop adding /*##^## ... ##^##*/ to files

    Solved
    8
    0 Votes
    8 Posts
    867 Views
    J
    Thanks! That solved the problem.
  • How to set country specific QML Maps locales?

    Unsolved
    1
    0 Votes
    1 Posts
    146 Views
    No one has replied
  • Load Image From Device

    Unsolved
    8
    0 Votes
    8 Posts
    701 Views
    dheerendraD
    From the directory you should read the filenames, build the model & then show them in your app.
  • PlaylistItem not working with properties

    Unsolved
    1
    0 Votes
    1 Posts
    133 Views
    No one has replied
  • Unable to write properties of Q_GADGET

    Unsolved
    1
    0 Votes
    1 Posts
    190 Views
    No one has replied
  • Same issue for me also using QuickControls2

    Unsolved
    1
    0 Votes
    1 Posts
    139 Views
    No one has replied
  • Create QML TableView from JS array best way. How?

    Solved
    2
    0 Votes
    2 Posts
    306 Views
    B
    Issue closed. Solution found. Example published here Be careful when using this kind of approach. There are a lot of memory will be used.
  • Dynamic font change in qt qml applications

    Unsolved
    1
    0 Votes
    1 Posts
    183 Views
    No one has replied
  • how to read linux device serial number

    Solved
    4
    0 Votes
    4 Posts
    395 Views
    M
    i manage solve it by using QProcess