This might be a general programming question, but since I'm using Qt i thought this would be the right place to ask. I'm programming a GUI client-server application. I'm encountering some difficulties on the client side. I have a login class in which I'm using a socket for the connection ( the user is prompted to introduce IP address and PORT in order to move on). Next, I have some sort of a menu. I want to use the same socket, but since it's declared in the login class, I can't (at this moment). I already tried to use inheritance; it looks something like:
class Footbal : public QDialog, public Login
But I get an error:
‘QObject’ is an ambiguos base of ‘Footbal’ - 4 times. And a warning : Class Footbal inherits from two QObject subclasses QDialog and Login. This is not supported!
From what I noticed, it's because of QDialog - I tried to use QApplication instead but I got errors since I work with setModal() function.
I really need an alternative. Singleton pattern would be the worst case scenario since I'm terrible at design patterns.
Thanks for reading all this much
Bookmarks