Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    20 Views
    No one has replied
  • 0 Votes
    2 Posts
    214 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
    185 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
    691 Views
    O
    @qtmsfp everything setted
  • QtQuick vs QtQml (Qt 6.2)

    Solved
    6
    0 Votes
    6 Posts
    623 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
    160 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
  • Using Repeater inside ListModel

    Solved
    3
    0 Votes
    3 Posts
    565 Views
    D
    Thank you! I wasn't aware of that function, it works now. I'll leave the code if ever it can be useful for someone else. Component.onCompleted: { var i for(i = beginPartOne; i < beginPartTwo; i++) listModel.append({"val": i}) for(i = beginPartTwo; i < beginPartThree; i += 0.5) listModel.append({"val": i}) for(i = beginPartThree; i <= endOfRange; i++) listModel.append({"val": i}) } // each loop adds each segment below // 15 16 17 | 18 18.5 19 19.5 20 20.5 21 21.5 22 22.5 | 23 24 25 26 27 28 29 30
  • OpenGL Under QML - depth issue

    Unsolved
    1
    0 Votes
    1 Posts
    178 Views
    No one has replied
  • [HELP] : access QML object on c++

    Solved
    4
    0 Votes
    4 Posts
    366 Views
    J
    @sierdzio said in [HELP] : access QML object on c++: First of all, findChild() will scan for objectName: "me", not for id: me. Second, you should probably search through children of the engine. Third: read the docs :-) https://doc.qt.io/qt-6/qtqml-cppintegration-interactqmlfromcpp.html and https://doc.qt.io/qt-6/qtqml-cppintegration-overview.html hi , thanks , got it working :) i thought that findChild is looking for id will mark this as solved thanks :)
  • Pane and binding loop

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