Slopjong
A geek discovering the World, Tech & Science
Latest Posts
Programming
Mac
Linux
WordPress
Hardware
Howtos
Nerd Trash
Qt Archive
0
Qt: Q_OBJECT macro
Posted on January 12, 2012
I always thought that every class subclassing QObject must contain this macro but this is not completely right. More precisely it is only required if meta-object code has to be [...]
Continue Reading
0
Qt: set the main window title from everywhere
Posted on January 5, 2012
In Qt the title of the main window can be set from everywhere and thankfully to the QApplication class we gain access to all created widgets by using the method [...]
Continue Reading
0
Qt: error message telling the copy constructor is private
Posted on December 30, 2011
In the following code sample a singleton is implemented with a static instance getter which can be called in any other class. class MyClass{ public: static MyClass *instance(){ [...]
Continue Reading
0
Qt: QString constant in a class
Posted on December 24, 2011
A constant QString can be achieved by defining the macro #CONSTSTRING "-_-" and by creating a temporary QString instance in each place the constant is needed e.g. for a window title. ... window.setWindowTitle(QString(CONSTSTRING)); ... A lot [...]
Continue Reading
12
‘staticMetaObject’ is not a member
Posted on October 7, 2008
I tried to compile a code looking like this: #ifndef CONTROLLER_H_ #define CONTROLLER_H_ #include class AbstractClass { public: virtual ~AbstractClass() {} virtual void update() = 0; }; class Controller : [...]
Continue Reading