Reseting QML file

  • Hello Qt community,

    My idea is that I would like to put the .qml file in beginig state after onclick event.
    It is good for refresing data after changes in database.

    Can it be done in QML or I must go in C++?

  • Moderators

    To set the state back to default just run this:
    state = ""

  • This isn't working for me.

    I will try to send signal to main file and reload page from C++.

  • I'm struggling about reloading data to model after onclick event.
    Can you give me any suggestions?

  • I found solution.
    Because I'm using C++ to generate model data QML can't see changes.
    Method setContextProperty in C++ must be called again.

  • I wonder how to pass QmlApplicationViewer from main.cpp to slot?

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.