Seite 1 von 1

[geloest]event -> X gedrueckt

Verfasst: 27. Mai 2007 18:12
von nini_knoxville
hi, hab ein problem, wenn ich mein test programm einfach uebers x oben rechts schliesse, wird irgendwie nur das widget geschlossen und nicht das programm. mit QApplication::quit(); funktionierts wunderbar...

Verfasst: 27. Mai 2007 18:24
von -=Freaky=-
probier, im destruktor

Code: Alles auswählen

qApp->quit()
auszuführen.
dazu musst du im header der klasse wahrscheinlich <QApplication> einbinden.

mfg,
julian

Verfasst: 27. Mai 2007 18:34
von nini_knoxville
im desktruktor hab ich schon QApplication::quit(); stehen

main.cpp

Code: Alles auswählen

int main(int argc, char *argv[])
{
    QApplication app(argc, argv);
    Settings::parseArgs(argc, argv);
    
    MainWindow mainWindow;
    
    if (Settings::fullscreen)
        mainWindow.showFullScreen();
    else
        mainWindow.show();

    return app.exec();
}

Verfasst: 27. Mai 2007 18:46
von nini_knoxville
geloest... haette doch lieber mal in die docs schaun sollen

Code: Alles auswählen

void MainWindow::closeEvent(QCloseEvent *event)
{
    Q_UNUSED(event);
    this->loop = false;
    QApplication::quit();
}