So I tried this short piece of code but I won't quit.
The window with my button is displayed ans sits there forever.
#include "mainwindow.h"
#include <QTimer>
{
//Make a dialog with a timer and
//connect its timeout() signal to dialogs accept() slot.
pbClose
->resize
( QSize( 10,
10 ) );
connect(timer, SIGNAL(timeout()), this, SLOT(quit()));
connect( pbClose, SIGNAL( timeout() ), this, SLOT( quit() ) );
timer->start(100);
}
#include "mainwindow.h"
#include <QTimer>
MainWindow::MainWindow() : QMainWindow()
{
//Make a dialog with a timer and
//connect its timeout() signal to dialogs accept() slot.
pbClose = new QPushButton( this );
pbClose->resize( QSize( 10, 10 ) );
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(quit()));
connect( pbClose, SIGNAL( timeout() ), this, SLOT( quit() ) );
timer->start(100);
}
To copy to clipboard, switch view to plain text mode
Connecting to accept() fails too.
QTimer::singleShot(200,
this,
SLOT(quit
()));
QTimer::singleShot(200, this, SLOT(quit()));
To copy to clipboard, switch view to plain text mode
is no better
Bookmarks