at funtion gerarRelatorio i swap the qDeleteAll on line down(original position). and it worked.
qDebug()<<"Documentos processados para a Tabela de Relatorio";
acessodb::setDataUltimoRelatorio(idEmpresa,idCliente);
qDeleteAll(listaDocumentos);
listaDocumentos.clear();
delete modelo;
return true;
I now will upload to my test server, and see what happens.
i doesn't care any more about what is causing the problem, i just hope that is solved.
error: invalid application of 'sizeof' to incomplete type 'QStaticAssertFailure<false>' enum {Q_STATIC_ASSERT_PRIVATE_JOIN(q_static_assert_result, __COUNTER__) = sizeof(QStaticAssertFailure<!!(Condition)>)}
I have just read that: Values of a registered type can be constructed dynamically via QMetaType::construct()
There is an example in the link above. Thanks for your help! I will figure it out, still missing pure c++ knowledge ;)
I couldn't quite believe that this could be an actual bug, so I kept testing.
And the result... oh well... I'm truly ashamed... I have included QDataStream in every file... except the one I actually tested.
So the solution is: #include <QDataStream> Facepalm
Thanks for your tips, I'm now gonna implement what you told me.
I recreate them every time. Are there better way ?
If they change then there's no way around it but if they're the same every frame then it's a waste of time. Generate the list once, store it as a class member and just expose them by reference e.g.
//split that to .h and .cpp of course
class GameWidget : public QWidget {
Q_OBJECT
public:
GameWidget(QWidget* parent = nullptr) : QWidget(parent) {
generateMyListOfObjects();
}
const QVector<Object>& objects() const { return objects_; }
private:
void generateMyListOfObjects() {
//fill the objects vector here
}
QVector<Object> objects_;
};
And how i can connect the slot of differents objects to built-in timer of QWidget ?
You don't. As I said - reimplement the timerEvent method. It will be called every time the timer times out. You can call some methods directly in it or emit a custom signal if you'd like.
You can use the Animation Framework for that. But rather than painting on a widget since you seem to be writing a game, you should take a look at the GraphicsView Framework
My point is simply that blind adherence a principle or method can actually be worse than fully understanding the needs and goals of what you are trying to do.
As this project is intended for industrial purposes I think XML is a great solution.
I followed some tutorials on how to use XML on Qt and managed to make it work (as well as understand) pretty well for what I intended to do.
I'm leaving here the tutorials I followed in case someone stumbles upon this thread with the same problem: (I apologize if this is not allowed)
https://www.youtube.com/watch?v=NXGE5XUrRSI
https://www.youtube.com/watch?v=NzQwJdcdRKE
I had to make some changes to my project but it's easy to understand.