-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcoplus_test.py
More file actions
83 lines (64 loc) · 2.05 KB
/
coplus_test.py
File metadata and controls
83 lines (64 loc) · 2.05 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# coding:utf-8
import sys
import datetime
import time
from PyQt5.QtWidgets import QApplication, QWidget, QHBoxLayout, QLabel
from PyQt5 import QtGui
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QTimer
window_x = 1280
window_y = 1024
class test_main:
def __init__(self, s1):
self.timer = QTimer(self)
self.w = QWidget()
self.window_size = [window_x, window_y]
self.use_window_size = [self.window_size[0] + 10, self.window_size[1] + 10]
self.w.resize(self.use_window_size[0], self.use_window_size[1])
self.w.move(-6, 0)
self.w.setWindowTitle("nitacad")
self.now_weather = QLabel(None, self.w)
self.now_weather.setPixmap(QPixmap("./now_weather.gif"))
self.font = QtGui.QFont()
self.font.setFamily("Arial")
self.font.setPointSize(20)
self.hoge = QLabel(None, self.w)
self.hoge.setText(s1)
self.hoge.move(100, 100)
self.hoge.setFont(self.font)
self.i = 0
self.timer.timeout.connect(self.replay())
self.timer.start(5000)
def show(self):
self.w.showMaximized()
def hogehoge(self):
self.i += 1
self.hoge.setText("hogehoge")
self.hoge.move(200, 200)
self.show()
def fugafuga(self):
self.i += 1
self.hoge.setText("fugafuga")
self.hoge.move(400, 400)
self.show()
def replay(self):
if self.i % 2:
self.fugafuga()
else:
self.hogehoge()
def shot(window_name):
window = test_main(window_name)
QTimer(5000, window.show())
if __name__ == "__main__":
app = QApplication(sys.argv)
desktop_size = app.primaryScreen().availableGeometry()
height = desktop_size.height()
width = desktop_size.width()
main = test_main("nyan")
#gui_main = test_main("hoge")
#gui_main.show()
#gui_hoge = test_main("nyan")
#gui_hoge.show()
#gui_main.hogehoge("nyan")
#QTimer.singleShot(5000, lambda hoge=hoge, text="<h1> nyan </h1>": hoge_set(hoge, text))
sys.exit(app.exec_())