跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.2k 主題 77.8k 貼文
  • Recommended way to implement properties window in QML

    5
    0 評價
    5 貼文
    2k 瀏覽
    X
    After some digging those are the two recommended ways I have found as well. Even though the hiding option apparently performs quite bad when you start to add more controls to the property window. So the loader seems to be the way to go. I did look into the QtCreator source they however seem to build up the control from text strings that are the individual components. Then they send the completed test to the Qml engine to build up all controls. Probably the most efficient way but it certainly doesn't seem to be simple or easy to maintain.
  • Difference between QQmlApplicationEngine and QtQuick2ApplicationViewer

    2
    0 評價
    2 貼文
    2k 瀏覽
    V
    You can run QML profiler to test the speed.
  • Drawing irregular shapes

    2
    0 評價
    2 貼文
    1k 瀏覽
    G
    Hi, You could try to do it in QML using a Canvas and http://qt-project.org/doc/qt-5/qml-qtquick-context2d.html#arc-method. I did it in C++ once and it worked out well, but the Canvas should work just as well.
  • How to crop an image inside an item (rectangle)?

    5
    0 評價
    5 貼文
    4k 瀏覽
    Q
    Woooow! Perfect! That's exactly what I need! Thank you so much
  • Grid View Qml Item hide with cell

    1
    0 評價
    1 貼文
    985 瀏覽
    尚無回覆
  • How to get Screen Coordinates of a QML Item?

    6
    0 評價
    6 貼文
    7k 瀏覽
    T
    None of these are actually screen coordinates. They are all relative to the main window which could be anywhere.
  • QML: Receive signals from C++ object in different thread

    3
    0 評價
    3 貼文
    2k 瀏覽
    L
    its gonna be a lot of code to post. but, the way it works now is: the qml window's (window2,qml) parent is declared in main.qml (window1.qml). I then have a mainThread.cpp that connects to main.qml, so, any object running (e.g. test.cpp) in a different thread emits a signal to mainThread.cpp, and this signal is received by main.qml, then main.qml calls a function (decalred in window1.qml) to access the child window (window2.qml) and to process the signal emitted by test.cpp). so, i have main.qml, that receives any signals and passes it to the relevant window. thats what i'm not happy with. If there is a pattern to access the signal (emitted from test.cpp) directly to window2.qml, bypassing main.qml, I'd be very happy. but Window2.qml cannot receive signals directly from test.cpp. From what I could tell, I'd probably have to add something like this into the test.cpp object: QmlApplicationViewer viewer; viewer.setMainQmlFile(QLatinString("qml/project_folder/Window2.qml"); viewer.showExpanded(); but I want to confirm that I'm on the right track, if not, can you do it, and how do you do it. Thanks!
  • Mysterious height handling and Point size <= 0 assert

    3
    0 評價
    3 貼文
    5k 瀏覽
    K
    thanks, but this will not solve the problem: we lose the dynamic height if somewhere changes the parent geometry the assert message is also shown because the binding of parent.height is in the timeline after the signal handling (using QML Profiler) At the moment my solution is @font { family: "Arial" pointSize: getFontSize(0.10 * height) }@ where getFontSize is a very simple function @function getFontSize(s) { return s === 0 ? 1 : s; }@ But over all I haven't found some useful documentation how can we handle all the sizes of a QML application. From my point of view I need to lot width, height informations also when I use layouts.
  • 0 評價
    3 貼文
    1k 瀏覽
    M
    Ok SGaist: I followed your suggestion: the issue has been filed to the bug report system as "QTBUG-39621":https://bugreports.qt-project.org/browse/QTBUG-39621 I am going to update this discussion thread as soon as I have some news about it.
  • Sharing same data class through diferent qmlRegisterTypes

    1
    0 評價
    1 貼文
    549 瀏覽
    尚無回覆
  • Menu Style?

    2
    0 評價
    2 貼文
    1k 瀏覽
    Q
    This post is probably no longer relevant but just a FYI, Qt 5.3 has added MenuStyle; custom styling for Menu object in QML : https://qt-project.org/doc/qt-5/qml-qtquick-controls-styles-menustyle.html#frame-prop
  • [SOLVED] Problem with disable action areas (TextField, ...)

    3
    0 評價
    3 貼文
    2k 瀏覽
    H
    Thanks for the answer. The enabled-property works fine now. For some reason, few days ago, it didnt worked...
  • QtQuick Controls Slider pressed signal

    1
    0 評價
    1 貼文
    678 瀏覽
    尚無回覆
  • RCC Parse Error for adding qm file using QTranslate

    1
    0 評價
    1 貼文
    3k 瀏覽
    尚無回覆
  • How to substitute a QAbstractItemModel with a QList<double> role with a QML ListModel?

    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • QML array alternative syntax

    4
    0 評價
    4 貼文
    1k 瀏覽
    D
    edit: not useful anymore
  • [solved] Strange behaviour when animating opacity

    2
    0 評價
    2 貼文
    676 瀏覽
    D
    Oops, I think I already figured it out... I forgot to mention properites: "opacity" in the NumberAnimation. Apparently, ColorAnimation assumes the targeted property is "color", while NumberAnimation can't know. Sorry for the stupid question! Cheers
  • [Solved] Writing to one role of a C++ provided ListModel

    3
    0 評價
    3 貼文
    7k 瀏覽
    _
    Hi, there is something I don't understand here, I dont understand why there is no way to set the data of a DataItem more easily. Let me explain myself : In the delegate of the QML list view, we can easily refer to properties thanks to the property <-> role mapping. So, when we write the following : @ ListView { ... // This is a C++ ListModel of DataItems model: datamodel ... delegate: Text { ... // note is the rolename assiociated to NoteRole enum. // The following line calls // ListModel::data(const QModelIndex &index, int role) // I then assume that index is known somewhere in QML text: note ... MouseArea { ... onDoubleClicked: { // I expected the following line to call // ListModel::setData() but it's not. // the application output tells me that I can't access // a read-only property, why ?? // Event if DataItem had a // Q_PROPERTY (note READ note WRITE setNote ...) // I'd still have the message. parent.text = "I changed the note" } } } ... } @ Why can't we set a property without worrying about the index ?
  • Block JS execution in same thread -- is it possible?

    1
    0 評價
    1 貼文
    558 瀏覽
    尚無回覆
  • [solved] How to create a binding from C++ to a QML property?

    8
    0 評價
    8 貼文
    2k 瀏覽
    D
    I finally solved the problem in a most stupidly simple way! In the component that is dynamically loaded, I added the following: @ Component.onCompleted: { parent.height = height; } @ Cheers!