mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
opt:qtsingleapplication remove old code
This commit is contained in:
parent
dbe04db7f5
commit
7f6409c05a
|
@ -15,11 +15,8 @@
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
QHotkeyApplication::QHotkeyApplication( int & argc, char ** argv ):
|
||||
QIntermediateApplication( argc, argv )
|
||||
#ifdef Q_OS_WIN32
|
||||
, mainWindow( 0 )
|
||||
#endif
|
||||
QHotkeyApplication::QHotkeyApplication( int & argc, char ** argv ):
|
||||
QtSingleApplication( argc, argv )
|
||||
{
|
||||
connect( this,
|
||||
&QGuiApplication::commitDataRequest,
|
||||
|
@ -39,11 +36,8 @@ QHotkeyApplication::QHotkeyApplication( int & argc, char ** argv ):
|
|||
}
|
||||
|
||||
QHotkeyApplication::QHotkeyApplication( QString const & id,
|
||||
int & argc, char ** argv ):
|
||||
QIntermediateApplication( id, argc, argv )
|
||||
#ifdef Q_OS_WIN32
|
||||
, mainWindow( 0 )
|
||||
#endif
|
||||
int & argc, char ** argv ):
|
||||
QtSingleApplication( id, argc, argv )
|
||||
{
|
||||
connect( this,
|
||||
&QGuiApplication::commitDataRequest,
|
||||
|
|
|
@ -206,25 +206,10 @@ public:
|
|||
{}
|
||||
};
|
||||
|
||||
// Intermediate class to avoid misunderstanding of #ifdef's
|
||||
// by Qt meta-object compiler
|
||||
|
||||
class QIntermediateApplication : public QtSingleApplication
|
||||
#if defined( Q_OS_WIN )
|
||||
, public QAbstractNativeEventFilter
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
QIntermediateApplication( int & argc, char ** argv ) :
|
||||
QtSingleApplication( argc, argv )
|
||||
{}
|
||||
|
||||
QIntermediateApplication( QString const & id, int & argc, char ** argv ) :
|
||||
QtSingleApplication( id, argc, argv )
|
||||
{}
|
||||
};
|
||||
|
||||
class QHotkeyApplication : public QIntermediateApplication
|
||||
class QHotkeyApplication: public QtSingleApplication
|
||||
#if defined( Q_OS_WIN )
|
||||
,public QAbstractNativeEventFilter
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -257,11 +242,6 @@ protected:
|
|||
virtual bool nativeEventFilter( const QByteArray & eventType, void * message, qintptr * result );
|
||||
#endif
|
||||
|
||||
|
||||
QWidget * mainWindow;
|
||||
public:
|
||||
void setMainWindow( QWidget * widget )
|
||||
{ mainWindow = widget; }
|
||||
protected:
|
||||
#endif // Q_OS_WIN32
|
||||
QList<HotkeyWrapper*> hotkeyWrappers;
|
||||
|
|
|
@ -68,14 +68,6 @@ class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication
|
|||
public:
|
||||
QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
|
||||
QtSingleApplication(const QString &id, int &argc, char **argv);
|
||||
#if QT_VERSION < 0x050000
|
||||
QtSingleApplication(int &argc, char **argv, Type type);
|
||||
# if defined(HAVE_X11)
|
||||
QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
||||
QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
|
||||
QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
|
||||
# endif // HAVE_X11
|
||||
#endif // QT_VERSION < 0x050000
|
||||
|
||||
bool isRunning();
|
||||
QString id() const;
|
||||
|
|
Loading…
Reference in a new issue