跳到內容

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k 主題 77.8k 貼文
  • [SOLVED] property var array: [ ] doesn't trigger onChanged signal

    8
    1 評價
    8 貼文
    8k 瀏覽
    ?
    Just for the record: How this array stuff works: import QtQuick 2.4 import QtQuick.Controls 1.3 import QtQuick.Window 2.2 ApplicationWindow { title: qsTr("Hello World") width: 640 height: 480 visible: true property var car: [1,2,3] Column { Button { text: "Doesn't work" onClicked: { car[0] = 2 car[1] = 3 car[2] = 1 } } Button { text: "Works" onClicked: car = [3,1,2] } Button { text: "Works, too" onClicked: { car[0] = 6 car[1] = 7 car[2] = 8 carChanged() } } Text { text: "" + car[0] + " " + car[1] + " " + car[2] } } }
  • Porting a "model" using graphicsview-scene framework

    2
    0 評價
    2 貼文
    629 瀏覽
    M
    @thiberi0 said: I would like to know if its possible to create objects dynamically(when someone click some point of screen) and manage them in QML using c++. Yes you can; you can use QML for UI and C++ for the logic (is the standard for non trivial application) There're no plans to drop QtWidgets; but keep in mind that QtQuick is the suggested technology for new applications and it is the one where the Qt developers will spend most of the time. And, last but not least, QtQuick use in a better way accelerated graphics.
  • How to Read and write metadata from/to jpeg/png image from qml/qt?

    8
    0 評價
    8 貼文
    7k 瀏覽
    SGaistS
    Hi and welcome to devnet, Otherwise there's also QExifImageHeader
  • Using margins combined with layouts

    layout margins
    4
    0 評價
    4 貼文
    2k 瀏覽
    M
    You could put the content of the outer rectangles inside a component. This way the code would be hidden away in a separate qml file. cheers Manfred
  • Pleas Help! Status on QtQuick3D ?

    qt3d qtquick qtquick3d qt 5.4.1
    5
    0 評價
    5 貼文
    2k 瀏覽
    M
    That's very promising indeed! Thank you very much! have a nice day! Cheers Manfred
  • implement flickable scrolling on a custom opengl item

    flickable
    3
    0 評價
    3 貼文
    1k 瀏覽
    T
    hmm, not a very elegant way... I'm more interested in a c++ class.
  • error: GL/gl.h: No such file or directory so please suggest me this is Qt problem or Linux

    已鎖定
    2
    0 評價
    2 貼文
    1k 瀏覽
    JKSHJ
    Thread closed. Duplicate of http://forum.qt.io/topic/52164/error-gl-gl-h-no-such-file-or-directory-so-please-suggest-me-this-is-qt-problem-or-linux/
  • Access selected items in ListView when the button is clicked

    3
    0 評價
    3 貼文
    2k 瀏覽
    fecubF
    I think there is no way to make a QML ListView multi-selectable. But you can do something like that: if an element is clicked: set its property selected (or however you call it), and set in delegate that if selected is true, then it should be formatted differently. for example the background color changes to yellow. then add it to a list e.g QList of selected items. You can create a property for this in C++ Later you can get a list of selected items and can handle with this.
  • Locate QML Properties

    qml textedit docs
    9
    0 評價
    9 貼文
    4k 瀏覽
    p3c0P
    @jalomic But QQuickTextEdit is not public and hence can't be casted unless you include the private headers but which again is not recommended.
  • Connect C++ signal to QML function with arguments

    4
    0 評價
    4 貼文
    3k 瀏覽
    JKSHJ
    Hi, It's not clear to me how you set up your C++ code and your QML code. Can you show us more detailed code? @TheQuakee said: I just tried passing argument as QString not QVariant. If you're connecting to a JavaScript function, then your C++ signal needs to use QVariant parameters. All JavaScript functions in QML take parameters of var type, which maps to the QVariant type in C++.
  • camera movement with the fractional time value

    opengl under qm
    2
    0 評價
    2 貼文
    838 瀏覽
    ?
    Hi, you can do this in Javascript like this: var t0 = new Date() var t1 = new Date() var dt = t1 - t0; // delta in ms Cheers!
  • [Solved] No video plackback with QtMultimedia

    video ubuntu gstreamer mpeg4 mp4 xvid avi qtmultimedia qtquick qml
    1
    0 評價
    1 貼文
    1k 瀏覽
    尚無回覆
  • Efficient/correct sync/async QML dynamic object construction/destruction

    qml asynchronous dynamic
    2
    0 評價
    2 貼文
    3k 瀏覽
    ?
    Hi chocis, Yes Yes, otherwise container will contain a bunch of undefined objects. The objects are destroyed immediately when destroy() is called and their memory is also freed immediately (the javascript garbage collector is not involved in this case). The objects are instantiated immediately when createObject() is called, but they are rendered the first time after returning from the onClicked javascript code block. Don't know. You need to measure. If your targeted hardware supports multiple threads: Create the objects outside the GUI thread. Either use incubateObject() in QML or do it in C++ with QThread. In addition: Create invisible objects when the CPU / GUI thread is idle and set them visible as soon as you need them. Don't know. You need to measure. Send signals from QML to other (C++) threads to terminate them. Don't know. Like you already stated, if the component you want to instantiate isn't in a separate qml file then Loader can't be used. Try incubateObject(). Cheers! Wieland
  • 0 評價
    7 貼文
    6k 瀏覽
    VStevenPV
    @p3c0 Thanks for this additional idea. The bug assignee updated and closed the bug, informing me that I should call setKeepMouseGrab(true) during the mousePressEvent handler, then the mouse events would never be stolen. It worked like a charm. Thanks again for your additional ideas. I will mark this thread as Solved.
  • 0 評價
    3 貼文
    2k 瀏覽
    T
    vertexData() returns only the data in ram and not the real VBO which is stored in GPU-ram. As soon as you mark it as dirty it gets completely copied into GPU. Meanwhile I have implemented a direct opengl-way where I create the VBO myself. Thanks anyway! cu
  • StackView - Remove A View Item Without Disturbing Current View

    2
    0 評價
    2 貼文
    2k 瀏覽
    P
    Not really solved but a work-around is to: save the state (ie any variable(s) of interest) in the last item on the stackview clear the stack push back all items except the one being "removed" in the Component.onCompleted of the last item, restore the saved state Ulgy...but works if you only have a few variables that need to be preserved on the last item in the stackview. I guess another way would be to: have a "skip me" boolean in each item pushed evaluate the boolean after a pop immediately pop again if "true".
  • QQuickFramebufferObject redraw

    opengl qopenglframebuf
    2
    0 評價
    2 貼文
    1k 瀏覽
    T
    I solved this problem by creating a vertex- and fragment-shader because there was probably another shader active. Is there a way to mark this topic as solved?
  • Drag qml element outside the application window

    7
    1 評價
    7 貼文
    4k 瀏覽
    p3c0P
    Hi, External drag-drop still doesn't work atleast on Ubuntu 14.04. See QTBUG-41133.
  • Drop Area rejects drag sometimes, which results DropArea to break

    1
    0 評價
    1 貼文
    415 瀏覽
    尚無回覆
  • Bring parent window to the front

    qt quick applicationwind qml
    4
    0 評價
    4 貼文
    2k 瀏覽
    ?
    Interesting: Tried the same with QWidgets. Turns out: Same problem. I'm pretty sure this worked in previous Qt versions.