Skip to content
Snippets Groups Projects
Commit af37ac7b authored by Felix Lammermann's avatar Felix Lammermann
Browse files

Initial commit

parents
Branches
No related tags found
No related merge requests found
Showing
with 147 additions and 0 deletions
.csv 0 → 100644
This diff is collapsed.
%% Cell type:code id: tags:
``` python
import sys
from PyQt5.QtCore import QDate, QTime, QDateTime, Qt
from PyQt5.QtWidgets import QWidget, QToolTip, QPushButton, QApplication, QDesktopWidget, QMainWindow, QAction, qApp
from PyQt5.QtGui import QIcon, QFont
```
%% Cell type:code id: tags:
``` python
now = QDate.currentDate()
print(now.toString(Qt.ISODate))
print(now.toString(Qt.DefaultLocaleLongDate))
datetime = QDateTime.currentDateTime()
print(datetime.toString())
time = QTime.currentTime()
print(time.toString(Qt.DefaultLocaleLongDate))
```
%% Output
2018-05-29
Tuesday, May 29, 2018
Tue May 29 18:23:20 2018
6:23:20 PM CEST
%% Cell type:code id: tags:
``` python
class Hauptfenster(QMainWindow):
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
QToolTip.setFont(QFont('SansSerif', 10))
open = QAction('&Open', self)
open.setStatusTip('open csv-file')
open.setShortcut('Ctrl+O')
save = QAction('&Save', self)
save.setStatusTip('save as csv-file')
save.setShortcut('Ctrl+S')
create = QAction('&Create', self)
create.setStatusTip('create pdf-file')
create.setShortcut('Ctrl+P')
exit = QAction('&Exit', self)
exit.setStatusTip('exit application')
exit.setShortcut('Ctrl+Q')
exit.triggered.connect(qApp.quit)
self.resize(1080, 768)
self.center()
self.setWindowTitle('Arbeitsstundenzettel für Faule')
self.setWindowIcon(QIcon('icon.png'))
self.statusBar().showMessage('Copyright Felix Lammermann, 2018, Version: Alpha-1.00')
menubar = self.menuBar()
fileMenu = menubar.addMenu('&File')
fileMenu.addAction(open)
fileMenu.addAction(save)
fileMenu.addAction(create)
fileMenu.addAction(exit)
self.show()
def center(self):
qr = self.frameGeometry()
cp = QDesktopWidget().availableGeometry().center()
qr.moveCenter(cp)
self.move(qr.topLeft())
if __name__ == '__main__':
app = QApplication(sys.argv)
ex = Hauptfenster()
sys.exit(app.exec_())
```
%% Cell type:code id: tags:
``` python
```
%% Cell type:code id: tags:
``` python
```
This diff is collapsed.
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment