mirror of
https://github.com/shizand/statapp.git
synced 2025-03-31 06:33:46 +03:00
Merge branch 'main' into feat/add-docs
This commit is contained in:
commit
192e1bff8b
@ -19,8 +19,8 @@
|
||||
#
|
||||
import numpy as np
|
||||
from PySide2 import QtCore
|
||||
from PySide2.QtCore import Slot
|
||||
from PySide2.QtWidgets import QMainWindow, QMessageBox
|
||||
from PySide2.QtCore import Slot, Qt, QPoint
|
||||
from PySide2.QtWidgets import QMainWindow, QMessageBox, QAction, QMenu
|
||||
|
||||
from statapp.calculations import generateXValues, generateYValues
|
||||
from statapp.constants import NUMBERS_PRECISION
|
||||
@ -81,6 +81,27 @@ class MainWindow(QMainWindow):
|
||||
# x1 = generateXValues(20, 2, 0, y)
|
||||
# x2 = generateXValues(10, 1, 0, y)
|
||||
# self.model.updateAllData(np.concatenate([y, x1, x2], axis=1))
|
||||
self.ui.tableView.horizontalHeader().setContextMenuPolicy(Qt.CustomContextMenu)
|
||||
self.ui.tableView.horizontalHeader().customContextMenuRequested.connect(self.removeColumn)
|
||||
|
||||
|
||||
def removeColumn(self, event: QPoint):
|
||||
menu = QMenu(self)
|
||||
|
||||
col = self.ui.tableView.columnAt(event.x())
|
||||
|
||||
if col == 0:
|
||||
return
|
||||
|
||||
def fun():
|
||||
self.model.removeCol(col)
|
||||
self.isDataChanged = True
|
||||
|
||||
selectAction = QAction("Удалить", self)
|
||||
selectAction.triggered.connect(fun)
|
||||
menu.addAction(selectAction)
|
||||
menu.exec_(self.ui.tableView.mapToGlobal(event))
|
||||
|
||||
|
||||
|
||||
def updateActionsEnabled(self):
|
||||
|
@ -33,3 +33,6 @@ class InputValuesModel(EditableTableModel):
|
||||
|
||||
def getY(self):
|
||||
return self._data[:, 0]
|
||||
|
||||
def removeCol(self, index: int):
|
||||
self.updateAllData(np.delete(self._data, index, axis=1))
|
||||
|
@ -124,10 +124,17 @@
|
||||
<attribute name="title">
|
||||
<string>График</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<layout class="QGridLayout" name="gridLayout_5" rowstretch="1,0">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="plotContainer"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Точки - отклик. Линия - прогноз</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
|
7
statapp/ui/ui_polynom_window.py
generated
7
statapp/ui/ui_polynom_window.py
generated
@ -126,6 +126,12 @@ class Ui_PolynomWindow(object):
|
||||
|
||||
self.gridLayout_5.addLayout(self.plotContainer, 0, 0, 1, 1)
|
||||
|
||||
self.label = QLabel(self.tab)
|
||||
self.label.setObjectName(u"label")
|
||||
|
||||
self.gridLayout_5.addWidget(self.label, 1, 0, 1, 1)
|
||||
|
||||
self.gridLayout_5.setRowStretch(0, 1)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
|
||||
self.gridLayout_2.addWidget(self.tabWidget, 0, 6, 1, 1)
|
||||
@ -151,5 +157,6 @@ class Ui_PolynomWindow(object):
|
||||
self.rSquaredValueLabel.setText(QCoreApplication.translate("PolynomWindow", u"undefined", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.model), QCoreApplication.translate("PolynomWindow", u"\u041c\u043e\u0434\u0435\u043b\u044c", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.prediction), QCoreApplication.translate("PolynomWindow", u"\u041f\u0440\u043e\u0433\u043d\u043e\u0437", None))
|
||||
self.label.setText(QCoreApplication.translate("PolynomWindow", u"\u0422\u043e\u0447\u043a\u0438 - \u043e\u0442\u043a\u043b\u0438\u043a. \u041b\u0438\u043d\u0438\u044f - \u043f\u0440\u043e\u0433\u043d\u043e\u0437", None))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QCoreApplication.translate("PolynomWindow", u"\u0413\u0440\u0430\u0444\u0438\u043a", None))
|
||||
# retranslateUi
|
||||
|
Loading…
Reference in New Issue
Block a user