Hi ~~ ^^
i have a small problem on QRPT
i am using it just testing o print reports for supermarket ..
so i have 4 columns and almost 510 rows in QTableView
the problem is when i try to preview it took almost 6 to 8 seconds to render the preview .. that's not a problem at all but it freezes the GUI of the all software on those seconds ..
i tried QThread but it didn't fix it
~~ just i want a solution of GUI Freeze during rendering the preview
aliks-os hi bro , thanks for great support , i removed setparent of QtRpt but The same problem
during rendering ... Software GUI Freeze for 6 to 7 seconds ~!
is There Any way to fix that?
i am sure rendering would take time but at least program gui need stay responive to the user~!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
aliks-os thank you so much bro , the best support ever i wish the happiest life for you bro thank you <3
if you fix it where i can find the new code or you will set a new version!
Last edit: Proton Phoenix 2022-05-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QtRPT(0xb0b75c0), parent's thread is QThread(0xc3bf610), current thread is QThread(0x59fa440)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QtRPT(0xb0b75c0), parent's thread is QThread(0xc3bf610), current thread is QThread(0x59fa440)
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
QPainter::begin(): Returned false
QObject::connect: Cannot queue arguments of type 'DataSetInfo&'
(Make sure 'DataSetInfo&' is registered using qRegisterMetaType().)
QPainter::resetMatrix: Painter not active
QPainter::save: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::resetMatrix: Painter not active
""
~~~
Last edit: Proton Phoenix 2022-05-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
now after building the latest version with replacing the new file and replacing QMetaObject ...
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QtRPT(0xc3a3a90), parent's thread is QThread(0x80a5600), current thread is QThread(0x5a5a2e0)
QObject::connect: Cannot queue arguments of type 'DataSetInfo&'
(Make sure 'DataSetInfo&' is registered using qRegisterMetaType().)
starting evaluate
QObject::connect: Cannot queue arguments of type 'QVariant&'
(Make sure 'QVariant&' is registered using qRegisterMetaType().)
A White Screen and software freeze ...
using this code
if i put thread as parent of QtRPT it works and no white screen
but the gui freeze and this error show's up constantly
starting evaluate
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Uncaught exception at line 1 : "SyntaxError: Unexpected token '"
Uncaught exception at line 1 : "SyntaxError: Unexpected token'"
Hi ~~ ^^
i have a small problem on QRPT
i am using it just testing o print reports for supermarket ..
so i have 4 columns and almost 510 rows in QTableView
the problem is when i try to preview it took almost 6 to 8 seconds to render the preview .. that's not a problem at all but it freezes the GUI of the all software on those seconds ..
i tried QThread but it didn't fix it
~~ just i want a solution of GUI Freeze during rendering the preview
Last edit: Proton Phoenix 2022-05-22
hi many thanks for using QtRPT project. Yes the moving instance of QtRpt to the thread is a good solution.
I think you dont need assign parent to Qtrpt.
aliks-os hi bro , thanks for great support , i removed setparent of QtRpt but The same problem
during rendering ... Software GUI Freeze for 6 to 7 seconds ~!
is There Any way to fix that?
i am sure rendering would take time but at least program gui need stay responive to the user~!
do you have any warning in Qt Creator when execute print generation?
QObject::moveToThread: Cannot move objects with a parent
this message shows up during rendering
by the way i removed setparent of qrpt instance
Last edit: Proton Phoenix 2022-05-22
looks like the QtRPT is not moved to the QThread
yes is there any solution!!? advice
yes, it is. I will try to make some small correction in the code. I hope in 1H will be ready
aliks-os thank you so much bro , the best support ever i wish the happiest life for you bro thank you <3
if you fix it where i can find the new code or you will set a new version!
Last edit: Proton Phoenix 2022-05-22
do you use DLL and build from source code?
Yes both
update from git repo (sourceforge) the file qtrpt.h
ok bro i understand it now
you helped me a lot
thank you for everything
And try run as below
thread= new QThread();
// QMessageBox::information(this,"W",dirpath.append(""),QMessageBox::Ok);
report->loadReport(dirpath);
QObject::connect(report, SIGNAL(setValue(const int, const QString, QVariant&, const int)),
this, SLOT(setValue(int, QString, QVariant&, int)));
QObject::connect(report, SIGNAL(setDSInfo(DataSetInfo&)),
this, SLOT(setDSInfo(DataSetInfo&)));
QObject::connect(thread, &QThread::started, this, =
{
QMetaObject::invokeMethod(report,
"printExec",
Qt::QueuedConnection,
Q_ARG(bool, true),
Q_ARG(bool, false)
);
});
thread->start();
report->printExec(true,false);
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QtRPT(0xb0b75c0), parent's thread is QThread(0xc3bf610), current thread is QThread(0x59fa440)
QObject: Cannot create children for a parent that is in a different thread.
(Parent is QtRPT(0xb0b75c0), parent's thread is QThread(0xc3bf610), current thread is QThread(0x59fa440)
QObject::installEventFilter(): Cannot filter events for objects in a different thread.
QPainter::begin(): Returned false
QObject::connect: Cannot queue arguments of type 'DataSetInfo&'
(Make sure 'DataSetInfo&' is registered using qRegisterMetaType().)
QPainter::resetMatrix: Painter not active
QPainter::save: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::resetMatrix: Painter not active
""
~~~
Last edit: Proton Phoenix 2022-05-22
without report->printExec .....
QMetaObject::invokeMethod: No such method QtRPT::printExec(bool,bool)
did you replace qtrpt.h by file from git repo?
please replace as
now after building the latest version with replacing the new file and replacing QMetaObject ...
A White Screen and software freeze ...
using this code
Last edit: Proton Phoenix 2022-05-22
I have tested on my side and I am affraid to directly use a QtRPT in a thread, I need to redo a lot in it.
You can create an intermediate class in which the QtRPT will be located and called. And put this intermediate class in the thread
i understand bro , your project is the best of it's kind on qt frameowork
thank you for your great support
i will try to do what you told me