Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.3k Topics 78.3k Posts
Qt 6.11 is out! See what's new in the release blog
  • We're looking for developers to interview about their migration experience

    Pinned until 31/08/2026, 14:23 Unsolved
    7
    2 Votes
    7 Posts
    3k Views
    SGaistS
    @A-Former-User said in We're looking for developers to interview about their migration experience: @KH-219Design: similar here, some explanation who is "we" or at least a qt.io link may help. Anyway: Why the interest in porting "within" Qt, not "to" Qt? And if "within", why not target the smaller and faster solution? Because the question was: from widgets to Qt Quick whatever the size of the application.
  • QtGraphs: QML GraphsView margin between grid and X axis

    Unsolved
    2
    0 Votes
    2 Posts
    43 Views
    Nils SjobergN
    There is no built-in property for spacing between a label and a grid in Qt Charts - the only practical solution is to add a space/character at the beginning of each category text to visually push the label away from the grid.
  • How to call `QAbstractItemModel::setData` from QML view?

    Solved
    5
    1 Votes
    5 Posts
    149 Views
    K
    For multiple reasons, calling setData in this case is the only viable option. This is what I have in my head: ListView { model: /* ... */ delegate: SomeWidget { onEdit: { model.setData(model.index(row, column), someDataToMutate) } } } Column is always 0 in this case, but how is one supposed to get the current row in a QML model-view?
  • 0 Votes
    6 Posts
    223 Views
    G
    Its working now. Thanks! @Nils-Sjoberg
  • QML Local Directory Imports will be undefined after an uncertain amount of time

    Unsolved
    2
    0 Votes
    2 Posts
    252 Views
    SGaistS
    Hi and welcome to devnet, Can you test this with a more recent version of Qt ?
  • Getting undefined values when using QAbtractListModel

    Unsolved
    2
    0 Votes
    2 Posts
    119 Views
    SGaistS
    Hi and welcome to devnet, Please show a minimal code sample that reproduces your situation. Also: Which version of Qt ? On which OS ?
  • Custom TextArea with visible text outside. How?

    Unsolved
    2
    0 Votes
    2 Posts
    571 Views
    DiackneD
    Try this. Maybe that's what you want. Rectangle { width: 300 height: 100 anchors.centerIn: parent color: "#f0f0f0" Flickable { anchors.fill: parent contentWidth: width contentHeight: editor.contentHeight ScrollBar.vertical: ScrollBar {} TextEdit { id: editor width: parent.width wrapMode: TextEdit.Wrap text: "Linha 1\nLinha 2\nLinha 3\nLinha 4\nLinha 5\nLinha 6\nLinha 7\nLinha 8\nLinha 9\nLinha 10" } } }
  • Displaying a Large PDF without Freezing the UI Thread

    Unsolved
    10
    0 Votes
    10 Posts
    4k Views
    B
    @JonB Hey, I've figured out the cause. It's being caused by the thumbnail rendering. I commented out the line ui->thumbnailView->setModel(pdfDocument->pageModel()); and the PDF is loaded instantly. Maybe loading the thumbnails on a different thread won't freeze the UI? (setModel isn't thread safe it seems). The setModel probably causing problems since the pdfDocument->pageModel() is huge. Can you please help me out with how I could fix this? The thumbnailView is a QListView btw. EDIT: I've set setUniformItemSizes to true and the loading is much faster now (almost instantaneous). ui->thumbnailView->setUniformItemSizes(true); I think this was the key to making the view load its items faster. But the scrolling in the thumbnailView widget is pretty laggy.
  • Qt 6 QML TextArea C++ header. Where located?

    Unsolved
    4
    0 Votes
    4 Posts
    2k Views
    B
    @JKSH said in Qt 6 QML TextArea C++ header. Where located?: QQuickPlainText Got messed with QPlainTextEdit. Three weeks of non-stop coding. :-))))
  • IconImage and ColorImage current state

    Unsolved
    7
    0 Votes
    7 Posts
    4k Views
    V
    @GrecKo Thank you! I checked and it is really there. Going to use them further since we have no proper methods even in 2026. About this: @Markkyboy said in IconImage and ColorImage current state: layer.effect: MultiEffect I believe it is much more expensive in terms of performance just like Qt5's GraphicalEffects was.
  • BUG: QML TextField/Combobox: (StyleItem) implicit height is smaller than minimum

    Unsolved
    3
    0 Votes
    3 Posts
    961 Views
    Q
    windows 10 import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 ApplicationWindow { visible: true width: 400 height: 500 title: "Test" TextField { id: textField text: "afdwfdsf" onTextChanged: { } onAccepted: { } } } [image: 0ca2bed8-b0a6-4566-8dc0-eeaa30c3c10b.png] [image: b74a341a-7ca4-49e0-af35-82e34f656e2a.png]
  • How to use virtualkeyboard in popup

    Unsolved
    5
    1 Votes
    5 Posts
    2k Views
    F
    Hi Guys, thanks for replying - I need to enable my email notifications... Also sorry for not being able to provide example code. I am explicitly instancing the InputPanel myself - and not so long ago learned that really only one instance is needed. Still it is a matter of where placing the instance inside the QML hierarchy as Overlays are special, because they are not part of the hierarchical structure. parent: Overlay.overlay did not work in the first place. I am not exactly sure what finally did the trick but it might have been placing the InputPanel as a direct child to the Window (and thus making it a sibling - not a child - to contentItem). Works now. Thanks so much Felix
  • 1 Votes
    1 Posts
    632 Views
    No one has replied
  • Guidance Required for Smooth Progress Fill Rendering in Qt (QML + C++)

    Unsolved
    1
    0 Votes
    1 Posts
    618 Views
    No one has replied
  • How to make Text input look like WinUI3 inputs?

    Unsolved qml quick2 style
    1
    0 Votes
    1 Posts
    716 Views
    No one has replied
  • Custom titlebar on Linux with Desktop Integration

    Unsolved linux titlebar title bar linux desktop gnome
    1
    0 Votes
    1 Posts
    751 Views
    No one has replied
  • How to clear TextEdit's textDocument.source?

    Unsolved
    8
    0 Votes
    8 Posts
    3k Views
    D
    @jayrickaby Regarding textDocument.source reset in QT Quick: I can see you're frustrated — this is a genuinely tricky QQuickTextDocument limitation! The short answer: You cannot directly "unset" textDocument.source once it's been set via QML/JS. Qt doesn't expose a clean reset method for it. The real solution — handle it from Python backend: pythonfrom PySide6.QtCore import QObject, Slot, Signal class Backend(QObject): fileCleared = Signal() requestSaveAs = Signal() def __init__(self): super().__init__() self.current_path = None # None = unsaved new file @Slot() def new_file(self): self.current_path = None self.fileCleared.emit() # Tell QML to clear the text @Slot(str) def save_file(self, text): if self.current_path is None: self.requestSaveAs.emit() else: with open(self.current_path, 'w') as f: f.write(text) @Slot(str) def open_file(self, path): self.current_path = path qmlTextEdit { id: textEdit } Connections { target: backend function onFileCleared() { textEdit.clear() // Don't touch textDocument.source at all } } Why your attempts failed: source = "" — Qt tries to resolve empty string as a URL, document loses context source = undefined — QUrl binding is strict, doesn't accept undefined new URL() — wrong argument count for QUrl constructor textEdit.clear() — works but leaves source stale (which is fine!) The key insight: textDocument.source is only meant for loading files. For a "New File" action, just track the file path in Python as None, call textEdit.clear() in QML, and never touch textDocument.source until the user actually opens or saves a real file. The stale source does not affect editing at all. Edit: removed spam content
  • 0 Votes
    4 Posts
    2k Views
    J
    Thanks Christian — that lines up. I checked the qt/qtbase 6.11 branch and the fix is right there in QDockWidgetGroupWindow::reparentToMainWindow() (src/widgets/widgets/qmainwindowlayout.cpp): an early mwLayout->savedState.clear();, with a comment that nails the cause: mwLayout->widgetAnimator.abort(dockWidget); // The saved state is now invalid because it contains // a reference to the dock widget inside the group window. // - the dock widget has been reparented. // - if it was the last dock widget, the group window will be deleted // => clear saved state. mwLayout->savedState.clear(); That matches the root cause exactly: the drag's savedState snapshot shares QLayoutItem* with layoutState, reparentToMainWindow() invalidates them, and the nested setFloating() → endDrag() → restore() replays the stale snapshot in reparentWidgets() → the AV. (Reassuring to land on the same one-liner independently.) So for anyone hitting this on 6.11.1 before 6.11.2 ships: the one-line backport above in reparentToMainWindow() fixes it — verified on Windows 11 / Qt 6.11.1 / MSVC x64 (2→1 tear no longer crashes; create/move and the 3→2 tear are unaffected). And once on 6.11.2 / 6.12 the official fix covers it, so the local patch can just be dropped. Thanks again for the quick pointer!
  • Get QtGraphs with XYModelMapper working

    Unsolved
    15
    0 Votes
    15 Posts
    6k Views
    JoeCFDJ
    @Bob64 You are right. I did not pay attention to it.
  • A Simple Question About Icons Of Window

    Solved
    3
    0 Votes
    3 Posts
    2k Views
    K
    @jsulm said in A Simple Question About Icons Of Window: @Kansas said in A Simple Question About Icons Of Window: But I think ApplicationWindow does have the property "icon" right? Wrong. See https://doc.qt.io/qt-6/qml-qtquick-controls-applicationwindow.html What icons do you mean? The icons in the title bar of the window (close/minimize/maximize)? Oh, I see. Thanks a lot. I specifically mean the icons in the title bar of the window, but I also want to set the icon of the exe. I'll search it again carefully. Thank you again.