PDA

View Full Version : Declaring two constructor



Momergil
9th March 2012, 17:25
Hello!

When I learned C++ I learned that when constructing a class one could create more than one constructor function for that class. In fact, we see this in various of the Qt's own classes.

But the problem is that I'm being unable to do the same in my classes; Qt simply don't accept it.

Could somebody please provide me with an example of how can I put two or more constructor functions in one class in Qt?

Thanks!


Momergil

high_flyer
9th March 2012, 18:02
But the problem is that I'm being unable to do the same in my classes; Qt simply don't accept it.
Post your code.

Momergil
9th March 2012, 20:00
\o/

now that I was going to post my example I noticed it's working ¬¬"

I don't know why, anyway. I guess I learned how to do it.


Thanks.

ChrisW67
9th March 2012, 22:47
But the problem is that I'm being unable to do the same in my classes; Qt simply don't accept it.
Could somebody please provide me with an example of how can I put two or more constructor functions in one class in Qt?
This has nothing to do with Qt. This is between you and C++.

Spitfire
12th March 2012, 15:17
\o/
I don't know why, anyway. I guess I learned how to do it.

So you don't know how you know? How you know then that you know? :)

wysota
12th March 2012, 16:11
He knows he doesn't know. He just learned that he didn't know, you know.