Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • 0 Votes
    1 Posts
    727 Views
    No one has replied
  • Property variant lose type information?

    20
    0 Votes
    20 Posts
    5k Views
    S
    I'm sorry guys. Can you answer the question: Are children can be updated in runtime? UPDATE: Yes, using component.createObject ad stuff like that. Because children can be updated in runtime I see this as solution. Yes, it's not ideal but it works. Thank you very much to all and especially to sierdzio!
  • Minimizing QT Application [Solved]

    10
    0 Votes
    10 Posts
    3k Views
    SGaistS
    Great ! Thanks for sharing your solution Please, also update the thread title prepending [solved] so other forum users may know a solution has been found :)
  • IntValidator accepts out-of-range 0 ?

    2
    0 Votes
    2 Posts
    763 Views
    J
    I see now, in c++ qt this would produce an intermediate result, in the case of leading-zeros
  • How do I pass keypress events to QQuickFramebufferObject::Renderer?

    4
    0 Votes
    4 Posts
    2k Views
    B
    Forgive my ignorance, but I'm a little new to the concept of having completely separate rendering code. I'm used to being able to read from the logic section during rendering (i.e camera position and rotation, position of objects in the scene etc). From what you're suggesting, it sounds like I need to copy over the entire state of the logical representation during each call to synchronize, or do some kind of bookkeeping of dirty objects, is that right? To me all that synchronization seems like a headache and a bit over the top for the kind of application I'm developing, and that's why I wanted to just get the keypresses in the same thread, so I wouldn't have to worry that much about communication between threads. I'm grateful for the advice though. And I'm still considering keeping the logic in the other thread.
  • Adding scroll indicators to ListView

    2
    0 Votes
    2 Posts
    873 Views
    J
    Something like this? @ import QtQuick 2.1 Row { Rectangle { id: prev width: 10 height: 50 Text { text: "<" color: list.currentIndex > 0 ? "black" : "lightgrey" } MouseArea { anchors.fill: parent onClicked: list.currentIndex = Math.max(0, list.currentIndex - 1) } } ListView { id: list width: 110 height: 50 orientation: ListView.Horizontal clip: true model: 10 delegate: Text { text: " item " + index + " " } } Rectangle { id: next width: 10 height: 50 Text { text: ">" color: list.currentIndex < list.count - 1 ? "black" : "lightgrey" } MouseArea { anchors.fill: parent onClicked: list.currentIndex = Math.min(list.count - 1, list.currentIndex + 1) } } } @
  • Defining a different fontSize according to OS [SOLVED]

    2
    0 Votes
    2 Posts
    773 Views
    B
    As usual, I just need to post a question to find the answer a few seconds later @ import QtQuick 2.0 ... console.log(Qt.platform.os) @ Bidochon
  • Some explanation on destruction

    1
    0 Votes
    1 Posts
    576 Views
    No one has replied
  • QML PathView: change current index of pathview via mouse wheel

    2
    0 Votes
    2 Posts
    1k Views
    O
    Hey, i would go ahead and create a MouseArea where ever you need to catch the Mousewheel event. As you can see in the documentation, there is a onWheel(WheelEvent wheel) event. bq. This handler is called in response to both mouse wheel and trackpad scroll gestures. The wheel parameter provides information about the event, including the x and y position, any buttons currently pressed, and information about the wheel movement, including angleDelta and pixelDelta. Just create the notification in your MouseArea using onWheel: and handle it on your purpuses, that means increase or decreate the currentIndex of your PathView. For further information please read: "MouseArea onWheel":http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-mousearea.html#onWheel-signal
  • 0 Votes
    8 Posts
    4k Views
    O
    [quote author="usovalx" date="1394227143"]I'm pretty convinced by now that it is impossible to properly use table models with TableView. I looked at the sources, and it appears TableView is built around ListView. The only question I have left -- as I would have to simulate complex data structure, I'm wondering which representation is more effective: QMap<String, QVariant> or QJsonObject? Which one is cheaper to store in the model and return into QML?[/quote] Since you can parse a ListModel to QML, i am pretty sure that it also should work with a more complex Model. I will give it a try and tell you how and if it worked. About the QJsonObject/QMap-Question: A QMap basically provides a fast-lookup assosiated with the key, so i am not sure if a QJsonObject is faster, and based on the simplicity i would say a QMap should be a very little bit easier, but i haven't worked with QJsonObject, yet. My info is based on what i found out.
  • Running QML application package

    6
    0 Votes
    6 Posts
    2k Views
    O
    You're welcome, i'm glad that you could solve your problem.
  • How can I chain scrolling events from Listview to Flickable ?

    8
    0 Votes
    8 Posts
    2k Views
    A
    In my case, I solved the bug. The reason was I added a mouse area in Image which located in flickable. In case of this, just set value of mouse area's z as 999. It works now.
  • Why ListModel can contain only Loader instances but not Item

    1
    0 Votes
    1 Posts
    644 Views
    No one has replied
  • [SOLVED]QtQuick Combobox reset list index not working

    6
    0 Votes
    6 Posts
    2k Views
    B
    Hi p3c0, yes i was using version Qt 5.2.0 now upgraded to Qt 5.2.1 and it works fine. Thank you for your help.
  • 0 Votes
    6 Posts
    6k Views
    S
    How did you solve it i have a similar issue, it works in debug but not in release ... I have it before the viewer as well but it does not help ..
  • How to display the values that I get on column of the table widget

    5
    0 Votes
    5 Posts
    2k Views
    R
    [quote author="onek24" date="1394198514"]Hello and welcome to devnet, you have to basically call the name of the role in your delegate, otherwise it would also work if you call the data function of your model and pass the DisplayRole and index as parameters.[/quote] i tried to create table widget in mainwindow and it show in my app QTableWidgetItem *xHeaderItem = new QTableWidgetItem(tr("x"));//Set header label ui->tableWidget->setHorizontalHeaderItem(0, xHeaderItem); xHeaderItem->setTextAlignment(Qt::AlignCenter); then I need to show my result which is done when the user click run button: i can show my result on text browser by using the following line: ui->textBrowser->setText(QString("%1").arg(result_x)); now i need to show the result in table widget and my result is group of calculated numbers that should be display in the column 1 of the table widget. please can you give any example that may help me to understand how to set values in the table widget
  • 2 dimensions flickable GridView

    3
    0 Votes
    3 Posts
    1k Views
    V
    The bad side is that a ListView or a GridView manage the cache memory (with cacheBuffer propertie) while with an Repeater, I have to create and delete my items manually :-(.
  • [SOLVED] Problem Using Directory Import for QML Files

    3
    0 Votes
    3 Posts
    1k Views
    E
    That did it! So... id properties have to start with lowercase (that I read somewhere), but component names have to start with upper case? That I didn't see anywhere. Thanks bloke! -Eric
  • Passing c++ pointers to a QQuickItem subclass created in QML

    5
    0 Votes
    5 Posts
    3k Views
    Q
    I don't like singletons either and I don't think they would be necessary here; QML has no reason to actually use the data other than pass it off to another c++ object, which happens infrequently, therefore I wouldn't expect any gains from the QML Engine's optimization on a QML singleton. Nor do I see a need to make it a singleton on the c++ side; it's simply a single object that is exposed. The object is in the same scope as the QML engine itself (created in main.cpp) so there is no risk of it getting deleted as long as the program is alive.
  • [SOLVED] One out of two Q_PROPERTY working

    2
    0 Votes
    2 Posts
    729 Views
    M
    I have been looking for this for about an hour and four my problem, silly mistakes when registering types with copy/paste , both My1stObject and My2ndObject where registered with the same qmlName