添加图标
This commit is contained in:
parent
6057634cf3
commit
2c87567ba5
2
main.cpp
2
main.cpp
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
|
#include <QSystemTrayIcon>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
Widget w;
|
Widget w;
|
||||||
|
QSystemTrayIcon sysTray(QIcon(":/icon/icon.ico"),&w);
|
||||||
w.show();
|
w.show();
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,3 +29,6 @@ FORMS += \
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
RESOURCES += \
|
||||||
|
res.qrc
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE QtCreatorProject>
|
<!DOCTYPE QtCreatorProject>
|
||||||
<!-- Written by QtCreator 4.12.2, 2025-03-12T15:47:38. -->
|
<!-- Written by QtCreator 4.12.2, 2025-03-12T17:14:41. -->
|
||||||
<qtcreator>
|
<qtcreator>
|
||||||
<data>
|
<data>
|
||||||
<variable>EnvironmentId</variable>
|
<variable>EnvironmentId</variable>
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="/icon">
|
||||||
|
<file>icon.png</file>
|
||||||
|
<file>icon.ico</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
1
widget.h
1
widget.h
|
@ -12,6 +12,7 @@
|
||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QTextCodec>
|
||||||
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
|
@ -31,6 +31,10 @@
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>微气象传感器调试助手</string>
|
<string>微气象传感器调试助手</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="res.qrc">
|
||||||
|
<normaloff>:/icon/icon.ico</normaloff>:/icon/icon.ico</iconset>
|
||||||
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QTabWidget" name="main_tabWidget">
|
<widget class="QTabWidget" name="main_tabWidget">
|
||||||
|
@ -2133,6 +2137,8 @@ border-radius: 10px; /* 圆角半径 */
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="res.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|
Loading…
Reference in New Issue