diff --git a/pyproject.toml b/pyproject.toml index 85684e4..df9421f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,13 +12,13 @@ python = ">=3.10,<3.12" GitPython = "^3.1.43" matplotlib = "^3.9.0" pandas = "^2.2.2" -PyQt5 = "5.15.7" pyqt5-qt5 = "5.15.2" xlsxwriter = "^3.2.0" pyqtdarktheme = "^2.1.0" qtawesome = "^1.3.1" holidays = "^0.47" dataclasses-json = "^0.6.4" +pyqt6 = "^6.4.2" [tool.poetry.group.dev.dependencies] pyinstaller = "^6.8.0" @@ -26,6 +26,7 @@ pip-chill = "^1.0.3" jupyterlab = "^4.2.2" mypy = "^1.10.0" ruff = "^0.4.8" +pyqt6-tools = "^6.4.2.3.3" [build-system] requires = ["poetry-core"] diff --git a/requirements.txt b/requirements.txt index f271ad0..3d342df 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ gitpython matplotlib pandas -pyqt5 +pyqt6 xlsxwriter pyqtdarktheme qtawesome diff --git a/runme.py b/runme.py index 0e05a23..e41a6e5 100644 --- a/runme.py +++ b/runme.py @@ -6,7 +6,7 @@ import logging import sys -from PyQt5.QtWidgets import QApplication +from PyQt6.QtWidgets import QApplication from src.ui_mainwindow import MainWindow from src.utils import get_additional_run_args, sync_theme @@ -19,12 +19,12 @@ app = QApplication(sys.argv + get_additional_run_args()) w = MainWindow() # in case of active style change, also change theme, need to sync at start - app.paletteChanged.connect(sync_theme) + # app.paletteChanged.connect(sync_theme) # still keep the app running, even if the main window is closed (we use tray for the app) QApplication.setQuitOnLastWindowClosed(False) sync_theme() w.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) except Exception as e: logger.exception(e) raise diff --git a/scripts/compile_ui_to_python.ps1 b/scripts/compile_ui_to_python.ps1 index 32ae256..07475d9 100644 --- a/scripts/compile_ui_to_python.ps1 +++ b/scripts/compile_ui_to_python.ps1 @@ -6,7 +6,7 @@ $files = @( ) foreach ($f in $files) { - pyuic5 -x .\$f.ui -o .\$f.py + pyuic6 -x .\$f.ui -o .\$f.py } cd .. \ No newline at end of file diff --git a/src/datastore.py b/src/datastore.py index 9c26412..1dace29 100644 --- a/src/datastore.py +++ b/src/datastore.py @@ -104,7 +104,7 @@ def _generate_monthly_time( daily_minutes = CONFIG_HANDLER.config.daily_hours * 60 for _day in full_month: days_data = df[df["date"] == _day.date()] - calculated_time = 1.0 + calculated_time = 0.0 # when we got a free day, we get the working time for this day if _day.date() in free_days: calculated_time += daily_minutes diff --git a/src/icons.py b/src/icons.py index 1726b21..8336063 100644 --- a/src/icons.py +++ b/src/icons.py @@ -1,7 +1,7 @@ from dataclasses import dataclass import qtawesome as qta -from PyQt5.QtGui import QIcon +from PyQt6.QtGui import QIcon from src.utils import get_background_color, get_font_color diff --git a/src/ui_config_window.py b/src/ui_config_window.py index 9fd5baa..c347693 100644 --- a/src/ui_config_window.py +++ b/src/ui_config_window.py @@ -3,8 +3,8 @@ from typing import TYPE_CHECKING import holidays -from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import QWidget +from PyQt6.QtCore import Qt +from PyQt6.QtWidgets import QWidget from src.config_handler import CONFIG_HANDLER from src.icons import get_app_icon @@ -21,8 +21,13 @@ def __init__(self, main_window: MainWindow): self.main_window = main_window self.setupUi(self) self.setWindowIcon(get_app_icon()) - self.setWindowFlags(Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint) # type: ignore - self.setAttribute(Qt.WA_DeleteOnClose) # type: ignore + self.setWindowFlags( + Qt.WindowType.Window + | Qt.WindowType.CustomizeWindowHint + | Qt.WindowType.WindowTitleHint + | Qt.WindowType.WindowCloseButtonHint + ) + self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose) self.country_list = holidays.list_supported_countries() self._update_country_list() self.set_config_values() @@ -71,6 +76,7 @@ def set_config_values(self): self.input_name.setText(CONFIG_HANDLER.config.name) self.input_daily_hours.setValue(CONFIG_HANDLER.config.daily_hours) self.input_weekly_hours.setValue(CONFIG_HANDLER.config.weekly_hours) + self.input_plot_pause.setChecked(CONFIG_HANDLER.config.plot_pause) for day in CONFIG_HANDLER.config.workdays: getattr(self, f"radio_weekday_{day}").setChecked(True) @@ -81,6 +87,7 @@ def apply_config(self): CONFIG_HANDLER.config.name = self.input_name.text() CONFIG_HANDLER.config.daily_hours = self.input_daily_hours.value() CONFIG_HANDLER.config.weekly_hours = self.input_daily_hours.value() + CONFIG_HANDLER.config.plot_pause = self.input_plot_pause.isChecked() selected_days: list[int] = [] for day in range(7): if getattr(self, f"radio_weekday_{day}").isChecked(): diff --git a/src/ui_controller.py b/src/ui_controller.py index fb788dd..5069364 100644 --- a/src/ui_controller.py +++ b/src/ui_controller.py @@ -1,7 +1,7 @@ -from PyQt5.QtWidgets import QDialog, QFileDialog, QInputDialog, QLayout, QMessageBox, QTableWidget, QTableWidgetItem +from PyQt6.QtWidgets import QDialog, QFileDialog, QInputDialog, QLayout, QMessageBox, QTableWidget, QTableWidgetItem from src import __version__ -from src.config_handler import CONFIG_HANDLER, CONFIG_NAMES +from src.config_handler import CONFIG_HANDLER from src.filepath import HOME_PATH from src.icons import get_app_icon @@ -13,12 +13,12 @@ def __init__(self): def show_message(self, message: str): """Prompt default messagebox, use a QMessageBox with OK-Button.""" message_box = QMessageBox() - message_box.setStandardButtons(QMessageBox.Ok) # type: ignore + message_box.setStandardButtons(QMessageBox.StandardButton.Ok) message_box.setText(str(message)) message_box.setWindowIcon(get_app_icon()) message_box.setWindowTitle("Information") message_box.show() - message_box.exec_() + message_box.exec() def report_choice(self): message_box = QMessageBox() @@ -27,11 +27,11 @@ def report_choice(self): ) message_box.setWindowTitle("Report Generation") message_box.setWindowIcon(get_app_icon()) - overtime_button = message_box.addButton("Overtime", QMessageBox.YesRole) # type: ignore - time_button = message_box.addButton("Time", QMessageBox.NoRole) # type: ignore - message_box.addButton("Cancel", QMessageBox.RejectRole) # type: ignore + overtime_button = message_box.addButton("Overtime", QMessageBox.ButtonRole.YesRole) + time_button = message_box.addButton("Time", QMessageBox.ButtonRole.NoRole) + message_box.addButton("Cancel", QMessageBox.ButtonRole.RejectRole) - message_box.exec_() + message_box.exec() if message_box.clickedButton() == overtime_button: return True if message_box.clickedButton() == time_button: @@ -43,9 +43,9 @@ def user_okay(self, text: str): message_box.setText(text) message_box.setWindowTitle("Confirmation required") message_box.setWindowIcon(get_app_icon()) - yes_button = message_box.addButton("Yes", QMessageBox.YesRole) # type: ignore - message_box.addButton("No", QMessageBox.NoRole) # type: ignore - message_box.exec_() + yes_button = message_box.addButton("Yes", QMessageBox.ButtonRole.YesRole) + message_box.addButton("No", QMessageBox.ButtonRole.NoRole) + message_box.exec() if message_box.clickedButton() == yes_button: return True return False @@ -66,11 +66,11 @@ def get_folder(self, current_path: str, parent=None): current_path = str(HOME_PATH) dialog = QFileDialog(parent) - dialog.setFileMode(QFileDialog.DirectoryOnly) # type: ignore + dialog.setFileMode(QFileDialog.FileMode.Directory) dialog.setDirectory(current_path) - if dialog.exec_() == QDialog.Accepted: # type: ignore - return dialog.selectedFiles()[0] # returns a list + if dialog.exec() == QDialog.DialogCode.Accepted: + return dialog.selectedFiles()[0] return "" def fill_table(self, table: QTableWidget, entry): @@ -91,17 +91,6 @@ def set_header_names(self, table: QTableWidget, name1: str, name2: str): if header_2 is not None: header_2.setText(name2) - def get_user_data(self, parent): - needed_keys: list[CONFIG_NAMES] = ["name"] - # todo adjust to new class logic - for data in needed_keys: - text, ok = self.get_text(data, parent) - if not ok: - return - if text != "": - CONFIG_HANDLER.set_config_value(data, text, write=False) - CONFIG_HANDLER.write_config_file() - def get_save_folder(self): user_path = CONFIG_HANDLER.config.save_path returned_path = self.get_folder(user_path) diff --git a/src/ui_data_window.py b/src/ui_data_window.py index 8f91042..c28f76b 100644 --- a/src/ui_data_window.py +++ b/src/ui_data_window.py @@ -10,8 +10,8 @@ import matplotlib.pyplot as plt import pandas as pd from matplotlib.backends.backend_qtagg import FigureCanvasQTAgg as FigureCanvas -from PyQt5.QtCore import QDate, QDateTime, Qt -from PyQt5.QtWidgets import QTableWidgetItem, QWidget +from PyQt6.QtCore import QDate, QDateTime, Qt +from PyQt6.QtWidgets import QTableWidgetItem, QWidget from src.config_handler import CONFIG_HANDLER from src.data_exporter import EXPORTER @@ -44,7 +44,10 @@ def __init__(self, main_window: MainWindow): self.main_window = main_window self.setWindowIcon(get_app_icon()) self.setWindowFlags( - Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint # type: ignore + Qt.WindowType.Window + | Qt.WindowType.CustomizeWindowHint + | Qt.WindowType.WindowTitleHint + | Qt.WindowType.WindowCloseButtonHint ) # setting all the params self.date_edit.setDateTime(QDateTime.currentDateTime()) @@ -159,11 +162,15 @@ def plot(self): # Add numbers above the bars for i, (_, row) in enumerate(plot_df.iterrows()): - total_time = row["work"] + row["overtime"] - if total_time <= 0: + total_time = sum(row) + if total_time <= 0.0: continue # put small offset for the numbers to not overlap with the bar position = (i, total_time + 0.01 * needed_hours) + # last 3% will collide with the line, in this case just put it above the line already + line_collide = 0.97 * needed_hours <= total_time <= needed_hours + if line_collide: + position = (i, 1.01 * needed_hours) ax.annotate(f"{total_time:.1f}", position, ha="center", va="bottom", fontsize=8, weight="bold") if self.radio_month.isChecked(): @@ -184,7 +191,10 @@ def adjust_df_for_plot(self, df: pd.DataFrame, needed_hours: float) -> pd.DataFr df["overtime"] = df["work"] - needed_hours df["overtime"] = df["overtime"].clip(lower=0) df["work"] = df["work"].clip(upper=needed_hours, lower=0) - return df[["work", "overtime", "pause"]] + to_keep = ["work", "overtime"] + if CONFIG_HANDLER.config.plot_pause: + to_keep.append("pause") + return df[to_keep] def _create_dummy_df(self) -> pd.DataFrame: """Create a dummy dataframe if no data is available.""" diff --git a/src/ui_mainwindow.py b/src/ui_mainwindow.py index 284deac..95b9bb2 100644 --- a/src/ui_mainwindow.py +++ b/src/ui_mainwindow.py @@ -2,9 +2,9 @@ import logging from collections.abc import Callable -from PyQt5.QtCore import Qt -from PyQt5.QtGui import QIcon -from PyQt5.QtWidgets import QAction, QApplication, QMainWindow, QMenu, QSystemTrayIcon +from PyQt6.QtCore import Qt +from PyQt6.QtGui import QAction, QIcon +from PyQt6.QtWidgets import QApplication, QMainWindow, QMenu, QSystemTrayIcon from src.database_controller import DB_CONTROLLER from src.icons import get_preset_icons @@ -24,7 +24,7 @@ def __init__(self): """Init. Many of the button and List connects are in pass_setup.""" super().__init__() self.setupUi(self) - self.setWindowFlags(self.windowFlags() & ~Qt.WindowMaximizeButtonHint) # type: ignore + self.setWindowFlags(self.windowFlags() & ~Qt.WindowType.WindowMaximizeButtonHint) self.icons = get_preset_icons() self.clock_icon = self.icons.clock self.connect_buttons() @@ -77,7 +77,7 @@ def set_tray(self): def add_tray_menu_option(self, tray_menu: QMenu, icon: QIcon, text: str, action: Callable[[], None]): start_action = QAction(icon, text, self) - start_action.triggered.connect(action) # type: ignore + start_action.triggered.connect(action) tray_menu.addAction(start_action) def close_app(self): @@ -155,13 +155,13 @@ def add_pause(self, check_past_entry: bool = True): def get_past_date(self): """Return the date from the past datetime edit.""" - qt_object = self.past_datetime_edit.dateTime() # type: ignore + qt_object = self.past_datetime_edit.dateTime() qt_date = qt_object.date() return datetime.date(qt_date.year(), qt_date.month(), qt_date.day()) def get_past_datetime(self): """Return the datetime from the past datetime edit.""" - qt_object = self.past_datetime_edit.dateTime() # type: ignore + qt_object = self.past_datetime_edit.dateTime() qt_date = qt_object.date() qt_time = qt_object.time() return datetime.datetime( diff --git a/src/ui_vacation_window.py b/src/ui_vacation_window.py index 253da28..20ecc7e 100644 --- a/src/ui_vacation_window.py +++ b/src/ui_vacation_window.py @@ -3,8 +3,8 @@ import datetime from typing import TYPE_CHECKING -from PyQt5.QtCore import Qt -from PyQt5.QtWidgets import QHBoxLayout, QLabel, QListWidgetItem, QPushButton, QSizePolicy, QWidget +from PyQt6.QtCore import Qt +from PyQt6.QtWidgets import QHBoxLayout, QLabel, QListWidgetItem, QPushButton, QSizePolicy, QWidget from src.database_controller import DB_CONTROLLER from src.icons import get_app_icon, get_preset_icons @@ -22,8 +22,13 @@ def __init__(self, main_window: MainWindow): self.main_window = main_window self.setupUi(self) self.setWindowIcon(get_app_icon()) - self.setWindowFlags(Qt.Window | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint) # type: ignore - self.setAttribute(Qt.WA_DeleteOnClose) # type: ignore + self.setWindowFlags( + Qt.WindowType.Window + | Qt.WindowType.CustomizeWindowHint + | Qt.WindowType.WindowTitleHint + | Qt.WindowType.WindowCloseButtonHint + ) + self.setAttribute(Qt.WidgetAttribute.WA_DeleteOnClose) # setting dates to today today = datetime.date.today() @@ -54,13 +59,13 @@ def add_date_item(self, date: datetime.date): line_text = QLabel(f"{date.strftime('%m-%d | %B')} {date.day}{suffix}") line_text.setStyleSheet("font-size: 16px;") delete_button = QPushButton("") - delete_button.clicked.connect(lambda: self.delete_date_item(item, date)) # type: ignore + delete_button.clicked.connect(lambda: self.delete_date_item(item, date)) delete_button.setIcon(get_preset_icons().delete_inverted) # set red border and add a padding top bottom of 5px delete_button.setStyleSheet("border: 1px solid red; border-radius: 5px; padding: 5px; background-color: red;") # always shrink the button to the minimum size delete_button.setMaximumWidth(30) - delete_button.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) # type: ignore + delete_button.setSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum) item_layout = QHBoxLayout() item_layout.setContentsMargins(0, 0, 0, 0) # Set margins to 0 item_layout.addWidget(line_text) diff --git a/src/utils.py b/src/utils.py index 6da4395..9b5de5e 100644 --- a/src/utils.py +++ b/src/utils.py @@ -6,7 +6,7 @@ import darkdetect import qdarktheme -from PyQt5.QtWidgets import QApplication +from PyQt6.QtWidgets import QApplication from src.filepath import ( CONFIG_PATH, @@ -51,7 +51,7 @@ def get_additional_run_args() -> list[str]: system = platform.system() # windows need some extra love for the window header to be dark if system == "Windows" and not is_light(): - return ["-platform", "windows:darkmode=1"] + return ["-platform", "windows:darkmode=2"] return [] diff --git a/ui/config_window.py b/ui/config_window.py index 45c94cf..05bb8a0 100644 --- a/ui/config_window.py +++ b/ui/config_window.py @@ -1,239 +1,248 @@ -# -*- coding: utf-8 -*- - # Form implementation generated from reading ui file '.\config_window.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt6 UI code generator 6.4.2 # -# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_ConfigWindow(object): def setupUi(self, ConfigWindow): ConfigWindow.setObjectName("ConfigWindow") - ConfigWindow.resize(748, 388) + ConfigWindow.resize(748, 422) self.verticalLayout = QtWidgets.QVBoxLayout(ConfigWindow) self.verticalLayout.setObjectName("verticalLayout") - self.label_5 = QtWidgets.QLabel(ConfigWindow) + self.label_5 = QtWidgets.QLabel(parent=ConfigWindow) font = QtGui.QFont() font.setPointSize(12) self.label_5.setFont(font) self.label_5.setWordWrap(True) self.label_5.setObjectName("label_5") self.verticalLayout.addWidget(self.label_5) - self.scrollArea = QtWidgets.QScrollArea(ConfigWindow) - self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) - self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain) + self.scrollArea = QtWidgets.QScrollArea(parent=ConfigWindow) + self.scrollArea.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) + self.scrollArea.setFrameShadow(QtWidgets.QFrame.Shadow.Plain) self.scrollArea.setLineWidth(1) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtWidgets.QWidget() - self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 730, 258)) + self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 730, 288)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout_3.setContentsMargins(0, 0, 4, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") self.gridLayout_2 = QtWidgets.QGridLayout() self.gridLayout_2.setObjectName("gridLayout_2") - self.label_2 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - self.label_2.setMaximumSize(QtCore.QSize(16777215, 50)) + self.label_6 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_6.setMaximumSize(QtCore.QSize(16777215, 50)) font = QtGui.QFont() font.setPointSize(12) - self.label_2.setFont(font) - self.label_2.setObjectName("label_2") - self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) - self.filter_subdiv = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) + self.label_6.setFont(font) + self.label_6.setObjectName("label_6") + self.gridLayout_2.addWidget(self.label_6, 4, 0, 1, 1) + self.label_7 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + font = QtGui.QFont() + font.setPointSize(12) + self.label_7.setFont(font) + self.label_7.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.label_7.setObjectName("label_7") + self.gridLayout_2.addWidget(self.label_7, 3, 2, 1, 1) + self.filter_subdiv = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents) self.filter_subdiv.setMinimumSize(QtCore.QSize(0, 35)) self.filter_subdiv.setMaximumSize(QtCore.QSize(100, 16777215)) font = QtGui.QFont() font.setPointSize(12) self.filter_subdiv.setFont(font) - self.filter_subdiv.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.filter_subdiv.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) self.filter_subdiv.setObjectName("filter_subdiv") self.gridLayout_2.addWidget(self.filter_subdiv, 4, 3, 1, 1) - self.filter_country = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) - self.filter_country.setMinimumSize(QtCore.QSize(0, 35)) - self.filter_country.setMaximumSize(QtCore.QSize(100, 16777215)) - font = QtGui.QFont() - font.setPointSize(12) - self.filter_country.setFont(font) - self.filter_country.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.filter_country.setObjectName("filter_country") - self.gridLayout_2.addWidget(self.filter_country, 3, 3, 1, 1) - self.label_4 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - self.label_4.setMaximumSize(QtCore.QSize(16777215, 50)) - font = QtGui.QFont() - font.setPointSize(12) - self.label_4.setFont(font) - self.label_4.setObjectName("label_4") - self.gridLayout_2.addWidget(self.label_4, 3, 0, 1, 1) - self.label_8 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - font = QtGui.QFont() - font.setPointSize(12) - self.label_8.setFont(font) - self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_8.setObjectName("label_8") - self.gridLayout_2.addWidget(self.label_8, 4, 2, 1, 1) - self.label_3 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - self.label_3.setMaximumSize(QtCore.QSize(16777215, 50)) - font = QtGui.QFont() - font.setPointSize(12) - self.label_3.setFont(font) - self.label_3.setObjectName("label_3") - self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) - self.label_6 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - self.label_6.setMaximumSize(QtCore.QSize(16777215, 50)) - font = QtGui.QFont() - font.setPointSize(12) - self.label_6.setFont(font) - self.label_6.setObjectName("label_6") - self.gridLayout_2.addWidget(self.label_6, 4, 0, 1, 1) - self.label_10 = QtWidgets.QLabel(self.scrollAreaWidgetContents) + self.label_10 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) self.label_10.setMaximumSize(QtCore.QSize(16777215, 50)) font = QtGui.QFont() font.setPointSize(12) self.label_10.setFont(font) self.label_10.setObjectName("label_10") self.gridLayout_2.addWidget(self.label_10, 5, 0, 1, 1) - self.label_9 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - self.label_9.setMaximumSize(QtCore.QSize(16777215, 50)) - font = QtGui.QFont() - font.setPointSize(12) - self.label_9.setFont(font) - self.label_9.setObjectName("label_9") - self.gridLayout_2.addWidget(self.label_9, 2, 0, 1, 1) - self.label_7 = QtWidgets.QLabel(self.scrollAreaWidgetContents) - font = QtGui.QFont() - font.setPointSize(12) - self.label_7.setFont(font) - self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.label_7.setObjectName("label_7") - self.gridLayout_2.addWidget(self.label_7, 3, 2, 1, 1) - self.input_country = QtWidgets.QComboBox(self.scrollAreaWidgetContents) + self.input_country = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents) self.input_country.setMinimumSize(QtCore.QSize(0, 35)) font = QtGui.QFont() font.setPointSize(12) self.input_country.setFont(font) self.input_country.setObjectName("input_country") self.gridLayout_2.addWidget(self.input_country, 3, 1, 1, 1) - self.input_subdiv = QtWidgets.QComboBox(self.scrollAreaWidgetContents) - self.input_subdiv.setMinimumSize(QtCore.QSize(0, 35)) - font = QtGui.QFont() - font.setPointSize(12) - self.input_subdiv.setFont(font) - self.input_subdiv.setObjectName("input_subdiv") - self.gridLayout_2.addWidget(self.input_subdiv, 4, 1, 1, 1) - self.input_name = QtWidgets.QLineEdit(self.scrollAreaWidgetContents) - self.input_name.setMinimumSize(QtCore.QSize(0, 35)) - font = QtGui.QFont() - font.setPointSize(12) - self.input_name.setFont(font) - self.input_name.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.input_name.setObjectName("input_name") - self.gridLayout_2.addWidget(self.input_name, 0, 1, 1, 3) - self.input_daily_hours = QtWidgets.QDoubleSpinBox(self.scrollAreaWidgetContents) - self.input_daily_hours.setMinimumSize(QtCore.QSize(0, 35)) - font = QtGui.QFont() - font.setPointSize(12) - self.input_daily_hours.setFont(font) - self.input_daily_hours.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.input_daily_hours.setObjectName("input_daily_hours") - self.gridLayout_2.addWidget(self.input_daily_hours, 1, 1, 1, 3) - self.input_weekly_hours = QtWidgets.QDoubleSpinBox(self.scrollAreaWidgetContents) - self.input_weekly_hours.setMinimumSize(QtCore.QSize(0, 35)) - font = QtGui.QFont() - font.setPointSize(12) - self.input_weekly_hours.setFont(font) - self.input_weekly_hours.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) - self.input_weekly_hours.setObjectName("input_weekly_hours") - self.gridLayout_2.addWidget(self.input_weekly_hours, 2, 1, 1, 3) self.horizontalLayout_2 = QtWidgets.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") - self.radio_weekday_0 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_0 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_0.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_0.setMaximumSize(QtCore.QSize(60, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_0.setFont(font) self.radio_weekday_0.setAutoExclusive(False) self.radio_weekday_0.setObjectName("radio_weekday_0") self.horizontalLayout_2.addWidget(self.radio_weekday_0) - self.radio_weekday_1 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_1 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_1.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_1.setMaximumSize(QtCore.QSize(60, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_1.setFont(font) self.radio_weekday_1.setAutoExclusive(False) self.radio_weekday_1.setObjectName("radio_weekday_1") self.horizontalLayout_2.addWidget(self.radio_weekday_1) - self.radio_weekday_2 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_2 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_2.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_2.setMaximumSize(QtCore.QSize(70, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_2.setFont(font) self.radio_weekday_2.setAutoExclusive(False) self.radio_weekday_2.setObjectName("radio_weekday_2") self.horizontalLayout_2.addWidget(self.radio_weekday_2) - self.radio_weekday_3 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_3 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_3.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_3.setMaximumSize(QtCore.QSize(60, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_3.setFont(font) self.radio_weekday_3.setAutoExclusive(False) self.radio_weekday_3.setObjectName("radio_weekday_3") self.horizontalLayout_2.addWidget(self.radio_weekday_3) - self.radio_weekday_4 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_4 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_4.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_4.setMaximumSize(QtCore.QSize(55, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_4.setFont(font) self.radio_weekday_4.setAutoExclusive(False) self.radio_weekday_4.setObjectName("radio_weekday_4") self.horizontalLayout_2.addWidget(self.radio_weekday_4) - self.radio_weekday_5 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_5 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_5.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_5.setMaximumSize(QtCore.QSize(60, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_5.setFont(font) self.radio_weekday_5.setAutoExclusive(False) self.radio_weekday_5.setObjectName("radio_weekday_5") self.horizontalLayout_2.addWidget(self.radio_weekday_5) - self.radio_weekday_6 = QtWidgets.QRadioButton(self.scrollAreaWidgetContents) + self.radio_weekday_6 = QtWidgets.QRadioButton(parent=self.scrollAreaWidgetContents) self.radio_weekday_6.setMinimumSize(QtCore.QSize(0, 35)) self.radio_weekday_6.setMaximumSize(QtCore.QSize(60, 50)) font = QtGui.QFont() font.setPointSize(12) font.setBold(True) - font.setWeight(75) self.radio_weekday_6.setFont(font) self.radio_weekday_6.setAutoExclusive(False) self.radio_weekday_6.setObjectName("radio_weekday_6") self.horizontalLayout_2.addWidget(self.radio_weekday_6) self.gridLayout_2.addLayout(self.horizontalLayout_2, 5, 1, 1, 3) + self.label_4 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_4.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_4.setFont(font) + self.label_4.setObjectName("label_4") + self.gridLayout_2.addWidget(self.label_4, 3, 0, 1, 1) + self.input_daily_hours = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents) + self.input_daily_hours.setMinimumSize(QtCore.QSize(0, 35)) + font = QtGui.QFont() + font.setPointSize(12) + self.input_daily_hours.setFont(font) + self.input_daily_hours.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.input_daily_hours.setObjectName("input_daily_hours") + self.gridLayout_2.addWidget(self.input_daily_hours, 1, 1, 1, 3) + self.label_8 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + font = QtGui.QFont() + font.setPointSize(12) + self.label_8.setFont(font) + self.label_8.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.label_8.setObjectName("label_8") + self.gridLayout_2.addWidget(self.label_8, 4, 2, 1, 1) + self.input_subdiv = QtWidgets.QComboBox(parent=self.scrollAreaWidgetContents) + self.input_subdiv.setMinimumSize(QtCore.QSize(0, 35)) + font = QtGui.QFont() + font.setPointSize(12) + self.input_subdiv.setFont(font) + self.input_subdiv.setObjectName("input_subdiv") + self.gridLayout_2.addWidget(self.input_subdiv, 4, 1, 1, 1) + self.filter_country = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents) + self.filter_country.setMinimumSize(QtCore.QSize(0, 35)) + self.filter_country.setMaximumSize(QtCore.QSize(100, 16777215)) + font = QtGui.QFont() + font.setPointSize(12) + self.filter_country.setFont(font) + self.filter_country.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.filter_country.setObjectName("filter_country") + self.gridLayout_2.addWidget(self.filter_country, 3, 3, 1, 1) + self.input_name = QtWidgets.QLineEdit(parent=self.scrollAreaWidgetContents) + self.input_name.setMinimumSize(QtCore.QSize(0, 35)) + font = QtGui.QFont() + font.setPointSize(12) + self.input_name.setFont(font) + self.input_name.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.input_name.setObjectName("input_name") + self.gridLayout_2.addWidget(self.input_name, 0, 1, 1, 3) + self.input_weekly_hours = QtWidgets.QDoubleSpinBox(parent=self.scrollAreaWidgetContents) + self.input_weekly_hours.setMinimumSize(QtCore.QSize(0, 35)) + font = QtGui.QFont() + font.setPointSize(12) + self.input_weekly_hours.setFont(font) + self.input_weekly_hours.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) + self.input_weekly_hours.setObjectName("input_weekly_hours") + self.gridLayout_2.addWidget(self.input_weekly_hours, 2, 1, 1, 3) + self.label_2 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_2.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_2.setFont(font) + self.label_2.setObjectName("label_2") + self.gridLayout_2.addWidget(self.label_2, 0, 0, 1, 1) + self.label_9 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_9.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_9.setFont(font) + self.label_9.setObjectName("label_9") + self.gridLayout_2.addWidget(self.label_9, 2, 0, 1, 1) + self.label_3 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_3.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_3.setFont(font) + self.label_3.setObjectName("label_3") + self.gridLayout_2.addWidget(self.label_3, 1, 0, 1, 1) + self.label_11 = QtWidgets.QLabel(parent=self.scrollAreaWidgetContents) + self.label_11.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.label_11.setFont(font) + self.label_11.setObjectName("label_11") + self.gridLayout_2.addWidget(self.label_11, 6, 0, 1, 1) + self.input_plot_pause = QtWidgets.QCheckBox(parent=self.scrollAreaWidgetContents) + self.input_plot_pause.setMinimumSize(QtCore.QSize(0, 35)) + self.input_plot_pause.setMaximumSize(QtCore.QSize(16777215, 50)) + font = QtGui.QFont() + font.setPointSize(12) + self.input_plot_pause.setFont(font) + self.input_plot_pause.setLayoutDirection(QtCore.Qt.LayoutDirection.LeftToRight) + self.input_plot_pause.setIconSize(QtCore.QSize(20, 20)) + self.input_plot_pause.setChecked(True) + self.input_plot_pause.setObjectName("input_plot_pause") + self.gridLayout_2.addWidget(self.input_plot_pause, 6, 1, 1, 3) self.verticalLayout_3.addLayout(self.gridLayout_2) self.scrollArea.setWidget(self.scrollAreaWidgetContents) self.verticalLayout.addWidget(self.scrollArea) - self.apply_button = QtWidgets.QPushButton(ConfigWindow) + self.apply_button = QtWidgets.QPushButton(parent=ConfigWindow) self.apply_button.setMinimumSize(QtCore.QSize(0, 50)) font = QtGui.QFont() font.setPointSize(20) @@ -248,14 +257,9 @@ def retranslateUi(self, ConfigWindow): _translate = QtCore.QCoreApplication.translate ConfigWindow.setWindowTitle(_translate("ConfigWindow", "Settings")) self.label_5.setText(_translate("ConfigWindow", "
Change your local settings.
Use decimals for minutes, e.g. 30 minutes are 30/60 = 0.5 h.
")) - self.label_2.setText(_translate("ConfigWindow", "Name:")) - self.label_4.setText(_translate("ConfigWindow", "Country:")) - self.label_8.setText(_translate("ConfigWindow", "Filter:")) - self.label_3.setText(_translate("ConfigWindow", "Daily Hours:")) self.label_6.setText(_translate("ConfigWindow", "Subdiv:")) - self.label_10.setText(_translate("ConfigWindow", "Workdays:")) - self.label_9.setText(_translate("ConfigWindow", "Weekly Hours:")) self.label_7.setText(_translate("ConfigWindow", "Filter:")) + self.label_10.setText(_translate("ConfigWindow", "Workdays:")) self.radio_weekday_0.setText(_translate("ConfigWindow", "Mon")) self.radio_weekday_1.setText(_translate("ConfigWindow", "Tue")) self.radio_weekday_2.setText(_translate("ConfigWindow", "Wed")) @@ -263,6 +267,13 @@ def retranslateUi(self, ConfigWindow): self.radio_weekday_4.setText(_translate("ConfigWindow", "Fri")) self.radio_weekday_5.setText(_translate("ConfigWindow", "Sat")) self.radio_weekday_6.setText(_translate("ConfigWindow", "Sun")) + self.label_4.setText(_translate("ConfigWindow", "Country:")) + self.label_8.setText(_translate("ConfigWindow", "Filter:")) + self.label_2.setText(_translate("ConfigWindow", "Name:")) + self.label_9.setText(_translate("ConfigWindow", "Weekly Hours:")) + self.label_3.setText(_translate("ConfigWindow", "Daily Hours:")) + self.label_11.setText(_translate("ConfigWindow", "Plot Pause:")) + self.input_plot_pause.setText(_translate("ConfigWindow", "Display Pause on Bar Plot")) self.apply_button.setText(_translate("ConfigWindow", "Apply")) @@ -273,4 +284,4 @@ def retranslateUi(self, ConfigWindow): ui = Ui_ConfigWindow() ui.setupUi(ConfigWindow) ConfigWindow.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) diff --git a/ui/data_window.py b/ui/data_window.py index 9d0a682..cd657fe 100644 --- a/ui/data_window.py +++ b/ui/data_window.py @@ -1,14 +1,12 @@ -# -*- coding: utf-8 -*- - # Form implementation generated from reading ui file '.\data_window.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt6 UI code generator 6.4.2 # -# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_DataWindow(object): @@ -21,14 +19,14 @@ def setupUi(self, DataWindow): self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout_3 = QtWidgets.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") - self.export_button = QtWidgets.QPushButton(DataWindow) + self.export_button = QtWidgets.QPushButton(parent=DataWindow) self.export_button.setMaximumSize(QtCore.QSize(300, 50)) font = QtGui.QFont() font.setPointSize(20) self.export_button.setFont(font) self.export_button.setObjectName("export_button") self.horizontalLayout_3.addWidget(self.export_button) - self.switch_button = QtWidgets.QPushButton(DataWindow) + self.switch_button = QtWidgets.QPushButton(parent=DataWindow) self.switch_button.setMaximumSize(QtCore.QSize(300, 50)) font = QtGui.QFont() font.setPointSize(20) @@ -37,11 +35,11 @@ def setupUi(self, DataWindow): self.switch_button.setObjectName("switch_button") self.horizontalLayout_3.addWidget(self.switch_button) self.verticalLayout.addLayout(self.horizontalLayout_3) - self.tableWidget = QtWidgets.QTableWidget(DataWindow) + self.tableWidget = QtWidgets.QTableWidget(parent=DataWindow) self.tableWidget.setMinimumSize(QtCore.QSize(500, 0)) self.tableWidget.setMaximumSize(QtCore.QSize(600, 16777215)) - self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) - self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) + self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.SingleSelection) + self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectionBehavior.SelectRows) self.tableWidget.setColumnCount(2) self.tableWidget.setObjectName("tableWidget") self.tableWidget.setRowCount(0) @@ -60,7 +58,7 @@ def setupUi(self, DataWindow): self.tableWidget.horizontalHeader().setStretchLastSection(True) self.tableWidget.verticalHeader().setSortIndicatorShown(False) self.verticalLayout.addWidget(self.tableWidget) - self.delete_event_button = QtWidgets.QPushButton(DataWindow) + self.delete_event_button = QtWidgets.QPushButton(parent=DataWindow) self.delete_event_button.setMinimumSize(QtCore.QSize(0, 50)) self.delete_event_button.setMaximumSize(QtCore.QSize(600, 50)) font = QtGui.QFont() @@ -73,7 +71,7 @@ def setupUi(self, DataWindow): self.container.setObjectName("container") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.button_month_prev = QtWidgets.QPushButton(DataWindow) + self.button_month_prev = QtWidgets.QPushButton(parent=DataWindow) self.button_month_prev.setMaximumSize(QtCore.QSize(50, 50)) font = QtGui.QFont() font.setPointSize(20) @@ -81,17 +79,17 @@ def setupUi(self, DataWindow): self.button_month_prev.setCheckable(False) self.button_month_prev.setObjectName("button_month_prev") self.horizontalLayout.addWidget(self.button_month_prev) - self.date_edit = QtWidgets.QDateEdit(DataWindow) + self.date_edit = QtWidgets.QDateEdit(parent=DataWindow) self.date_edit.setMaximumSize(QtCore.QSize(16777215, 50)) font = QtGui.QFont() font.setPointSize(18) self.date_edit.setFont(font) - self.date_edit.setCurrentSection(QtWidgets.QDateTimeEdit.DaySection) + self.date_edit.setCurrentSection(QtWidgets.QDateTimeEdit.Section.DaySection) self.date_edit.setCalendarPopup(True) self.date_edit.setDate(QtCore.QDate(2020, 7, 1)) self.date_edit.setObjectName("date_edit") self.horizontalLayout.addWidget(self.date_edit) - self.button_month_next = QtWidgets.QPushButton(DataWindow) + self.button_month_next = QtWidgets.QPushButton(parent=DataWindow) self.button_month_next.setMaximumSize(QtCore.QSize(50, 50)) font = QtGui.QFont() font.setPointSize(20) @@ -99,9 +97,9 @@ def setupUi(self, DataWindow): self.button_month_next.setCheckable(False) self.button_month_next.setObjectName("button_month_next") self.horizontalLayout.addWidget(self.button_month_next) - spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem) - self.radio_month = QtWidgets.QRadioButton(DataWindow) + self.radio_month = QtWidgets.QRadioButton(parent=DataWindow) self.radio_month.setMaximumSize(QtCore.QSize(100, 16777215)) font = QtGui.QFont() font.setPointSize(12) @@ -114,7 +112,7 @@ def setupUi(self, DataWindow): self.plot_type_group.setObjectName("plot_type_group") self.plot_type_group.addButton(self.radio_month) self.horizontalLayout.addWidget(self.radio_month) - self.radio_year = QtWidgets.QRadioButton(DataWindow) + self.radio_year = QtWidgets.QRadioButton(parent=DataWindow) self.radio_year.setMaximumSize(QtCore.QSize(80, 16777215)) font = QtGui.QFont() font.setPointSize(12) @@ -124,9 +122,9 @@ def setupUi(self, DataWindow): self.radio_year.setObjectName("radio_year") self.plot_type_group.addButton(self.radio_year) self.horizontalLayout.addWidget(self.radio_year) - spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum) + spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Minimum) self.horizontalLayout.addItem(spacerItem1) - self.save_button = QtWidgets.QPushButton(DataWindow) + self.save_button = QtWidgets.QPushButton(parent=DataWindow) self.save_button.setMaximumSize(QtCore.QSize(16777215, 50)) font = QtGui.QFont() font.setPointSize(20) @@ -164,4 +162,4 @@ def retranslateUi(self, DataWindow): ui = Ui_DataWindow() ui.setupUi(DataWindow) DataWindow.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) diff --git a/ui/mainwindow.py b/ui/mainwindow.py index fd6c53b..af442df 100644 --- a/ui/mainwindow.py +++ b/ui/mainwindow.py @@ -1,27 +1,25 @@ -# -*- coding: utf-8 -*- - # Form implementation generated from reading ui file '.\mainwindow.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt6 UI code generator 6.4.2 # -# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(368, 283) - self.centralwidget = QtWidgets.QWidget(MainWindow) + self.centralwidget = QtWidgets.QWidget(parent=MainWindow) self.centralwidget.setObjectName("centralwidget") self.horizontalLayout = QtWidgets.QHBoxLayout(self.centralwidget) self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtWidgets.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") - self.start_button = QtWidgets.QPushButton(self.centralwidget) + self.start_button = QtWidgets.QPushButton(parent=self.centralwidget) self.start_button.setMinimumSize(QtCore.QSize(0, 50)) self.start_button.setMaximumSize(QtCore.QSize(200, 100)) font = QtGui.QFont() @@ -29,7 +27,7 @@ def setupUi(self, MainWindow): self.start_button.setFont(font) self.start_button.setObjectName("start_button") self.verticalLayout.addWidget(self.start_button) - self.stop_button = QtWidgets.QPushButton(self.centralwidget) + self.stop_button = QtWidgets.QPushButton(parent=self.centralwidget) self.stop_button.setMinimumSize(QtCore.QSize(0, 50)) self.stop_button.setMaximumSize(QtCore.QSize(200, 100)) font = QtGui.QFont() @@ -37,7 +35,7 @@ def setupUi(self, MainWindow): self.stop_button.setFont(font) self.stop_button.setObjectName("stop_button") self.verticalLayout.addWidget(self.stop_button) - self.past_datetime_edit = QtWidgets.QDateTimeEdit(self.centralwidget) + self.past_datetime_edit = QtWidgets.QDateTimeEdit(parent=self.centralwidget) self.past_datetime_edit.setMinimumSize(QtCore.QSize(0, 50)) self.past_datetime_edit.setMaximumSize(QtCore.QSize(200, 100)) font = QtGui.QFont() @@ -49,19 +47,19 @@ def setupUi(self, MainWindow): self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_2 = QtWidgets.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") - self.pause_box = QtWidgets.QSpinBox(self.centralwidget) + self.pause_box = QtWidgets.QSpinBox(parent=self.centralwidget) self.pause_box.setMinimumSize(QtCore.QSize(0, 50)) self.pause_box.setMaximumSize(QtCore.QSize(16777215, 100)) font = QtGui.QFont() font.setPointSize(18) self.pause_box.setFont(font) - self.pause_box.setAlignment(QtCore.Qt.AlignCenter) + self.pause_box.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.pause_box.setMinimum(-120) self.pause_box.setMaximum(120) self.pause_box.setSingleStep(5) self.pause_box.setObjectName("pause_box") self.verticalLayout_2.addWidget(self.pause_box) - self.pause_button = QtWidgets.QPushButton(self.centralwidget) + self.pause_button = QtWidgets.QPushButton(parent=self.centralwidget) self.pause_button.setMinimumSize(QtCore.QSize(0, 50)) self.pause_button.setMaximumSize(QtCore.QSize(200, 100)) font = QtGui.QFont() @@ -69,7 +67,7 @@ def setupUi(self, MainWindow): self.pause_button.setFont(font) self.pause_button.setObjectName("pause_button") self.verticalLayout_2.addWidget(self.pause_button) - self.back_button = QtWidgets.QPushButton(self.centralwidget) + self.back_button = QtWidgets.QPushButton(parent=self.centralwidget) self.back_button.setMinimumSize(QtCore.QSize(0, 50)) self.back_button.setMaximumSize(QtCore.QSize(200, 100)) font = QtGui.QFont() @@ -79,33 +77,33 @@ def setupUi(self, MainWindow): self.verticalLayout_2.addWidget(self.back_button) self.horizontalLayout.addLayout(self.verticalLayout_2) MainWindow.setCentralWidget(self.centralwidget) - self.menubar = QtWidgets.QMenuBar(MainWindow) + self.menubar = QtWidgets.QMenuBar(parent=MainWindow) self.menubar.setGeometry(QtCore.QRect(0, 0, 368, 21)) self.menubar.setObjectName("menubar") - self.menuOptions = QtWidgets.QMenu(self.menubar) + self.menuOptions = QtWidgets.QMenu(parent=self.menubar) self.menuOptions.setObjectName("menuOptions") MainWindow.setMenuBar(self.menubar) - self.action_show_events = QtWidgets.QAction(MainWindow) + self.action_show_events = QtGui.QAction(parent=MainWindow) self.action_show_events.setObjectName("action_show_events") - self.action_add_events = QtWidgets.QAction(MainWindow) + self.action_add_events = QtGui.QAction(parent=MainWindow) self.action_add_events.setObjectName("action_add_events") - self.action_report = QtWidgets.QAction(MainWindow) + self.action_report = QtGui.QAction(parent=MainWindow) self.action_report.setObjectName("action_report") - self.action_configuration = QtWidgets.QAction(MainWindow) + self.action_configuration = QtGui.QAction(parent=MainWindow) self.action_configuration.setObjectName("action_configuration") - self.action_save_folder = QtWidgets.QAction(MainWindow) + self.action_save_folder = QtGui.QAction(parent=MainWindow) self.action_save_folder.setObjectName("action_save_folder") - self.action_update = QtWidgets.QAction(MainWindow) + self.action_update = QtGui.QAction(parent=MainWindow) self.action_update.setObjectName("action_update") - self.action_past_entry = QtWidgets.QAction(MainWindow) + self.action_past_entry = QtGui.QAction(parent=MainWindow) self.action_past_entry.setObjectName("action_past_entry") - self.action_tmp2 = QtWidgets.QAction(MainWindow) + self.action_tmp2 = QtGui.QAction(parent=MainWindow) self.action_tmp2.setObjectName("action_tmp2") - self.action_about = QtWidgets.QAction(MainWindow) + self.action_about = QtGui.QAction(parent=MainWindow) self.action_about.setObjectName("action_about") - self.action_open_folder = QtWidgets.QAction(MainWindow) + self.action_open_folder = QtGui.QAction(parent=MainWindow) self.action_open_folder.setObjectName("action_open_folder") - self.action_set_vacation = QtWidgets.QAction(MainWindow) + self.action_set_vacation = QtGui.QAction(parent=MainWindow) self.action_set_vacation.setObjectName("action_set_vacation") self.menuOptions.addAction(self.action_report) self.menuOptions.addAction(self.action_past_entry) @@ -150,4 +148,4 @@ def retranslateUi(self, MainWindow): ui = Ui_MainWindow() ui.setupUi(MainWindow) MainWindow.show() - sys.exit(app.exec_()) + sys.exit(app.exec()) diff --git a/ui/vacation_window.py b/ui/vacation_window.py index c24f813..81ba536 100644 --- a/ui/vacation_window.py +++ b/ui/vacation_window.py @@ -1,14 +1,12 @@ -# -*- coding: utf-8 -*- - # Form implementation generated from reading ui file '.\vacation_window.ui' # -# Created by: PyQt5 UI code generator 5.15.7 +# Created by: PyQt6 UI code generator 6.4.2 # -# WARNING: Any manual changes made to this file will be lost when pyuic5 is +# WARNING: Any manual changes made to this file will be lost when pyuic6 is # run again. Do not edit this file unless you know what you are doing. -from PyQt5 import QtCore, QtGui, QtWidgets +from PyQt6 import QtCore, QtGui, QtWidgets class Ui_VacationWindow(object): @@ -17,7 +15,7 @@ def setupUi(self, VacationWindow): VacationWindow.resize(475, 656) self.verticalLayout = QtWidgets.QVBoxLayout(VacationWindow) self.verticalLayout.setObjectName("verticalLayout") - self.label_5 = QtWidgets.QLabel(VacationWindow) + self.label_5 = QtWidgets.QLabel(parent=VacationWindow) font = QtGui.QFont() font.setPointSize(12) self.label_5.setFont(font) @@ -26,17 +24,17 @@ def setupUi(self, VacationWindow): self.verticalLayout.addWidget(self.label_5) self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") - self.date_edit = QtWidgets.QDateEdit(VacationWindow) + self.date_edit = QtWidgets.QDateEdit(parent=VacationWindow) font = QtGui.QFont() font.setPointSize(18) self.date_edit.setFont(font) self.date_edit.setDateTime(QtCore.QDateTime(QtCore.QDate(2024, 1, 1), QtCore.QTime(0, 0, 0))) - self.date_edit.setCurrentSection(QtWidgets.QDateTimeEdit.DaySection) + self.date_edit.setCurrentSection(QtWidgets.QDateTimeEdit.Section.DaySection) self.date_edit.setCalendarPopup(True) self.date_edit.setDate(QtCore.QDate(2024, 1, 1)) self.date_edit.setObjectName("date_edit") self.horizontalLayout.addWidget(self.date_edit) - self.save_button = QtWidgets.QPushButton(VacationWindow) + self.save_button = QtWidgets.QPushButton(parent=VacationWindow) self.save_button.setMaximumSize(QtCore.QSize(100, 16777215)) font = QtGui.QFont() font.setPointSize(20) @@ -44,26 +42,26 @@ def setupUi(self, VacationWindow): self.save_button.setObjectName("save_button") self.horizontalLayout.addWidget(self.save_button) self.verticalLayout.addLayout(self.horizontalLayout) - self.year_select = QtWidgets.QSpinBox(VacationWindow) + self.year_select = QtWidgets.QSpinBox(parent=VacationWindow) font = QtGui.QFont() font.setPointSize(18) self.year_select.setFont(font) - self.year_select.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter) + self.year_select.setAlignment(QtCore.Qt.AlignmentFlag.AlignRight|QtCore.Qt.AlignmentFlag.AlignTrailing|QtCore.Qt.AlignmentFlag.AlignVCenter) self.year_select.setMinimum(2000) self.year_select.setMaximum(2050) self.year_select.setProperty("value", 2024) self.year_select.setObjectName("year_select") self.verticalLayout.addWidget(self.year_select) - self.label_list_view = QtWidgets.QLabel(VacationWindow) + self.label_list_view = QtWidgets.QLabel(parent=VacationWindow) font = QtGui.QFont() font.setPointSize(10) self.label_list_view.setFont(font) - self.label_list_view.setAlignment(QtCore.Qt.AlignCenter) + self.label_list_view.setAlignment(QtCore.Qt.AlignmentFlag.AlignCenter) self.label_list_view.setObjectName("label_list_view") self.verticalLayout.addWidget(self.label_list_view) - self.scrollArea = QtWidgets.QScrollArea(VacationWindow) - self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame) - self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain) + self.scrollArea = QtWidgets.QScrollArea(parent=VacationWindow) + self.scrollArea.setFrameShape(QtWidgets.QFrame.Shape.NoFrame) + self.scrollArea.setFrameShadow(QtWidgets.QFrame.Shadow.Plain) self.scrollArea.setLineWidth(1) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") @@ -73,12 +71,12 @@ def setupUi(self, VacationWindow): self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.scrollAreaWidgetContents) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setObjectName("verticalLayout_3") - self.list_widget_dates = QtWidgets.QListWidget(self.scrollAreaWidgetContents) + self.list_widget_dates = QtWidgets.QListWidget(parent=self.scrollAreaWidgetContents) font = QtGui.QFont() font.setPointSize(12) self.list_widget_dates.setFont(font) - self.list_widget_dates.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers) - self.list_widget_dates.setSelectionMode(QtWidgets.QAbstractItemView.NoSelection) + self.list_widget_dates.setEditTriggers(QtWidgets.QAbstractItemView.EditTrigger.NoEditTriggers) + self.list_widget_dates.setSelectionMode(QtWidgets.QAbstractItemView.SelectionMode.NoSelection) self.list_widget_dates.setObjectName("list_widget_dates") self.verticalLayout_3.addWidget(self.list_widget_dates) self.scrollArea.setWidget(self.scrollAreaWidgetContents) @@ -104,4 +102,4 @@ def retranslateUi(self, VacationWindow): ui = Ui_VacationWindow() ui.setupUi(VacationWindow) VacationWindow.show() - sys.exit(app.exec_()) + sys.exit(app.exec())