Use .qrc file to icons and splashscreen
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 50 KiB |
BIN
Artemis3.png
BIN
Artemis3.png
Binary file not shown.
|
Before Width: | Height: | Size: 148 KiB |
@@ -13,6 +13,10 @@
|
|||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Download database</string>
|
<string>Download database</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="windowIcon">
|
||||||
|
<iconset resource="icon.qrc">
|
||||||
|
<normaloff>:/icons/Artemis3.ico</normaloff>:/icons/Artemis3.ico</iconset>
|
||||||
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
</property>
|
</property>
|
||||||
@@ -78,6 +82,8 @@ Please wait...</string>
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="icon.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
6
icon.qrc
Normal file
6
icon.qrc
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="icons">
|
||||||
|
<file>Artemis3.500px.png</file>
|
||||||
|
<file>Artemis3.ico</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
11310
icon_rc.py
Normal file
11310
icon_rc.py
Normal file
File diff suppressed because it is too large
Load Diff
9
main.py
9
main.py
@@ -38,9 +38,12 @@ from utilities import (checksum_ok,
|
|||||||
is_undef_freq,
|
is_undef_freq,
|
||||||
is_undef_band,
|
is_undef_band,
|
||||||
change_unit,
|
change_unit,
|
||||||
format_numbers)
|
format_numbers,
|
||||||
|
resource_path,)
|
||||||
|
|
||||||
qt_creator_file = "main_window.ui"
|
import icon_rc
|
||||||
|
|
||||||
|
qt_creator_file = resource_path("main_window.ui")
|
||||||
Ui_MainWindow, _ = uic.loadUiType(qt_creator_file)
|
Ui_MainWindow, _ = uic.loadUiType(qt_creator_file)
|
||||||
|
|
||||||
|
|
||||||
@@ -1033,7 +1036,7 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
my_app = QApplication(sys.argv)
|
my_app = QApplication(sys.argv)
|
||||||
img = QPixmap("Artemis3.500px.png")
|
img = QPixmap(":/icons/Artemis3.500px.png")
|
||||||
# img = img.scaled(600, 600, aspectRatioMode = Qt.KeepAspectRatio)
|
# img = img.scaled(600, 600, aspectRatioMode = Qt.KeepAspectRatio)
|
||||||
splash = QSplashScreen(img)
|
splash = QSplashScreen(img)
|
||||||
splash.show()
|
splash.show()
|
||||||
|
|||||||
@@ -20,8 +20,8 @@
|
|||||||
<string>ARTEMIS3</string>
|
<string>ARTEMIS3</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<iconset>
|
<iconset resource="icon.qrc">
|
||||||
<normaloff>splash.jpg</normaloff>splash.jpg</iconset>
|
<normaloff>:/icons/Artemis3.ico</normaloff>:/icons/Artemis3.ico</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true"/>
|
<string notr="true"/>
|
||||||
@@ -4909,6 +4909,8 @@ QSlider::handle:horizontal {
|
|||||||
<header>double_text_button.h</header>
|
<header>double_text_button.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
<resources/>
|
<resources>
|
||||||
|
<include location="icon.qrc"/>
|
||||||
|
</resources>
|
||||||
<connections/>
|
<connections/>
|
||||||
</ui>
|
</ui>
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
from functools import partial
|
from functools import partial
|
||||||
import hashlib
|
import hashlib
|
||||||
import re
|
import re
|
||||||
|
import sys
|
||||||
|
import os
|
||||||
from pandas import read_csv
|
from pandas import read_csv
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QMessageBox
|
from PyQt5.QtWidgets import QMessageBox
|
||||||
|
|
||||||
import constants
|
import constants
|
||||||
|
|
||||||
|
def resource_path(relative_path):
|
||||||
|
try:
|
||||||
|
base_path = sys._MEIPASS
|
||||||
|
except Exception:
|
||||||
|
base_path = os.path.abspath(".")
|
||||||
|
return os.path.join(base_path, relative_path)
|
||||||
|
|
||||||
def uncheck_and_emit(button):
|
def uncheck_and_emit(button):
|
||||||
if button.isChecked():
|
if button.isChecked():
|
||||||
|
|||||||
Reference in New Issue
Block a user