How to load QTreeView asynchrone.
-
Hello,
i want to load QTreeView asynchrone. So that the UI not freeze after I click on a Button and load the QTreeView.
For now it is freeze and snychrone.Regards
-
Hello,
i want to load QTreeView asynchrone. So that the UI not freeze after I click on a Button and load the QTreeView.
For now it is freeze and snychrone.Regards
@developer_61 said in How to load QTreeView asynchrone.:
For now it is freeze and snychrone
Please provide more information, especially code where you load the tree. Also, how big is that tree when it's loaded?
-
@jsulm
i mean with freeze for that point where its loading. I want it asynchrone there.void MainWindow::loadQTree(const QString& string) { init(string); //here i'm using in this function an xml parse it etc. cause the tree is build of an xml }
is there no standard to make it asynchronous?
The files are like 28.000 Bytes big. -
@jsulm
i mean with freeze for that point where its loading. I want it asynchrone there.void MainWindow::loadQTree(const QString& string) { init(string); //here i'm using in this function an xml parse it etc. cause the tree is build of an xml }
is there no standard to make it asynchronous?
The files are like 28.000 Bytes big.@developer_61 said in How to load QTreeView asynchrone.:
is there no standard to make it asynchronous?
Use a thread for your XML parsing and send parsed data from that thread to the GUI thread to add it to the tree.
But I'm wondering why parsing of 28kB XML would take that long? Can you show init()? -
@jsulm how to use that thread? and is it possible to do that during this loading with for example an small gear?
no no it is not freezing long, really short time but I still want it to be asynchronous. -
@jsulm how to use that thread? and is it possible to do that during this loading with for example an small gear?
no no it is not freezing long, really short time but I still want it to be asynchronous.@developer_61 said in How to load QTreeView asynchrone.:
how to use that thread?
Start here: https://doc.qt.io/qt-5/thread-basics.html
"is it possible to do that during this loading with for example an small gear?" yes