Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Sharing component instance with nested components

    Unsolved
    2
    0 Votes
    2 Posts
    385 Views
    B
    For now, I have got the first approach I mentioned working. For this I have renamed the ApplicationWindow id to be a meaningful, "well known" name, appWindow. I also needed to introduce a property alias for the shared id to make it accessible from child components. I am still interested in comments about what would be the recommended approach here.
  • How QtPositioning.coordToMercator() works?

    Unsolved
    1
    0 Votes
    1 Posts
    172 Views
    No one has replied
  • Error when accessing C++ property or method from QML

    Solved
    3
    0 Votes
    3 Posts
    287 Views
    D
    @J-Hilk Hi you saved my day, bro. Thanks so much!
  • Overloading QDebug in QtObject subclass

    Solved
    3
    0 Votes
    3 Posts
    218 Views
    kkoehneK
    @Tobias-Fensch said in Overloading QDebug in QtObject subclass: "Test DebugClass: DebugClass(0x2af8d9e1250)" The <<-Operator is never called. It's not called because you pipe the pointer to your type, but the operator<<() expects a value (const reference) of your type. To make C++ call your operator<<() make sure to de-reference the pointer.
  • 0 Votes
    1 Posts
    603 Views
    No one has replied
  • How to integrate a VirtualKeyboard for FileDialog?

    Unsolved
    1
    0 Votes
    1 Posts
    177 Views
    No one has replied
  • where we should use Component

    Solved
    5
    0 Votes
    5 Posts
    444 Views
    D
    @ODБOï Thanks very much.
  • QML Variant property undefined

    Solved
    6
    0 Votes
    6 Posts
    869 Views
    ODБOïO
    @dalishi you're welcome 😉
  • Flow component with elements flowing from center

    Unsolved
    2
    0 Votes
    2 Posts
    411 Views
    ODБOïO
    @NaLogo hi Im not sure this is exactly what you want You can calculate the number of items in the row, create containers with the right size to make the items centered (dividing the avalable space by the number of items), then put your items in the center of the containers import QtQuick import QtQuick.Window import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 Window { id:w width: 640 height: 480 visible: true property var randomWidths : [] property int columnNumber: 3 property int rowsNumber: repeater.count / columnNumber Component.onCompleted: { for(var i = 0; i < 16; i++){ randomWidths[i] = Math.random() * (w.width/3) } repeater.model++ } Flow { id: flow anchors.fill: parent Repeater { id: repeater model:5 delegate: Rectangle { //CONTAINER property int row: Math.floor(index / columnNumber) property int itemsCount: getItemsCount() function getItemsCount(){ if(row< rowsNumber) return columnNumber else return repeater.count % columnNumber } width: Math.floor(flow.width / itemsCount) height: 80 // uncomment these 2 lines to see the borders of the container //border.width: 1 //border.color: "red" Rectangle{ // your items height: parent.height/2 width: randomWidths[index] //Math.random()*(w.width/3) border.width: 1 anchors.centerIn: parent Text { text: qsTr("item %1").arg(index) anchors.centerIn: parent } } } } } RowLayout{ anchors.bottom: parent.bottom width: parent.width Button{ text: "-" onClicked: {if(repeater.model > 0)repeater.model-- } Layout.fillWidth : true } Button{ text: "+" onClicked: { if(repeater.model<randomWidths.length)repeater.model++} Layout.fillWidth : true } } }
  • Display orientation

    Unsolved
    3
    0 Votes
    3 Posts
    349 Views
    MarkkyboyM
    Post a working snippet of your code. I also use 2 monitors but both are landscape as there is no stand adjustment.
  • STM32MP1 cross compile for QML application

    Unsolved
    3
    0 Votes
    3 Posts
    495 Views
    R
    I'm in the same condition. I have built my qt-image for STM32MP1 and with Qt IDE I have created an example QtQuick. I have settled all the IDE parameters for the debug on my device(STM32MP157C-DK2 board) and the debug start correctly but when start the error is that the QtQuick controls lib is not installed. I don't know if I need to install the QtQuick controls 2.2 lib also on the device machine, or I have other problem. My device tell me on com port that is right connected and the debug start correctly. The display of my device start with white page but the error appear in the terminal. Some help?
  • Some logical reasons not to give up Qt

    Unsolved
    6
    1 Votes
    6 Posts
    652 Views
    D
    @ali-aydin said in Some logical reasons not to give up Qt: I want to give up Qt because every new thing in it is new challenge that waste time most of features not working well generally it made me crazy Then you should switch to Java and JavaFX. Writing Java code is IMHO much faster than c++ and you get the joy of the „newest“ sh*t in java UIs. There you can write fancy apps which do exhibit different errors on different platforms (sometimes depending on the used JVM as well), are horrible to debug and you can wait lightyears until some of them ever get fixed. All for free and no #ifdefs ;)
  • This topic is deleted!

    Unsolved
    2
    0 Votes
    2 Posts
    8 Views
  • ListElement: cannot use script for property value

    Unsolved listelement property
    2
    0 Votes
    2 Posts
    3k Views
    ODБOïO
    hi @Rohith you can remove the iconColour from your model and simply assign it directly Button { text: qsTr(name) implicitWidth: 162 implicitHeight: 162 iconColor: (themes.name === 'day') ? 'black' : 'white' onClicked: gridBtnClicked(name, index) } or put all your colors in an array then iconColor: myArrayOfColors[index] or if your model is too complicated you can use a c++ model and expose it to qml
  • Cannot align controls properly in layouts

    Solved layouts qml
    3
    0 Votes
    3 Posts
    2k Views
    A
    @ODБOï said in Cannot align controls properly in layouts: Layout.fillWidth: true This worked for me, thanks
  • QT/VisualStudio Assertion failed only when debug

    Unsolved
    9
    0 Votes
    9 Posts
    976 Views
    elicatE
    Good morning My project uses QtWebEngine. I don't think it's a windows graphics setting. Many forms are opened without errors even in debug but to some forms at the end of their loading the Assertion problem is issued. A specific form, opens without problems and then clicking on a tabs that opens a section of the form (therefore a jquery / boostrap action) produces the assertiveness error. The error reports the following library: libGLESv2.dll Assertion Failed I also tried to install a new version of Qt but I had other problems that led me to open another ticket Setting up Visual Studio 2019 for creating QT6 projects
  • how to run exe file

    Solved
    26
    0 Votes
    26 Posts
    4k Views
    ali-aydinA
    @J-Hilk yes it worked on the laptop and I moved it to pc and on the pc worked too thank you for your help
  • My custom C++ plugin is not being consumed by the qml test application

    Unsolved
    1
    0 Votes
    1 Posts
    148 Views
    No one has replied
  • Debug functions to assert which phase the render thread and main thread are in

    Unsolved
    4
    0 Votes
    4 Posts
    404 Views
    JarrodJ
    Better solution using metaObject(): constexpr auto kQtRenderThreadClassName = "QSGRenderThread"; bool util::thread::isQtRender() { Q_ASSERT(QThread::currentThread()); QString threadName { QThread::currentThread()->metaObject()->className() }; return threadName == kQtRenderThreadClassName; }
  • This topic is deleted!

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