mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
22 lines
538 B
C++
22 lines
538 B
C++
#include "mainwindow.h"
|
|
#include <qqtsingletonapplication.h>
|
|
#include <QLocalServer>
|
|
#include <QDebug>
|
|
|
|
int main ( int argc, char* argv[] )
|
|
{
|
|
QQtSingleTonApplication a ( argc, argv );
|
|
a.setApplicationName ( "singletonapptest" );
|
|
a.startSingleTonInstance();
|
|
|
|
//QLocalServer::removeServer ( "singletonapptest" );
|
|
QLocalServer b;
|
|
qDebug() << "listen:?" << b.listen ( "singletonapptest" );
|
|
qDebug() << "listen:?" << b.isListening();
|
|
|
|
MainWindow w;
|
|
w.show();
|
|
|
|
return a.exec();
|
|
}
|