diff --git a/statapp/about_window.py b/statapp/about_window.py index 86bf76f..bb95aad 100644 --- a/statapp/about_window.py +++ b/statapp/about_window.py @@ -18,7 +18,9 @@ # along with this program. If not, see . # import sys -from PySide2.QtGui import QMovie + +from PySide2.QtCore import QSize +from PySide2.QtGui import QMovie, QIcon from PySide2.QtWidgets import QMainWindow from statapp.ui.ui_about_window import Ui_AboutWindow @@ -47,3 +49,7 @@ class AboutWindow(QMainWindow): version = importlib_metadata.version(__package__ or __name__) self.ui.versionLabel.setText(f"Версия: {version}") + + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) diff --git a/statapp/correlation_analysis.py b/statapp/correlation_analysis.py index fae0400..45ad7f0 100644 --- a/statapp/correlation_analysis.py +++ b/statapp/correlation_analysis.py @@ -17,11 +17,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # +from PySide2.QtCore import QSize +from PySide2.QtGui import QIcon from PySide2.QtWidgets import QDialog, QHeaderView from statapp.calculations import correlation_analysis from statapp.models.correlation_analysis_model import CorrelationAnalysisModel from statapp.ui.ui_correlation_analysis_window import Ui_CorrelationAnalysisWindow +from statapp.utils import resource_path class СorrelationAnalysisWindow(QDialog): @@ -35,3 +38,7 @@ class СorrelationAnalysisWindow(QDialog): self.ui.tableView.setModel(self.model) header = self.ui.tableView.horizontalHeader() header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch) + + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) diff --git a/statapp/generate_factor_window.py b/statapp/generate_factor_window.py index 3cbc6bb..bab3d8f 100644 --- a/statapp/generate_factor_window.py +++ b/statapp/generate_factor_window.py @@ -17,12 +17,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -from PySide2.QtCore import Slot +from PySide2.QtCore import Slot, QSize +from PySide2.QtGui import QIcon from PySide2.QtWidgets import QDialog from statapp.ui.ui_generate_factor_window import Ui_GenerateFactorWindow from statapp.models.combobox_model import ComboBoxModel - +from statapp.utils import resource_path DIRECT_LINK = 0 INDIRECT_LINK = 1 @@ -43,6 +44,10 @@ class GenerateFactorWindow(QDialog): self.ui.setupUi(self) self.ui.typeComboBox.setModel(self._typeComboBox) + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) + @Slot() def on_generatePushButton_clicked(self): self.typeConnection = self._typeComboBox.rawData(self.ui.typeComboBox.currentIndex())[0] diff --git a/statapp/generate_window.py b/statapp/generate_window.py index 5958b0a..0449bd6 100644 --- a/statapp/generate_window.py +++ b/statapp/generate_window.py @@ -17,10 +17,12 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -from PySide2.QtCore import Slot +from PySide2.QtCore import Slot, QSize +from PySide2.QtGui import QIcon from PySide2.QtWidgets import QDialog from statapp.ui.ui_generate_window import Ui_GenerateWindow +from statapp.utils import resource_path class GenerateWindow(QDialog): @@ -32,6 +34,11 @@ class GenerateWindow(QDialog): self.ui = Ui_GenerateWindow() self.ui.setupUi(self) + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) + + @Slot() def on_generatePushButton_clicked(self): diff --git a/statapp/main_window.py b/statapp/main_window.py index 4cd5f55..fddc529 100644 --- a/statapp/main_window.py +++ b/statapp/main_window.py @@ -43,6 +43,7 @@ class MainWindow(QMainWindow): icon = QIcon() icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon) self.ui.generateXaction.setEnabled(False) self.ui.varianceAnalysisAction.setEnabled(False) @@ -110,6 +111,7 @@ class MainWindow(QMainWindow): @Slot() def on_generateYaction_triggered(self): gw = GenerateWindow() + if gw.exec(): y = np.random.normal(gw.mat, gw.deviation, size=(gw.count, 1)) self.model.updateAllData(y.round(2)) @@ -136,11 +138,6 @@ class MainWindow(QMainWindow): def on_aboutmenuaction_triggered(self): global about_window about_window = AboutWindow() - - icon = QIcon() - icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) - about_window.setWindowIcon(icon) - about_window.show() @Slot() diff --git a/statapp/variance_analysis.py b/statapp/variance_analysis.py index dc6adf6..0cbab8b 100644 --- a/statapp/variance_analysis.py +++ b/statapp/variance_analysis.py @@ -17,11 +17,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # +from PySide2.QtCore import QSize +from PySide2.QtGui import QIcon from PySide2.QtWidgets import QDialog, QHeaderView from statapp.calculations import variance_analysis from statapp.models.variance_analysis_model import VarianceAnalysisModel from statapp.ui.ui_variance_analysis_window import Ui_VarianceAnalysisWindow +from statapp.utils import resource_path class VarianceAnalysisWindow(QDialog): @@ -35,3 +38,7 @@ class VarianceAnalysisWindow(QDialog): self.ui.tableView.setModel(self.model) header = self.ui.tableView.horizontalHeader() header.setSectionResizeMode(QHeaderView.ResizeMode.Stretch) + + icon = QIcon() + icon.addFile(resource_path("ui/images/logo.ico"), QSize(), QIcon.Normal, QIcon.Off) + self.setWindowIcon(icon)