-
Notifications
You must be signed in to change notification settings - Fork 0
/
untitled5.py
36 lines (28 loc) · 1.04 KB
/
untitled5.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
# -*- coding: utf-8 -*-
"""
Created on Wed Oct 24 13:30:05 2018
@author: Seamfix
"""
from PyQt5 import QtGui, QtCore, QtWidgets, uic
class Window(QtWidgets.QMainWindow):
def __init__(self):
super(Window, self).__init__()
self.ui = uic.loadUi('rent_creation.ui', self)
#the widgets are called calendarWidget_start_date_2 and calendarWidget_end_date_2
self.ui.activate_thescript.clicked.connect(self.activate_script)
self.show()
def activate_script(self):
global start_date
global end_date
start_date = self.ui.calendarWidget_start_date_2.selectedDate().toString()
end_date = self.ui.calendarWidget_end_date_2.selectedDate().toString()
#print data in text browser
text = "Start date: %s \n End date: %s \n" %(start_date, end_date)
self.ui.textBrowser.setText(text)
start_date = QtCore.QDate.currentDate()
end_date = QtCore.QDate.currentDate()
def run():
app = QtWidgets.QApplication(sys.argv)
GUI = Window()
sys.exit(app.exec_())
run()