forked from Nyre221/dolphin-quick-view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample_module.py
47 lines (32 loc) · 1.32 KB
/
example_module.py
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
from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton
import sys
# Adhere to naming conventions: https://visualgit.readthedocs.io/en/latest/pages/naming_convention.html
# Name the module like this: name_viewer.py (all lowercase)
# I chose this way of naming the modules to avoid using a name already in use.
class ClassExample(QWidget):
def __init__(self, parent=None):
super(ClassExample, self).__init__(parent)
# buttons
self.button_1 = QPushButton()
self.button_1.setText("Button 1")
self.button_2 = QPushButton()
self.button_2.setText("Button 2")
# label
self.example_label = QLabel()
self.example_label.setText("Label Text")
# main layout
self.main_layout = QVBoxLayout()
self.main_layout.addWidget(self.example_label)
self.main_layout.addWidget(self.button_1)
self.main_layout.addWidget(self.button_2)
self.setLayout(self.main_layout)
# load_file() is the class method that will be called by quick_view.py
# Use this method to receive the path of the file to show.
def load_file(self,file_path):
pass
if __name__ == '__main__':
app = QApplication(sys.argv)
widget = ClassExample()
widget.resize(640, 480)
widget.show()
sys.exit(app.exec_())