-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmyNoteMenu.py
More file actions
48 lines (38 loc) · 1.44 KB
/
myNoteMenu.py
File metadata and controls
48 lines (38 loc) · 1.44 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
# -*- coding: utf-8 -*-
"""
Module implementing NoteMenu.
"""
from PyQt5.QtCore import pyqtSlot, Qt, pyqtSignal
from PyQt5.QtWidgets import QWidget
from Ui_myNoteMenu import Ui_NoteMenu
class NoteMenu(QWidget, Ui_NoteMenu):
"""
Class documentation goes here.
"""
index_signal = pyqtSignal(int)
def __init__(self, parent=None):
"""
Constructor
@param parent reference to the parent widget (defaults to None)
@type QWidget (optional)
"""
super(NoteMenu, self).__init__(parent)
self.setAttribute(Qt.WA_StyledBackground, True)
self.setupUi(self)
self.radioButton_1.clicked.connect(lambda: self.sendSignal(1))
self.radioButton_2.clicked.connect(lambda: self.sendSignal(2))
self.radioButton_3.clicked.connect(lambda: self.sendSignal(3))
self.radioButton_4.clicked.connect(lambda: self.sendSignal(4))
self.radioButton_5.clicked.connect(lambda: self.sendSignal(5))
self.radioButton_6.clicked.connect(lambda: self.sendSignal(6))
self.radioButton_7.clicked.connect(lambda: self.sendSignal(7))
def sendSignal(self, index):
self.index_signal.emit(index)
# self.hide()
# self.radioButton_1
for i in range(1, 8):
btn = getattr(self, "radioButton_{}".format(i))
if btn.text():
btn.setText(None)
break
self.sender().setText("√")