ich bin grad ein wenig am Basteln und wollte Folgendes machen:
Ein singelton Pattern, der von QApplication abgeleitet ist.
Leider Patzt mein Quelltext beim Aufruf von exec(): es gibt nen Segmentation Fault.
hier mal ein paar Infos:
main.cpp
Code: Alles auswählen
int main ( int argc, char** args )
{
Controller* ctrl;
ctrl = Controller::getInstance( argc, args );
return ctrl->exec();
}Code: Alles auswählen
class Controller: public QApplication {
Q_OBJECT
public:
static Controller* getInstance( int argc, char** args );
private:
bool mode;
MainWindow* myWindow;
Controller( int argc, char** args );
~Controller( );
void connectSlots();
private slots:
void SwitchMode();
void Calculate();
void ShowAbout();
};Code: Alles auswählen
Controller* Controller::getInstance ( int argc, char** args ) {
static Controller theOneAndOnly(argc, args);
return &theOneAndOnly;
}Code: Alles auswählen
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1222642000 (LWP 19399)]
0xb7500cfd in QString::fromLocal8Bit () from /usr/lib/qt4/libQtCore.so.4
(gdb) next
Single stepping until exit from function _ZN7QString13fromLocal8BitEPKci,
which has no line number information.Habt ihr irgendwelche Ideen?
PS: Das ganze läuft unter Linux 2.6.20 ... bzw eben nicht. Unter Windows XP gehts komischerweise zickenfrei.
Gruß
c_m