Slopjong
A geek discovering the World, Tech & Science
Latest Posts
Programming
Mac
Linux
WordPress
Hardware
Howtos
Nerd Trash
C++ Archive
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
11
‘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
0
error: stray ‘\160′ in program
Posted on October 3, 2008
I was experimenting with virtual and pure virtual methods in C++. I introduced an inline implementation for a pure method and then I couldn’t compile my code anymore. I turned into [...]
Continue Reading
Next Page »