Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Grid layout spacing issue (Solved)

    6
    0 Votes
    6 Posts
    2k Views
    O
    Hey, i'm glad that it is solved. You can also set the color of the rectangle to "transparent", that will work too. Anyways, please add [solved] to the topic, thank you. Alex
  • What is a XMLListModel query. Could someone give me a clear understanding

    1
    0 Votes
    1 Posts
    554 Views
    No one has replied
  • Connect QObject properties to a QQmlComponent

    3
    0 Votes
    3 Posts
    1k Views
    0
    Nice, using the modelData property I managed to create a C++ function that gives me the data object for the modelData object (I'd thought there would be some other way though). Thank you, Jan
  • Date manipulations

    4
    0 Votes
    4 Posts
    949 Views
    F
    Ok it seems there is no official method to do it so I use : @ function dateDiffInDays(date1, date2) { var timeDiff = Math.abs(date2.getTime() - date1.getTime()); return Math.ceil(timeDiff / (1000 * 3600 * 24)); } @
  • Key Navigation in ListView Component -> Set Focus to ListView Element

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Overwrite internal properties

    2
    0 Votes
    2 Posts
    1k Views
    O
    Found the property component i was searching for in the MenuStyle.qml which is used by Menu which is used by ComboBox. I am using a ComboBox and i need to change or overwrite this property: @property Component menuItem: Rectangle{...}@ Is there any possibility for me to do that only for one ComboBox? I really dont want to replace multiple control-components and styles with custom ones...
  • Qmlscene leaking memory on simple qml file

    2
    0 Votes
    2 Posts
    899 Views
    S
    Seems like this is QTBUG-28712 Please vote for it as it seems important
  • QML pages compilation issue

    9
    0 Votes
    9 Posts
    2k Views
    JKSHJ
    [quote author="JKSH" date="1395066257"][quote author="aabc" date="1395039338"]So can you please explain me what does the compilation segment on the QML profiler mean ?[/quote]That's a JavaScript JIT compiler[/quote]Sorry, I wasn't quite correct. This post explains QML "compilation": https://www.kdab.com/qml-engine-internals-part-1-qml-file-loading/ Basically, it parses a QML file and stores optimized data in RAM, to make it faster to generate C++ objects. [quote author="aabc" date="1395067289"]I want to reduce the QML pages loading time. I have some QML pages who takes 200ms to compile .[/quote]You can defer loading by using a "Loader":http://qt-project.org/doc/qt-5/qml-qtquick-loader.html, or load a component asynchronously by using "Component.incubateObject()":http://qt-project.org/doc/qt-5/qml-qtqml-component.html#incubateObject-method
  • Item visibylity in a ListView

    3
    0 Votes
    3 Posts
    1k Views
    M
    Thanks it works..I knew about that property but never thought of using it..
  • Visible area of an children Rectangle

    6
    0 Votes
    6 Posts
    2k Views
    O
    You're welcome, i'm sure someone else knows a better method. :)
  • How to use Camera on Android and MeidiaPlayer on Windows?

    2
    0 Votes
    2 Posts
    1k Views
    O
    Hello, you can use Qt.platform.os to check for the operating system and bind it to the visible property of your components: @Camera { id: camera visible: Qt.platform.os == "android" captureMode: Camera.CaptureVideo videoRecorder { resolution: Qt.size(640, 480) frameRate: 20 } onError: { console.debug(errorString) } } MediaPlayer { id: mediaplayer visible: Qt.platform.os != "android" source: "D:/CI/AVA/PedestrianV2/data/subway.avi" }@ Otherwise you can load custom QML-Files based on the OS or a Loader which loads the Camera or the MediaPlayer dependent on the operating system: @Loader { source: Qt.platform.os == "android" ? camera : mediaplayer }@ For further information please read: "Platform Property":http://doc-snapshot.qt-project.org/qt5-release/qtqml/qml-qtqml2-qt.html#platform-prop "Loader":http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-loader.html
  • Set scale property based on different screen resolutions(Solved)

    6
    0 Votes
    6 Posts
    3k Views
    O
    You're welcome, please add [Solved] to the topic. Thank you.
  • Drap and Drop pixmap support?

    4
    0 Votes
    4 Posts
    1k Views
    M
    My purpose is to set the QDrag's pixmap so that when i am doing an external drag i see a snapshot of the item i am moving. I would also like to know can i use drag and Item first as Internal drag and as soon as I detect MouseArea::mouseX is outside the some rect then I switch to External drag. Basically i want something like below:- Mouse-pressed Mouse-Moved ------Start internal drag ----------Mouse move event -------------Check if mouse position is out of rect, -----------------Yes it is outside rect start External drag ------------------------DragEnter -----------------------------If in the same window cancel External Drag and Start Internal Drag else continue. Basically i want to have external as well as internal drag inside the same drag sequence? Please let me know if it is possible?
  • XMLHttpRequest -> timeout and ontimeout doesnt work

    3
    0 Votes
    3 Posts
    2k Views
    D
    Unfortunately your list doesnt help. If others have the same problem, my current workaround is to use a Timer after every request and check if a variable has been touched until the Timer is triggered.
  • [Solved] Change style property of QML element over event

    4
    0 Votes
    4 Posts
    1k Views
    O
    You're welcome, i'm glad that i could help you.
  • [SOLVED]StackViewDelegate getTransition

    3
    0 Votes
    3 Posts
    1k Views
    W
    Thank you. That worked.
  • Qtquick application event handling from c++ class

    2
    0 Votes
    2 Posts
    716 Views
    H
    There are several ways to do this it depends on the design of your application. But a good start is the chapter "qtqml-c++-Integration Chapter in te Docu":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-topic.html
  • Focus problems making a custom spinner

    1
    0 Votes
    1 Posts
    472 Views
    No one has replied
  • [solved]Modifying text value inside qml

    9
    0 Votes
    9 Posts
    3k Views
    O
    bq. Thanks again, your answers are so clear, this is so delightful and I am so eager to learn. You're welcome, thank you. I'm glad that i can help you with your questions and encourage you. bq. So if i understand well, there is a keyboard handler somewhere hidden Well, yes. Keys is also just a Component like Rectangle and MouseArea. You can also try to write it like that ... @Keys { }@ ... but your console/output will write: Keys is only available via attached properties. That means this Component can not be standalone and has to be written like a property in any Component you want. bq. that triggers a signal as soon as a key is pressed and there is a slot by default that is onPressed that receive the signal and that triggers an action Yes, it detects the key press as soon as we press a key and emits a signal based on which key it was. As you can see in the "Keys":http://qt-project.org/doc/qt-4.8/qml-keys.html Documentation, there are several signals handlers. A signal handler is just the slot/notificator i explained in a post above. Let's take the "onDigit9Pressed":http://qt-project.org/doc/qt-4.8/qml-keys.html#onDigit9Pressed-signal slot/nofiticator as our example. We press the Key 9 Our Keys Component receives the event and checks which signals it can emit: onDigit9Pressed and onPressed (Remind! This are just the slots of the signals, the signals it would emit would be: digit9Pressed(KeyEvent event) and pressed(KeyEvent event)) It sees that we have got a slot connected to the signal, that would be the onPressed slot(I took your Application as an example for that because we have got a onPressed: slot there). The signal emits the slot and everything after the colon would be the code to execute. bq. So my question is a little bit tricky? Where is the Pressed() signal? The pressed(KeyEvent event) signal is hidden in the Keys Component. Kind of like we created our signal. bq. is it by default in QtQuick? Is there no possibility of confusion? It is by default part of a Component. And there is no confusion because each Component handles it's intern stuff by itself. You could create a pressed() signal in each Component. But the onPressed: slot would also be just part of the Component where the signal is, that means you can also have a onPressed event in each Component where the signal pressed() is and they wouldn't conflict. An exeption would be the top-level Component, the properties and signals defined in the top-level component are accessable from everywhere. The top-level Component is the first Component you have got: @Rectangle { // Our top-level Component, there can be only one. Text { // Children ... } MouseArea{ // Children Text { // Children ... } ... } ... }@
  • Issues with using object.destroy()

    4
    0 Votes
    4 Posts
    1k Views
    M
    also, the reset button which creates this confirmation box is the only thing I can't click to elicit a 'console.log("fsdafa")' line after I click 'No' and destroy the box. The other menu options still print to the console