Solved how to make a customized constructor in Qt ...
-
I'm triying to make a customized constructor like this
class SelectPlanDialog : public QDialog
{
Q_OBJECTpublic:
explicit SelectPlanDialog(QWidget *parent = 0);
explicit SelectPlanDialog(QStringList &idChsed, QStringList &planChsed, int maxSampleSize);
...
and for some reason it doesnt work...pls how can i fix it? -
Hi
in what way "doesnt work" ?Do you get compile error?
-
when i run it the solution have an error, something with "test.exe a quitté avec code -1073741819"
-
@mrjj
when i run it the solution have an error, something with "test.exe a quitté avec code -1073741819" -
@kasysbi said in how to make a customized constructor in Qt ...:
quitté avec code
Is that something like "Application closed with error code -1073741819" ?
Why do you think its related to your constructor ?
-
@mrjj
yes -
@mrjj
i think its related to my constructor because at the time i try not to overload that constructor everything work fine. Then i overload it aigain and this appear to my screen
with that error code -1073741819 -
explicit keyword means that you want to explicitly pass the parameter with the same type without implicit conversion made by the compiler.
Try to kick off the explicit and see what happens
Thanks
-
@kasysbi Can you show the content of that constructor and the code where you use it?
"how to make a customized constructor in Qt" - this isn't a Qt topic as Qt is not a programming language. It's a C++ topic. -
@Charlie_Hdz
i were right...i did as you said, removed the explicit type and it finaly worked. thanks!