Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
how to access the axwidget in qthread or qconcurrent
->i want access the axwidget in qthread but it gives assert failure....
->if i create axwidget in qthread it gives error like this
ASSERT failure in QWidget: "Widgets must be created in the GUI thread.", file kernel\qwidget.cpp, line 1126
->if i create a axwidget in main thread and i tried to a access the object from new thread again it gives error like this
assert failure in qcoreapplication::sendevent: "cannot send events to objects owned by a different thread
**here is my code **
viewstack::viewstack(QWidget *parent) : QDialog(parent)
excel = new QAxWidget("Excel.Application", 0);
in this code qdebug is executing....
i want access the axwidget in qthread
However this thread might be helpful:
any other ways to create axwidgets in thread.....
my application is like this the main thread is writting the data continously in excel.....and the qthread need to read continously......
one more question how to access the axobjects in thread....
I don't know about AX objects (I don't actively develop on windows and you're better off asking MSDN that), but widgets are not thread-safe, nor reentrant. You will not be able to access them concurrently at all. You must serialize the accesses to the widgets through the event loop, there's no other way.
thanks for ur info.....
I Tried QAxObject instead of QAxWidgetand CoInitialize() there..... it works fine in another thread.