-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBase.py
96 lines (58 loc) · 2.23 KB
/
Base.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
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
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- coding: UTF-8 -*-
'''
Created on 03/05/2014
@author: jotage
'''
from PyQt4.QtGui import *
from PyQt4.QtCore import *
class TextBox(QLineEdit):
def __init__(self, parent = None):
super(TextBox, self).__init__(parent)
class Label(QLabel):
def __init__(self, pText= '', parent = None):
super(Label, self).__init__(parent)
self.setText(pText)
class CheckBox(QCheckBox):
def __init__(self,pText= '', parent = None):
super(CheckBox, self).__init__(parent)
self.setText(pText)
class Botao(QPushButton):
def __init__(self,pText= '', parent = None):
super(Botao, self).__init__(parent)
self.setText(pText)
class LayoutVertical(QVBoxLayout):
def __init__(self):
super(LayoutVertical, self).__init__()
class LayoutHorizontal(QHBoxLayout):
def __init__(self):
super(LayoutHorizontal, self).__init__()
class FormLayout(QFormLayout):
def __init__(self):
super(FormLayout, self).__init__()
class Widget(QWidget):
def __init__(self, parent = None):
super(Widget, self).__init__(parent)
class Diaglog(QDialog):
def __init__(self, parent = None):
super(Diaglog, self).__init__(parent)
class Grid(QTableWidget):
def __init__(self, parent = None , qtde_linhas = 0, qtde_colunas = 0):
super(Grid, self).__init__(parent)
self.setRowCount(qtde_linhas)
self.setColumnCount(qtde_colunas)
#redimenciona a linha automaticamente
self.resizeRowsToContents()
#coloca as linhas em cores alternadas
self.setAlternatingRowColors(True)
#habilita a ordenação ao clicar no titulo da coluna
self.setSortingEnabled(True)
#seleciona toda a linha quando clicado
self.setSelectionBehavior(QAbstractItemView.SelectRows)
class MessageBox(QMessageBox):
def __init__(self, parent = None):
super(MessageBox, self).__init__(parent)
if __name__ == '__main__':
import sys
root = QApplication(sys.argv)
m = MessageBox()
help(m)