-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview.py
More file actions
32 lines (27 loc) · 1.16 KB
/
view.py
File metadata and controls
32 lines (27 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from PyQt6 import QtWidgets
from PyQt6 import uic
from PyQt6.QtCore import Qt
from PyQt6.QtCore import Qt,QPoint, QTimer
from PyQt6.QtWidgets import QMessageBox, QTableWidget, QTableWidgetItem
import os
import json
from pathlib import Path
from PyQt6.QtGui import QIcon
from PyQt6.QtCore import QSize
class mainNote(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
uic.loadUi("main.ui", self)
self.setFixedSize(800, 800)
self.setWindowFlag(Qt.WindowType.FramelessWindowHint |Qt.WindowType.MSWindowsFixedSizeDialogHint)
self.setAttribute(Qt.WidgetAttribute.WA_TranslucentBackground)
self.dragPos = None
def mousePressEvent(self, event):
if event.button() == Qt.MouseButton.LeftButton:
self.dragPos = event.globalPosition().toPoint()
event.accept()
def mouseMoveEvent(self, event):
if event.buttons() == Qt.MouseButton.LeftButton and self.dragPos:
self.move(self.pos() + event.globalPosition().toPoint() - self.dragPos)
self.dragPos = event.globalPosition().toPoint()
event.accept()