Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.1k Topics 77.8k Posts
  • [SOLVED]Read Image from Android Storage in Qml

    7
    0 Votes
    7 Posts
    6k Views
    NoWhereMan1979N
    @beemaneni be aware that some QML components like Canvas, save files into local paths, so you should subtract the "file://" part.
  • Create icons similar to ISO icons?

    Unsolved
    4
    0 Votes
    4 Posts
    599 Views
    K
    Hi SGaist, yes, I was referring to these icons. There is a link to some of these icons here, and they also work in the non commercial Qt version. https://wiki.qt.io/QtDesignStudio So I was interested if there is a way to convert graphics drawn in GIMP or a simmilar programm to the same type as these icon files so I can change the color in an easy way. raven-worx, that is a fairly easy way to do it. Thanks for the help. That is what I'll do. I would still be interested if there is a way to convert graphics. Why would the Qt developers only let us use these ISO icon like this?
  • Binding loop problem in an application with QML&C++

    Unsolved
    6
    0 Votes
    6 Posts
    913 Views
    SGaistS
    @fcarney said in Binding loop problem in an application with QML&C++: If 2 C++ objects as written were bound to each other like this they would indeed keep firing as there are no checks. Indeed they will and it even has a name: a signal storm :)
  • Dynamic Property Updates : It works, room for improvement/refinement?

    Unsolved
    1
    0 Votes
    1 Posts
    631 Views
    No one has replied
  • Distributing fonts

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    M
    Thanks. So here it expects a fileName, and if the file is in the resources, it should start with :/, alright.
  • How to make a window inactive?

    Solved
    9
    0 Votes
    9 Posts
    2k Views
    S
    @Shrinidhi-Upadhyaya Thank you very much!
  • Disable TextInput update during editing

    Unsolved
    6
    0 Votes
    6 Posts
    844 Views
    Shrinidhi UpadhyayaS
    Hi @Mark81 ,yeah it depends upon how complex things you need to handle, for example if you just need to handle only 2 scenarios like if the value of "myFooVar" is "1", you want to display "Hello" else "Bye" then, you can do like text: myFooVar === 1 ? "Hello" : "Bye" I dont think there is a predefined property or a function to retrieve or store the last value.
  • Cascading properties

    Unsolved
    4
    0 Votes
    4 Posts
    598 Views
    sierdzioS
    @Mark81 said in Cascading properties: @sierdzio Oh thank you. I admit I didn't get the difference! I thought it was the very same thing, just at different time. Here is how to remember it easily: a = b assigns value of b to a at that exact moment when it is called (imperative assignment, same as in C++ or JS) a: b updates a when b changes (declarative assignment)
  • 0 Votes
    5 Posts
    2k Views
    K
    QML : TableView { model: TableModel {} } main.cpp qmlRegisterType<TableModel>("TableModel", 0, 1, "TableModel"); TableModel.h QVector<QVector<QString>> m_Model; TableModel.cpp // Here is where data is getting set bool TableModel::setData(const QModelIndex &indexPos, const QVariant &value, int role) { if(data(indexPos, role) == value) return false; QString key = m_Model.at(indexPos.row()).at(indexPos.column()-1); qDebug() << "KEY:" << key; m_Model.replace(indexPos.row(),{key, value}); qDebug() << "Model Data Changed!!!" << m_Model; QModelIndex start = index(1,0); emit dataChanged(start, indexPos, {role}); return true; } void changeModel() { setData(index(1,1), "abc"); } It is a table with two columns , a key value pair kind and the data change wil be triggered from cpp function changeModel() . Currently I was changing just the second row (1st row after header ) 2nd column value. So In the Output of qDebug() << "Model data Changed!!!" , I am seeing the new model, but UI is not getting updated.
  • How works "property Item ufo: ufo" in root?

    Solved
    3
    0 Votes
    3 Posts
    377 Views
    J
    @sierdzio said in How works "property Item ufo: ufo" in root?: your main.qml, then this line has no purpose and can be safely removed. If it is not your main.qml file, then such declaration can be used to ex Thank you very much! A nice day.
  • ->setContextProperty doesn't work

    Solved qqmlapplication
    5
    0 Votes
    5 Posts
    2k Views
    Q
    @J.Hilk I think it was just an error while re-writing my code. My dev computer has no internet connection. I was supposed to use qstr
  • Qt 5.11+: import of a qrc:/directory not working with QtQuickCompiler

    Unsolved
    3
    0 Votes
    3 Posts
    475 Views
    M
    Yes, the application works normally.
  • setContextProperty: Best practice for having the rootContext

    Unsolved
    2
    0 Votes
    2 Posts
    352 Views
    SGaistS
    Hi, It's not clear why you want to have access to the QML context from within your C++ class. It sounds rather like a bad idea. What does that class do except containing that model you mentioned ?
  • ListView goes up when model updated

    Solved
    13
    0 Votes
    13 Posts
    5k Views
    D
    @J.Hilk It works ! Thank you ! Did not know that I had to use the flickableItem. Wish I could use some fresh Qt 5.12.
  • Expose QAbstractItemModel as a property?

    Unsolved
    3
    0 Votes
    3 Posts
    436 Views
    GrecKoG
    The right type to expose it is QAbstractItemModel* or a pointer to your own subclass type if you exposed more functionality. You might have to call qmlRegisterType<T>() (the one with no parameters is enough here).
  • This topic is deleted!

    Unsolved
    1
    0 Votes
    1 Posts
    26 Views
    No one has replied
  • Memory Management in Qml

    Unsolved
    2
    0 Votes
    2 Posts
    638 Views
    W
    I too ran into this type of issue. I am currently pushing/popping between two windows, and am slowly increasing the memory until the app crashes. You ever find any insights or solutions to this issue?
  • Frequency of sending c++ signal to QML

    Unsolved
    2
    0 Votes
    2 Posts
    369 Views
    dheerendraD
    It will receive. It will be delayed as they all will be queued and processed one by one.
  • OSM plugin is not working on deployed target

    Solved
    3
    0 Votes
    3 Posts
    1k Views
    raven-worxR
    @MuratUrsavas the common way for such issues is: set QT_DEBUG_PLUGINS=1 env variable check if the desired plugin is loaded (by inspecting the console output during application start) if the plugin is not loaded check if it's dependencies can be found and loaded (e.g. with ldd on Linux, DependencyWalker on Windows) if the plugin is loaded there should be either a console output, error property or a possible logging rule for the corresponding module
  • How to display the text file content in Qml List view

    Unsolved
    16
    0 Votes
    16 Posts
    6k Views
    sierdzioS
    @Maruko said in How to display the text file content in Qml List view: @sierdzio that's exactly the point. How can I know the number of items to add inside TodoModel::setList ? That's not a question I can answer. You know the ToDoList class, so you should also know the item count. But in setList() you don't need to know the count at all, because that method resets the model. So the model knows it needs to invalidate all indexes and rebuild the whole tree - it does not need to know the count of items. It will get built automatically using model's index(), parent() and rowCount() methods.