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">
|
||||
<string>Download database</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="icon.qrc">
|
||||
<normaloff>:/icons/Artemis3.ico</normaloff>:/icons/Artemis3.ico</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
@@ -78,6 +82,8 @@ Please wait...</string>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="icon.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</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_band,
|
||||
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)
|
||||
|
||||
|
||||
@@ -1033,7 +1036,7 @@ class MyApp(QMainWindow, Ui_MainWindow):
|
||||
|
||||
if __name__ == '__main__':
|
||||
my_app = QApplication(sys.argv)
|
||||
img = QPixmap("Artemis3.500px.png")
|
||||
img = QPixmap(":/icons/Artemis3.500px.png")
|
||||
# img = img.scaled(600, 600, aspectRatioMode = Qt.KeepAspectRatio)
|
||||
splash = QSplashScreen(img)
|
||||
splash.show()
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
<string>ARTEMIS3</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset>
|
||||
<normaloff>splash.jpg</normaloff>splash.jpg</iconset>
|
||||
<iconset resource="icon.qrc">
|
||||
<normaloff>:/icons/Artemis3.ico</normaloff>:/icons/Artemis3.ico</iconset>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
@@ -4909,6 +4909,8 @@ QSlider::handle:horizontal {
|
||||
<header>double_text_button.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="icon.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
from functools import partial
|
||||
import hashlib
|
||||
import re
|
||||
import sys
|
||||
import os
|
||||
from pandas import read_csv
|
||||
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
|
||||
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):
|
||||
if button.isChecked():
|
||||
|
||||
Reference in New Issue
Block a user