Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Most basic imports

    1
    0 Votes
    1 Posts
    426 Views
    No one has replied
  • [solved] How to modify Gradient in a state's PropertyChange?

    2
    0 Votes
    2 Posts
    2k Views
    D
    I found the solution: Simply give each GradientStop an id, and use these ids as the target of the PropertyChange.
  • Embedding a QWindow inside a QML scene?

    3
    0 Votes
    3 Posts
    4k Views
    D
    I'm not actually trying to embed a QML scene within another QML scene, I am more interested how it could be done than actually doing it. What I really want to be able to do is embed any QWindow in a QML scene like you can do in QWidgets with QWidget::createWindowContainer. What I want to do with this is embed external windows in a QML applications (for example, Java windows or SDL windows). I've a hack that works well enough, but it would be nice to have proper integration. Basically, I can get the window id from the external window (both Swing and SDL2 let you do this easily if you have access to the source, I'm sure other GUI tools do too. Otherwise you can get it through platform API's), then I use QWindow::fromWinId(...) to create a new QWindow from the existing native window. Then I can setParent to reparent the window to my existing QML window and use mapToScene and position()/size() of the QML Item where I want to position the external window. When the "parent" item changes position or size, I need to change my QWindows position and size too. Now I have an external window "embedded" in a QML scene. Of course, its far from perfect... for one, the window is basically just overlayed over the scene, so it doesn't play nice with QML elements that might be overlapping it. Even if you could embed properly, this may still be the case though. Also, I find that input capture is very... hit or miss... with this approach. The second approach I've had success with (and input capture seems to work much better) is basically the opposite: create a QWindow, get its windId and then have the external window created from that id. SDL 2 supports this with SDL_CreateWindowFrom, not sure about other libraries though and this only works if you have access to the window creation code, so doesn't work for many use cases. bq. This was possible in Qt Quick 1, but not Qt Quick 2. Hmm. I was sure I saw something that was essentially the opposite of QWidget::createWindowContainer, but I can't find it now and don't have time to go digging... I know there was some work around Qt 5.0 or 5.1 to render QWidgets to a texture and then render that within QML and I thought I remembered 5.1.1 or 5.2 or something release it, but I could be wrong.
  • Problem with states when pressed

    5
    0 Votes
    5 Posts
    1k Views
    K
    When you release mouse this state @states: State { when: icon.pressed PropertyChanges { target: mask; opacity: 0.75 } }@ stops working because of when is not set to true, it works fine withour flickable. But with flickable area from time to time when i click a button it gets dark(state works) and move my finger a little bit signal about releasing it is not sent. I think its because flickable get the signals now. in 95% it works perfectly but there is this 5% that is annoying and I am not sure if my app freezed or its just this bug
  • Multimedia keys

    1
    0 Votes
    1 Posts
    679 Views
    No one has replied
  • Large virtual canvas

    2
    0 Votes
    2 Posts
    1k Views
    R
    Solved this problem with requestDraw() at event when canvas window go outside of the drawn tile(s).
  • [Solved] Qml Canvas loadImage not working

    3
    0 Votes
    3 Posts
    4k Views
    SGaistS
    Hi and welcome to devnet, The SSL errors are probably completely unrelated. However the path problem is more a string problem, one backslash means that you are escaping the next character so you are giving something invalid. On windows you would need to use two backslashes if you wanted to keep that notation. But you already found out that you can use the unix notation which is less error prone with Qt :) Since you found the solution, can you please update the thread title prepending [solved] so other forum users may know a solution has been found :) Happy coding !
  • QtQuick 2 unreliable, breaking and showing "anonymous" error messages ?!?

    1
    0 Votes
    1 Posts
    547 Views
    No one has replied
  • Getting bytes from VideoOutput

    1
    0 Votes
    1 Posts
    458 Views
    No one has replied
  • 0 Votes
    5 Posts
    2k Views
    D
    Hi thanks, but I already dismissed the idea and switched to a horizontal listview for swiping through pages (what i wanted to achieve with the gesture area). So the only example available is the one you posted.
  • No mechanism to be notified by QImage on last reference to private data

    1
    0 Votes
    1 Posts
    620 Views
    No one has replied
  • Cant make Instantiator work with QList<QObject*>

    11
    0 Votes
    11 Posts
    3k Views
    S
    Thanks, I'll check this
  • How to queue the invocation of a slot instead of calling directly ?

    3
    0 Votes
    3 Posts
    1k Views
    T
    [quote author="chrisadams" date="1402025578"] The closest you can do is create a Timer object with a timeout of 1 millisecond (actually, 0 might work, not sure), and invoke the function in the onTriggered / onTimeout or whatever it's called, handler. @[/quote] Agreed, without adding additional underlying code this is probably the best solution. An interval of 0 works for this too, in my experience.
  • QtQuick very slow on linux

    3
    0 Votes
    3 Posts
    1k Views
    T
    Most of the unexpected performance problems seen with QML seem to relate to rendering, particularly when OpenGL rendering is being carried out using software rendering rather than hardware. If you haven't updated your graphics drivers then that would be the first thing to check.
  • Qt Quick Compiler

    2
    0 Votes
    2 Posts
    2k Views
    sierdzioS
    Ask Digia, maybe they will make some special offer for you. Otherwise, you need the whole commercial package, AFAIK.
  • How to use other items in a view?

    2
    0 Votes
    2 Posts
    909 Views
    C
    Okay, I have found a way: @TableView { TableViewColumn{id: col1; role: "V1"; title: "VALUE_1"; width: 100 } TableViewColumn{ role: "V2"; title: "VALUE_2"; width: 100 } model: testModel itemDelegate:Item{ Button{ visible: styleData.column === 0 id: arrow tooltip: "Left" } Text { anchors.left: arrow.right text: styleData.value } } }@ I suppose the itemDelegate in QML is different from the delegate-functionality in QtWidget because in QML there is no user action like clicking needed before the delegation widget will be drawed and usable, right? Or did I oversee a property with the QtWidgets which enables also an immediately using of the delegate widget?
  • Way to filter/search ListView contents

    4
    0 Votes
    4 Posts
    6k Views
    JKSHJ
    Sorry, my brain wasn't working properly -- I completely missed the fact that you're working in QML. Anyway, does this help?: http://kunalmaemo.blogspot.com.au/2013/04/creating-qml-listview-with-search.html (I Googled "QML filter model")
  • HowTo: Struct -> QVariant -> QML type

    2
    0 Votes
    2 Posts
    2k Views
    V
    I think you should wrap your struct in an QObject-derived class, and then register this class to QML engine so that you can instantiate the class in QML. You can create a method, which is callable in QML, in the class to assign values to your struct via QML code.
  • Render texture to QQuickFramebufferObject using OpenGL

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Typo in attached property scoping example?

    1
    0 Votes
    1 Posts
    467 Views
    No one has replied