Fix compile with -DQT_NO_SYSTEMTRAYICON
Change-Id: Icca0bef7efca77a841b30f40692144663e7ae913 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
ce556dfcbc
commit
51e7aeb29b
@ -39,8 +39,10 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QMessageBox>
|
|
||||||
|
|
||||||
|
#ifndef QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
@ -61,3 +63,24 @@ int main(int argc, char *argv[])
|
|||||||
window.show();
|
window.show();
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#include <QLabel>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
QString text("QSystemTrayIcon is not supported on this platform");
|
||||||
|
|
||||||
|
QLabel *label = new QLabel(text);
|
||||||
|
label->setWordWrap(true);
|
||||||
|
|
||||||
|
label->show();
|
||||||
|
qDebug() << text;
|
||||||
|
|
||||||
|
app.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -39,6 +39,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "window.h"
|
#include "window.h"
|
||||||
|
|
||||||
|
#ifndef QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
@ -265,3 +268,5 @@ void Window::createTrayIcon()
|
|||||||
trayIcon = new QSystemTrayIcon(this);
|
trayIcon = new QSystemTrayIcon(this);
|
||||||
trayIcon->setContextMenu(trayIconMenu);
|
trayIcon->setContextMenu(trayIconMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -42,6 +42,9 @@
|
|||||||
#define WINDOW_H
|
#define WINDOW_H
|
||||||
|
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
|
|
||||||
|
#ifndef QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
@ -109,4 +112,6 @@ private:
|
|||||||
};
|
};
|
||||||
//! [0]
|
//! [0]
|
||||||
|
|
||||||
|
#endif // QT_NO_SYSTEMTRAYICON
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user