-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDeleteNoteDialog.py
More file actions
65 lines (53 loc) · 1.53 KB
/
DeleteNoteDialog.py
File metadata and controls
65 lines (53 loc) · 1.53 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# -*- coding: utf-8 -*-
"""
Module implementing DeleteNote.
"""
from PyQt5.QtCore import pyqtSlot, pyqtSignal, Qt
from PyQt5.QtWidgets import QDialog, QApplication
from Ui_DeleteNoteDialog import Ui_DeleteNote
class DeleteNote(QDialog, Ui_DeleteNote):
"""
Class documentation goes here.
"""
delete_signal = pyqtSignal(int)
def __init__(self, parent=None):
"""
Constructor
@param parent reference to the parent widget (defaults to None)
@type QWidget (optional)
"""
super(DeleteNote, self).__init__(parent)
self.setupUi(self)
# 设置背景透明
self.setAttribute(Qt.WA_TranslucentBackground, True)
# 设置无边框
self.setWindowFlags(self.windowFlags() | Qt.FramelessWindowHint)
# 固定大小
@pyqtSlot()
def on_pushButton_yes_clicked(self):
"""
Slot documentation goes here.
"""
self.delete_signal.emit(1)
self.close()
@pyqtSlot()
def on_pushButton_no_clicked(self):
"""
Slot documentation goes here.
"""
self.delete_signal.emit(0)
self.close()
@pyqtSlot(bool)
def on_checkBox_clicked(self, checked):
"""
Slot documentation goes here.
@param checked DESCRIPTION
@type bool
"""
self.pushButton_no.setDisabled(checked)
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
ui = DeleteNote()
ui.show()
sys.exit(app.exec_())