Skip to content

QML and Qt Quick

Looking for The Bling Thing(tm)? Post here!
20.0k Topics 77.3k Posts
  • dynamically load images during runtime

    Unsolved
    9
    0 Votes
    9 Posts
    2k Views
    SGaistS
    As @rrlopez already wrote, use the file:// scheme and you can access the files.
  • Is it possible to use Text.ElideMiddle for each row in a TextArea?

    Solved
    2
    0 Votes
    2 Posts
    394 Views
    J.HilkJ
    @april_heard I would say, this looks like a job for a listview. You can define your own delegate and than elide it. That way only the display is changed, the underlying data is unchanged.
  • animation in behavior, that signal not work

    Unsolved
    3
    0 Votes
    3 Posts
    549 Views
    C
    understood, It is not support
  • Hi Qt embedded Application is getting crashed.

    Solved
    6
    0 Votes
    6 Posts
    810 Views
    K
    Thanks Dheerendra and sierdzio. Issue is resolved. @sierdzio , yes you are correct, it is Qt issue in libQt5Qml.so.5.12.3 and it is fixed in libQt5Qml.so.5.12.5. Thanks, Kadappa Pujari
  • 0 Votes
    6 Posts
    1k Views
    ArtiomA
    It really works! Thank you, IntruderExcluder, GrecKo.
  • How to clear old point using qt charts when end of plot is reached?

    Unsolved
    1
    0 Votes
    1 Posts
    389 Views
    No one has replied
  • state error

    Unsolved
    1
    0 Votes
    1 Posts
    184 Views
    No one has replied
  • QML: How to drag & drop files to application's main window?

    Unsolved
    2
    0 Votes
    2 Posts
    2k Views
    IntruderExcluderI
    The example below works fine both for text and files (Linux Mint with Nemo as file manager): DropArea { anchors.fill: parent onDropped: { console.log(drop.text); } }
  • PinchArea QML not working on XCB QT 5.13.2 built.

    Unsolved
    1
    0 Votes
    1 Posts
    122 Views
    No one has replied
  • How to integrate the JSONListModel into my project?

    Unsolved
    1
    0 Votes
    1 Posts
    163 Views
    No one has replied
  • QML TreeView

    Unsolved
    7
    0 Votes
    7 Posts
    612 Views
    B
    @VeNToR I am really sorry but I don't think I understand well enough what you are trying to achieve to be able to make any sensible suggestions.
  • 0 Votes
    1 Posts
    358 Views
    No one has replied
  • Retrieve object from QML files other than the main.qml

    Unsolved
    8
    0 Votes
    8 Posts
    1k Views
    S
    @LeLev In the main.qml file I have navigation elements (e.g. Drawer) and other UI elements (e.g. tabs, splitter etc.) and inside the main.qml I need to display MyRect.qml (it holds the VtkFboItem). I also need to connect the VtkFboItem with the C++ object to display AND interact with 3D graphics. ApplicationWindow { id: root Rectangle { id: screenCanvasUI anchors.fill: parent Drawer{ …….. } MyRect{ } } Button { id: openFileButton text: "Add Model" …………... } FileDialog {.....} }//end:ApplicationWindow /MyRect.qml file: Item{ VtkFboItem { objectName: "vtkFboItem" anchors.fill: parent MouseArea { ............. } }//end: VtkFBO }//end: Item //main.cpp file ....... // Load main QML file engine.load(QUrl("qrc:/resources/main.qml")); // Get reference to the QVTKFramebufferObjectItem created in QML QObject* rootObject = engine.rootObjects()[0]; m_vtkFboItem = rootObject->findChild<QVTKFramebufferObjectItem*>("vtkFboItem"); QObject* rootObject = engine.rootObjects()[0]; m_vtkFboItem = rootObject->findChild<QVTKFramebufferObjectItem*>("vtkFboItem"); if (m_vtkFboItem) { m_vtkFboItem->setProcessingEngine(m_processingEngine); connect(m_vtkFboItem, &QVTKFramebufferObjectItem::rendererInitialized, this, &CanvasHandler::startApplication); ..................... } app.exec(); In the above scenario, how should I be able to find and connect to the vtkFboItem from the main.cpp? Is there any other way to achieve this apart from the objectName? I have attached here a screenshot of the final UI that I am trying to achieve.[image: 18b7b2b6-55d7-41b3-ae0a-fb399fe27e30.PNG]
  • How to animate a Image with color?

    Unsolved
    6
    0 Votes
    6 Posts
    548 Views
    ODБOïO
    i don't understand sorry. Image has no color property if you have 2 images each with different color then change the source property to show one or the other
  • Once qml widget lost the focus, It cannt get the focus again

    Unsolved
    5
    0 Votes
    5 Posts
    530 Views
    C
    @rrlopez Thanks for your answer.
  • Property assignments from JavaScript signal handling

    Solved
    7
    0 Votes
    7 Posts
    482 Views
    JKSHJ
    @Bob64 I see that you've received the clarifications you need for this particular issue. If you'd like to further your understanding, see this article: https://doc.qt.io/qt-5/qtqml-syntax-propertybinding.html
  • From QList<MyCLass> by property value to QML property

    Solved
    2
    0 Votes
    2 Posts
    186 Views
    JarggohJ
    Ah, seems it is working fine with Q_INVOKABLE added to the getter method, and using engine.rootContext()->setContextProperty public: Q_INVOKABLE Person* getGuestByName(QVariant name); ..... Person* BirthdayParty::getGuestByName(QVariant name) { QList<Person*>::iterator i; for (i = this->m_guests.begin(); i != this->m_guests.end(); ++i) { if ((*i)->name() == name) { return *i; } } return nullptr; } //main.cpp BirthdayParty parties; QQmlApplicationEngine engine; engine.rootContext()->setContextProperty("parties", &parties); //example.qml Button { id: jack_button property Person boy: parties.getGuestByName("Jack Smith") }
  • 0 Votes
    7 Posts
    640 Views
    WoHowLearnW
    @J-Hilk I haven't tried substitution. But as the QTBUG-67698 last comment says , the exact same code works fine until qt<5.9.
  • QAbstractListModel containing a QAbstractListModel for ComboBox QML

    Unsolved
    4
    0 Votes
    4 Posts
    569 Views
    GrecKoG
    What are the roles of your VideoOptions QALM ? Can't you have a role returning your Format QALM? It's also kinda hard to help you further since this really depends on your data structure and on how you store your data underneath the model.
  • Child process needs to stay in front of parent

    Solved
    10
    0 Votes
    10 Posts
    1k Views
    B
    @JonB This is correct. In theory there is a windows api for this. I started down that rabbit hole and quickly backed out of it because it's a lot of work to track down the correct process. I may have found a solution, but I'm not happy with it: powershell -ExecutionPolicy bypass -Command "add-type -AssemblyName Microsoft.VisualBasic; [Microsoft.VisualBasic.Interaction]::AppActivate(process->processId)" Call that from a QProcess::start(), depending on how finicky your system is you may need to break it into the "powershell" command and a QStringList of arguments, but that does pull the child process to the front.