diff --git a/main.py b/main.py
index 46f2cd9..555f923 100644
--- a/main.py
+++ b/main.py
@@ -4,7 +4,6 @@ import sys
from PyQt5 import QtCore, QtWidgets, QtGui, uic
from PyQt5.QtWidgets import QApplication, QMessageBox, QMainWindow, QTableWidgetItem
-from PyQt5.QtWidgets import QWidget, QTableView, QTableWidget, QComboBox
if hasattr(QtCore.Qt, 'AA_EnableHighDpiScaling'):
QtWidgets.QApplication.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
@@ -30,6 +29,9 @@ class MyWidget(QMainWindow): # Ui_MainWindow
self.check_but2.clicked.connect(self.check)
self.check_but3.clicked.connect(self.check)
+ # ЗАМЕТКИ
+ self.complete.clicked.connect(self.add_notes) # ДОБАВЛЕНИЕ
+
# ДАННЫЕ ТАБЛИЦЫ
self.table()
@@ -52,7 +54,7 @@ class MyWidget(QMainWindow): # Ui_MainWindow
obj = ""
subjects.append((obj, ))
day.setColumnCount(1)
- day.setHorizontalHeaderLabels(["Предмет"])
+ day.horizontalHeader().setVisible(False)
day.setRowCount(0)
for i, row in enumerate(subjects):
@@ -76,6 +78,29 @@ class MyWidget(QMainWindow): # Ui_MainWindow
except Exception:
pass
+ # ЗАПОЛНЕНИЕ ВЫПАДАЮЩИХ СПИСКОВ CHOOSE 1 / 2
+ try:
+ with self.connection:
+ notes = self.cursor.execute('SELECT `note` FROM `notes`').fetchall()
+ notes = [i[0] for i in notes]
+ for choose_obj in [self.choose, self.choose_2]:
+ choose_obj.clear()
+ if self.choose == choose_obj:
+ choose_obj.insertItem(0, "Все за этот день!")
+ choose_obj.insertItems(1, notes)
+ else:
+ choose_obj.insertItems(0, notes)
+ except Exception:
+ pass
+
+ # НАСТРОЙКА ДИСПЛЕЕВ ДАТ
+ now = QtCore.QDateTime.currentDateTime()
+ for date in [self.date_1, self.date_2, self.date_3]:
+ date.setDateTime(now)
+ date.setDateRange(QtCore.QDate.currentDate().addDays(-365), QtCore.QDate.currentDate().addDays(365))
+ if self.date_1 == date:
+ date.setDisplayFormat("dd.MM.yyyy")
+
# ВСЕ ЗАМЕТКИ
with self.connection:
note = self.cursor.execute("SELECT `date`, `note` FROM notes").fetchall()
@@ -115,6 +140,7 @@ class MyWidget(QMainWindow): # Ui_MainWindow
except Exception:
QMessageBox.about(self, 'Ошибка!', "Таблица данных не найдена!")
+ # РАСПИСАНИЕ
def add(self):
day = self.weekday1.currentIndex()
obj = self.object1.currentIndex()
@@ -227,8 +253,11 @@ class MyWidget(QMainWindow): # Ui_MainWindow
else:
self.table()
- def notes(self):
- pass
+ # ЗАМЕТКИ
+ def add_notes(self):
+ ind = self.choose.currentIndex()
+ if ind:
+ pass
def closeEvent(self, event):
self.connection.close()
diff --git a/rasp.ui b/rasp.ui
index 4ffe814..44e49cd 100644
--- a/rasp.ui
+++ b/rasp.ui
@@ -54,6 +54,8 @@
14
+ 75
+ true
@@ -62,17 +64,38 @@
Вторник
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
-
16777215
- 80
+ 16777215
@@ -94,6 +117,8 @@
14
+ 75
+ true
@@ -102,17 +127,38 @@
Среда
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
-
16777215
- 80
+ 16777215
@@ -134,6 +180,8 @@
14
+ 75
+ true
@@ -142,17 +190,38 @@
Четверг
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
-
16777215
- 80
+ 16777215
@@ -174,6 +243,8 @@
14
+ 75
+ true
@@ -182,17 +253,38 @@
Суббота
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
-
16777215
- 80
+ 16777215
@@ -214,6 +306,8 @@
14
+ 75
+ true
@@ -222,17 +316,50 @@
Понедельник
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
+ true
+
+
+ Qt::SolidLine
+
+
+ true
+
+
+ true
+
+
-
16777215
- 80
+ 16777215
@@ -445,6 +572,8 @@ QPushButton:hover{
14
+ 75
+ true
@@ -453,17 +582,38 @@ QPushButton:hover{
Пятница
+
+ Qt::AlignCenter
+
-
-
+
+
+
+ 0
+ 242
+
+
+
+
+ 16777215
+ 242
+
+
+
+
+ 10
+
+
+
-
16777215
- 80
+ 16777215
@@ -1084,26 +1234,44 @@ QPushButton:hover{
- 2
+ 0
Сделать
-
+
-
-
-
-
-
- 10
- 10
- 211
- 51
-
-
-
- QPushButton {
+
+
+
+ 231
+ 0
+
+
+
+
+ 231
+ 16777215
+
+
+
+
-
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -1119,36 +1287,73 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Выполнено
-
-
-
-
-
- 10
- 70
- 211
- 51
-
-
-
-
- 12
-
-
-
-
-
-
- 240
- 10
- 411
- 51
-
-
-
+
+
+ Выполнено
+
+
+
+ -
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ 12
+ 50
+ false
+
+
+
+ Qt::LeftToRight
+
+
+ Qt::AlignCenter
+
+
+ QAbstractSpinBox::UpDownArrows
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
-
+
+
+
+ 0
+ 51
+
+
+
+
+ 16777215
+ 51
+
+
+
+
+ -
+
+
+
@@ -1162,21 +1367,34 @@ QPushButton:hover{
- 233
+ 231
0
-
-
-
- 10
- 10
- 211
- 51
-
-
-
- QPushButton {
+
+ -
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ -1
+ 50
+ false
+
+
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -1192,26 +1410,42 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Добавить
-
-
-
-
-
- 10
- 70
- 211
- 51
-
-
-
-
- 12
-
-
-
+
+
+ Добавить
+
+
+
+ -
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ 12
+ 50
+ false
+
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
-
@@ -1228,21 +1462,34 @@ QPushButton:hover{
- 233
+ 231
0
-
-
-
- 10
- 10
- 211
- 51
-
-
-
- QPushButton {
+
+
-
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ -1
+ 50
+ false
+
+
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -1258,36 +1505,58 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Обновить
-
-
-
-
-
- 10
- 70
- 211
- 51
-
-
-
-
- 12
-
-
-
-
-
-
- 10
- 130
- 211
- 51
-
-
-
+
+
+ Обновить
+
+
+
+ -
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ 12
+ 50
+ false
+
+
+
+ Qt::AlignCenter
+
+
+
+ -
+
+
+
+ 211
+ 51
+
+
+
+
+ 211
+ 51
+
+
+
+
+ -
+
+
+
-
@@ -1324,98 +1593,69 @@ QPushButton:hover{
Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter
-
-
-
- 10
- 20
- 241
- 221
-
-
-
- QPushButton {
- padding:10px;
- color: #fffff;
- font-size: 18px;
- border-radius: 10px;
- border: 1px solid #3873d9;
- background-color: white; }
-
-QPushButton:before {
- content:'';
- position: absolute;
- top: 0;
- left: 0;
- width: 0;
- height: 42px;
- background: rgba(255,255,255,0.3);
- border-radius: 5px;
- transition: all 2s ease;
-}
-
-QPushButton:hover:before {
- width: 100%;
-}
-
-
-
-
- 10
- 10
- 221
- 31
-
-
-
-
- 10
- 75
- true
-
-
-
-
-
- За всё время
+
+
-
+
+
+
+ 0
+ 31
+
-
- -
-
- За месяц
+
+
+ 16777215
+ 31
+
-
- -
-
- За неделю
+
+
+ 10
+ 75
+ true
+
-
- -
-
- На опред. дату
+
-
+
+ За всё время
+
+
+ -
+
+ На месяц
+
+
+ -
+
+ На неделю
+
+
+
+
+ -
+
+
+ -
+
+
+
+ 0
+ 41
+
-
- -
-
- На опред. время
+
+
+ 16777215
+ 41
+
-
-
-
-
-
- 10
- 170
- 221
- 41
-
-
-
-
- -1
-
-
-
- QPushButton {
+
+
+ -1
+
+
+
+ QPushButton {
padding:10px;
color: #fffff;
font-size: 18px;
@@ -1431,12 +1671,13 @@ QPushButton:hover{
effect.setColor(QColor(57, 219, 255))
QPushButton.setGraphicsEffect(effect)
}
-
-
- Показать
-
-
-
+
+
+ Показать
+
+
+
+
diff --git a/table.db b/table.db
index baa778c..d5f2509 100644
Binary files a/table.db and b/table.db differ