Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.4k Posts
  • Switch Keyboard-Focus between ListView and GridView

    2
    0 Votes
    2 Posts
    1k Views
    S
    Any help :(?
  • [Solved] How I can change menu style?

    6
    0 Votes
    6 Posts
    1k Views
    X
    http://qt-project.org/wiki/New-Features-in-Qt-5.3 bq. MenuStyle and MenuBarStyle introduced.
  • [SOLVED] Passing a List of Urls from QML to C++ using a signal

    11
    0 Votes
    11 Posts
    7k Views
    L
    Yes that works. I thought I had to use a signal because it was mentioned here in this forum. But it is much easier just to pass on the URLList right into a function as you say. It works very fine now. With your reply of two lines you saved me a couple of hours of trail and error. Many thanks for that (:
  • QML Listview onClick event(solved)

    7
    0 Votes
    7 Posts
    6k Views
    X
    [quote author="t3685" date="1395946982"]Don't forget to take into account originX and originY as well. [/quote] There is no need for that if you use a MouseArea in the delegate or what do you mean!?
  • [SOLVED] childrenRect.height is incorrect if child reduces in size

    3
    0 Votes
    3 Posts
    5k Views
    N
    Thanks for the reply Xander. Rather than looping the child elements, it seemed simpler to just calculate the height based on the y co-ords of the top of the View, and the lowest element in the view. So, Rect1.qml becomes: @ import QtQuick 1.1 Rectangle { id: r1 anchors { left: parent.left right: parent.right } color: "red" height: (text2.y - r1.y + text2.height) Text { text: "rectext1\ntextline2" id: text1 maximumLineCount: 1 } Text { id: text2 anchors.top: text1.bottom anchors.right: parent.right text: "rectext1right" } onChildrenRectChanged: { console.log("onChildrenRectChanged") } MouseArea { anchors.fill: parent onClicked: { console.log("pre resize child height: " + r1.childrenRect.height) if (text1.maximumLineCount === 1) text1.maximumLineCount = 2 else text1.maximumLineCount = 1 console.log("post resize child height: " + r1.childrenRect.height) } } } @ This seems like a reasonable work around to me. Once again, thanks for your help.
  • Drag an Item to another application (Solved)

    10
    0 Votes
    10 Posts
    6k Views
    T
    Until now, I don't know how to use drag and drop to external program using QML ; but we can incorporate with C++. For ex: in C++: @class A :public QObject {//remember to register A to be used in QML Q_OBJECT Q_INVOKABLE void DraggingProcessing(QObject *rect) { QString strWidth = rect->property( "width" ).toString(); QString strHeight = rect->property( "height" ).toString(); QDrag * drag = new QDrag( rect ); QMimeData* mime = new QMimeData; // a custom mime type so that no other app would ever accept it mime->setText( strWidth + " " + strHeight ); drag->setMimeData( mime ); QPixmap pix; //get pixmap here drag->setPixmap( pix );//to set the image while dragging drag->exec( Qt::CopyAction ); } in QML: A { id: a } Rectangle { id: rect width:100 height:100 MouseArea { id:mouseArea anchors.fill: parent onPositionChanged : a.DraggingProcessing(rect) } }@ Open a text editor and drag rectangle to that text editor. Width and Height of that rectangle will be displayed on text editor The detail of drag and drop in C++ : http://qt-project.org/doc/qt-4.8/dnd.html Anyway, thanks onek24 for your guide, hope to receive your help in future
  • UI Library for prototyping

    2
    0 Votes
    2 Posts
    930 Views
    EddyE
    Hi sandrobrito, Welcome to the devnet forums. There are qml widgets for desktop that adapt to the look and feel of windows, mac and linux. Unfortunately this is not the case for mobile. I would suggest you to use the mailinglists for your proposal to help in this area since there you will find more developers working on Qt. This forum is more user oriented.
  • Android 3rd party virtual keyboard not working with TextInput (Qt 5.2.1)

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • GlReadPixels - what am I missing?

    2
    0 Votes
    2 Posts
    2k Views
    A
    GL_RGBA8 is not a valid pixel data type. Try GL_UNSIGNED_BYTE instead. See http://www.khronos.org/opengles/sdk/docs/man/xhtml/glReadPixels.xml
  • C++/QML architecture - a way to reproduce C++ structure in QML ?

    2
    0 Votes
    2 Posts
    1k Views
    strahlexS
    Hello, I am not sure what exactly you are trying to do but you can take a look the code of my project: https://github.com/strahlex/QtQuickVcp I parse the children of my QtQuickItem recursively and check for the type. (https://github.com/strahlex/QtQuickVcp/blob/master/hal/qcomponent.cpp#L296) This way you can modify the Items directly from C++. You can also take a look at how I created new QML Items from C++ and how I let them interact in QML. Regards Alexander
  • Get the value of QML Editbox from c++

    2
    0 Votes
    2 Posts
    1k Views
    T
    I think that: http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-interactqmlfromcpp.html is what you are looking for. Read it carefully - the safer and recommended approach is to expose some C++ object to Qml and bind your "textbox" properties to it. This way you are able to handle "textbox" properties in C++ code.
  • [Solved] Structuring a QtQuick (plugin) project

    1
    0 Votes
    1 Posts
    520 Views
    No one has replied
  • [Solved] Focus, child items, and the end of my wits

    6
    0 Votes
    6 Posts
    3k Views
    S
    The key points to getting this was: Understanding that FocusScope is a chain going up ancestry I needed to was to forceActiveFocus on the child I wanted to get the active focus so it would bubble up to the parent that eventually had the RectangularGlow attached. Simply setting child.focus = true was not sufficient. Thanks for the quick help Xander84!
  • [ignored] Video type broken in Qt 5.3?

    4
    0 Votes
    4 Posts
    1k Views
    O
    Well it's a beta, so there might occure some errors for sure.
  • QML Android best practice to send a custom Intent (share URL)

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 0 Votes
    3 Posts
    835 Views
    X
    seems like your dynamically created button has no size ( width and height)? that is why you won't see the Rectangle I guess. Edit: eddy was faster :D
  • Custom QQuickItem -- accessing QML functions from c++

    7
    0 Votes
    7 Posts
    3k Views
    Q
    I got it to work by simply doing this: QObject*t=this; This essentially casts it and I can then pass t as the the object. Wise? It is working now and I can call the QML function in this way. There appears to be no other way to directly pass a custom class to invokeMethod. I agree that it shouldn't make a difference since my this class derives from QQuickItem which derives from QObject. I wonder what is going on?
  • [solved][TableView] Access of elements and data

    3
    0 Votes
    3 Posts
    1k Views
    Z
    Ok my bad, I didn't see that styleData.row :) Should be right now ;)
  • QML Nested Repeater

    6
    0 Votes
    6 Posts
    5k Views
    X
    just tried it in my program, when I try to run with more than 1 item as the delegate of a repeater I get an error "Cannot assign multiple values to a singular property" and "The program has unexpectedly finished." anyway did you change your model or is it working like that now? I always use the object notation for objects, like the JSON notation also that better to read I think. also tested it to be clear: @[foo:"bar"]@ that is a syntax error, even qt creator can't parse that, so how is your code even running.. very weird with your model :p so you have to use @{foo:"bar"}@ for objects (dictionaries)
  • Undostack (QAction and all QUndo* classes) in QtQuick application

    1
    0 Votes
    1 Posts
    543 Views
    No one has replied