Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • StatusBar is not a type

    Unsolved
    2
    0 Votes
    2 Posts
    200 Views
    A
    As I found this problem only in Qt 6.2 when I select the minimum required version of QT 5.x - everything works. Obviously, in 6.2, the order of registration of components has somehow changed Who knows how to fix it or do it right ?
  • Add c++ model to qml

    Unsolved qml c++ cmake
    1
    0 Votes
    1 Posts
    292 Views
    No one has replied
  • Changing the query of QSqlQueryModel from qml: how to change column heading?

    Unsolved
    5
    0 Votes
    5 Posts
    464 Views
    push_backP
    I may had an error in my model, but I chose to keep KSortFilterProxyModel for filtering and sorting because it works and as you said it makes a better job and it is simpler. So there is still that warning from qml when I dynamically build TableViewColumn using an Instantiator: qml: TableView::insertColumn(): you cannot add a column to multiple views Here is a code to reproduce that error: (Data are taken from Qt's table view documentation) import QtQuick 2.15 import QtQuick.Window 2.15 import QtQuick.Controls 1.4 Window { id: window width: 640 height: 480 visible: true title: qsTr("Hello World") ListModel { id: libraryModel ListElement { title: "A Masterpiece" author: "Gabriel" } ListElement { title: "Brilliance" author: "Jens" } ListElement { title: "Outstanding" author: "Frederik" } } ListModel { id: headerModel ListElement { role: "title" title: "Title" } ListElement { role: "author" title: "Author" } } TableView { width: window.width id: tableView model: libraryModel Instantiator { model: headerModel.count onObjectAdded: tableView.addColumn(object) onObjectRemoved: tableView.removeColumn(object) TableViewColumn { role: headerModel.get(index).role title: headerModel.get(index).title } } } }
  • 0 Votes
    8 Posts
    1k Views
    JonBJ
    @shokarta said in KeyStrokes: Parameter "event" is not declared. Injection of parameters into signal handlers is deprecated. Use JavaScript functions with formal parameters instead.: yea i tried that before, but this does not work at all But what you chose to type is not what I wrote or quoted from, the idea is to copy what works not change it.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • 0 Votes
    2 Posts
    215 Views
    fcarneyF
    Use QDateTime, not QDate. Date in QML also includes time. Edit: Notice this link does not mention using QDate at all. It is because the conversion is lossy and you will have date errors.
  • cell index of tableview on click

    Solved
    3
    0 Votes
    3 Posts
    186 Views
    R
    Hi, I solved the problem in a different way. I past my code, if it can help anybody. import QtQuick import QtQuick.Controls 2.15 import QtQuick.Layouts 1.15 import QtQuick.Controls.Material 2.15 import ChangesTableModel 1.0 Item { id: mainview anchors.fill: parent Row { id: header width: logslist.contentWidth height: 50 x: -logslist.contentX z: 1 spacing: 0 Repeater { model: ["Here", "are", "my", "headers", ":-)"] Rectangle { width: 80 height: parent.height color: "orange" Text { anchors.centerIn: parent wrapMode: Text.WrapAtWordBoundaryOrAnywhere text: modelData } } } } TableView { id: logslist anchors.fill: parent anchors.topMargin: header.height columnSpacing: 0 rowSpacing: 0 clip: true model: ChangesTableModel {} boundsBehavior: Flickable.StopAtBounds onWidthChanged: logslist.forceLayout() columnWidthProvider: function (column) {return 80} delegate: Rectangle { id:mycell implicitWidth: logslist.columnWidthProvider(column) implicitHeight: celltext.height border.color: "gray" border.width: 1 color: choosenTheme < 1 ? "white" : "#303030" //color: (heading === true) ? "red" : "green" Text { id: celltext padding: 2 text: tabledata verticalAlignment: Text.AlignVCenter elide: Text.ElideRight color: choosenTheme < 1 ? "black" : "white" font.pixelSize: 12 } MouseArea { anchors.fill: parent onClicked: { console.log("cell[" + mycell.x / mycell.implicitWidth + "," + mycell.y / mycell.implicitHeight + "]") } } } ScrollBar.vertical: ScrollBar {} ScrollBar.horizontal: ScrollBar {} } } The solution was to move the MouseArea from the TableView to the delegate: Rectangle and then calculate the cell from their position and with and height.
  • How could I edit the color of axis text of qml ChartView?

    Unsolved
    3
    0 Votes
    3 Posts
    2k Views
    K
    Although this is an old question, I also met this question and I want to try to reply it. I use BarSeries instead of LineSeries, and I think they are the same in this question. Here is the code: BarSeries { id: mySeries property var value1: [2, 2, 3, 4, 5, 6] property var value2: [5, 1, 2, 4, 1, 7] property var value3: [3, 5, 8, 13, 5, 8] property int valueMax axisX: BarCategoryAxis { categories: ["1", "2", "3", "4", "5", "6" ] ; labelsColor: "white"; gridVisible: false; color:"#7e7e7e";} axisY: ValueAxis { labelsColor: "white"; max: mySeries.valueMax; min:0; color: "#00000000";gridLineColor: "#666"} BarSet { label: "Bob"; values: mySeries.value1 ; color:"#177ddc"; labelColor: "#dcdcdc"; borderColor: "#177ddc"; } BarSet { label: "Susan"; values: mySeries.value2 ; color:"yellow";labelColor: "#dcdcdc"} BarSet { label: "James"; values: mySeries.value3 ; color:"blue";labelColor: "#dcdcdc"} } Setting the color of labelsColor in both axisX and axisY with BarCategoryAxis and ValueAxis can edit the color of axis text. You can try it.
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    10 Views
    No one has replied
  • 0 Votes
    6 Posts
    2k Views
    K
    [image: 1a84bcf2-e978-4306-9e33-07d2a6831905.png] [image: 9e210786-92a6-4a97-89a5-575368aa4a39.png]
  • ui in qt design is not displayed

    Unsolved qml design qtcreator qt quick
    3
    0 Votes
    3 Posts
    698 Views
    O
    @qtmsfp everything setted
  • QtQuick vs QtQml (Qt 6.2)

    Solved
    6
    0 Votes
    6 Posts
    629 Views
    P
    @GrecKo said in QtQuick vs QtQml (Qt 6.2): There is a QtQml QML module providing non-visual types. There is a QtQuick QML module providing visual types. Thanks, that's a great, succinct explanation!
  • QML singleton in CMake (Qt 6.2)

    Solved
    3
    0 Votes
    3 Posts
    611 Views
    P
    @GrecKo said in QML singleton in CMake (Qt 6.2): QT_QML_SOURCE_TYPENAME Thanks. I really should learn to read. It was in the same paragraph as QT_QML_SINGLETON_TYPE. 🤦
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    5 Views
    No one has replied
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    4 Views
    No one has replied
  • [URGENT]Virtual Keyboard keys pressed twice when touched once

    Unsolved
    2
    0 Votes
    2 Posts
    206 Views
    Axel SpoerlA
    Which OS are you using? Better to switch to Qt 5.15 which is LTS. 5.13 is not supported any more.
  • This topic is deleted!

    Unsolved
    4
    0 Votes
    4 Posts
    94 Views
  • QML mouse handlers

    Unsolved
    1
    0 Votes
    1 Posts
    161 Views
    No one has replied
  • How can i enable selection on TableView in QML Qt6.3?

    Solved
    4
    0 Votes
    4 Posts
    1k Views
    ?
    sry, i will open a dedicate topic and mark this as resolved. Thank you
  • QML. How do you test it?

    Unsolved
    1
    0 Votes
    1 Posts
    188 Views
    No one has replied