Ejemplo n.º 1
0
    def createMenusAndToolbar(self):
        add = self.mainWindow.operationsMenu.addAction("Adicionar Categoria")
        add.setIcon(Icon("category.png"))
        add.triggered.connect(self.addItem)

        delete = self.mainWindow.operationsMenu.addAction("Excluir Categorias")
        delete.setIcon(Icon("del-cat.png"))
        delete.triggered.connect(self.deleteItems)

        toolbar = QToolBar("Operações de Categoria")
        toolbar.addAction(add)
        toolbar.addAction(delete)
        self.mainWindow.addToolBar(toolbar)
Ejemplo n.º 2
0
    def createMenusAndToolbar(self):
        add = self.mainWindow.operationsMenu.addAction(
            "Adicionar Investimento")
        add.setIcon(Icon("cash.png"))
        add.triggered.connect(self.addItem)

        delete = self.mainWindow.operationsMenu.addAction(
            "Apagar Investimentos")
        delete.setIcon(Icon("del-invest.png"))
        delete.triggered.connect(self.deleteItems)

        toolbar = QToolBar("Operações de Investimentos")
        toolbar.addAction(add)
        toolbar.addAction(delete)
        self.mainWindow.addToolBar(toolbar)
Ejemplo n.º 3
0
    def createLayout(self):
        layout = QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)

        tabs = QTabWidget(self)
        tabs.setMovable(True)

        self.viewTreasure = Tree(2)
        self.viewTreasure.itemDoubleClicked.connect(self.editItem)
        self.viewTreasure.setResizeColumn(1)
        tabs.addTab(self.viewTreasure, "Tesouro Direto")

        self.viewStocks = Tree(4)
        self.viewStocks.itemDoubleClicked.connect(self.editItem)
        self.viewStocks.setResizeColumn(1)
        self.viewStocks.setColumnWidth(1, 40)
        self.viewStocks.setColumnWidth(2, 80)
        self.viewStocks.setColumnWidth(3, 85)
        tabs.addTab(self.viewStocks, "Ações")

        layout.addWidget(tabs)

        subLayout = QHBoxLayout()
        subLayout.setContentsMargins(0, 0, 0, 0)
        self.updateBtn = QPushButton()
        self.updateBtn.setIcon(Icon("refresh.png"))
        self.updateBtn.clicked.connect(self.updateStocks)
        subLayout.addStretch(1)
        subLayout.addWidget(self.updateBtn)
        layout.addLayout(subLayout)

        base = QWidget()
        base.setLayout(layout)
        self.setWidget(base)
Ejemplo n.º 4
0
 def __init__(self, parent, title, iconPath, headers, items):
     super().__init__(parent)
     self.setFixedWidth(400)
     self.setWindowTitle(title)
     self.setWindowIcon(Icon(iconPath))
     self.showMessage = self.parent().mainWindow.showMessage
     self.createLayout(headers, items)
Ejemplo n.º 5
0
    def __init__(self,
                 mainWindow=None,
                 title='',
                 x=0,
                 y=0,
                 width=0,
                 height=0,
                 iconPath=''):
        super(BaseWindow, self).__init__()
        self.setWindowTitle(title)
        screen = QApplication.instance().primaryScreen()
        self.setGeometry(screen.size().width() * x,
                         screen.size().height() * y,
                         screen.size().width() * width,
                         screen.size().height() * height)
        self.setWindowIcon(Icon(iconPath))

        self.mainWindow = mainWindow

        self.action = self.mainWindow.windowsMenu.addAction(title)
        self.action.setCheckable(True)
        self.action.setChecked(True)

        def showOrHide():
            if self.active:
                self.hide()
            else:
                self.show()
            self.active = not self.active

        self.action.triggered.connect(showOrHide)
Ejemplo n.º 6
0
 def __init__(self, parent=None):
     super(AddTransfer, self).__init__(parent)
     self.setFixedWidth(300)
     self.setWindowTitle("Adicionar Transferência")
     self.setWindowIcon(Icon('transfer.png'))
     self.statusBar = self.parent().mainWindow.statusBar()
     self.createLayout()
Ejemplo n.º 7
0
 def __init__(self, parent=None, title='', item=None):
     super(AddTransDialog, self).__init__(parent)
     self.setFixedWidth(300)
     self.setWindowTitle(title)
     self.setWindowIcon(Icon('money.png'))
     self.showMessage = self.parent().mainWindow.showMessage
     self.createLayout(item)
Ejemplo n.º 8
0
 def __init__(self, parent=None, title='', item=None):
     super(AddInvestiments, self).__init__(parent)
     self.setFixedWidth(300)
     self.setWindowTitle(title)
     self.setWindowIcon(Icon("cash.png"))
     self.showMessage = self.parent().mainWindow.showMessage
     self.createLayout(item)
Ejemplo n.º 9
0
    def createMenusAndToolbar(self):
        add = self.mainWindow.operationsMenu.addAction("Adicionar Conta")
        add.setIcon(Icon("bank.png"))
        add.triggered.connect(self.addItem)

        invoice = self.mainWindow.operationsMenu.addAction(
            "Ver Fatura/Extrato")
        invoice.setIcon(Icon("fatura.png"))
        invoice.triggered.connect(self.showInvoice)

        delete = self.mainWindow.operationsMenu.addAction("Excluir Contas")
        delete.setIcon(Icon("del-inst.png"))
        delete.triggered.connect(self.deleteItems)

        toolbar = QToolBar("Operações de Conta")
        toolbar.addAction(add)
        toolbar.addAction(invoice)
        toolbar.addAction(delete)
        self.mainWindow.addToolBar(toolbar)
Ejemplo n.º 10
0
    def createMenusAndToolbar(self):
        add = self.mainWindow.operationsMenu.addAction("Adicionar Transação")
        add.setIcon(Icon("money.png"))
        add.triggered.connect(self.addTransaction)

        addTransfer = self.mainWindow.operationsMenu.addAction(
            "Adicionar Transferência")
        addTransfer.setIcon(Icon("transfer.png"))
        addTransfer.triggered.connect(self.addTransfer)

        delete = self.mainWindow.operationsMenu.addAction("Apagar Transações")
        delete.setIcon(Icon("del-trans.png"))
        delete.triggered.connect(self.deleteItems)

        toolbar = QToolBar("Operações de Transação")
        toolbar.addAction(add)
        toolbar.addAction(addTransfer)
        toolbar.addAction(delete)
        self.mainWindow.addToolBar(toolbar)
Ejemplo n.º 11
0
    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.setWindowTitle("De$compliconta$")
        self.setWindowIcon(Icon("main-icon.png"))

        self.area = QMdiArea()
        self.area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        self.area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
        self.setCentralWidget(self.area)

        DATABASE.showInfo()

        self.createMenus()
        self.createWindows()

        self.loadInfo()
        self.showMaximized()
        self.showMessage("Iniciado")
Ejemplo n.º 12
0
 def __init__(self, parent=None, treeItem=None):
     super().__init__(parent)
     self.setIcon(Icon('delete.png'))
     self.treeItem = treeItem
Ejemplo n.º 13
0
    def __init__(self, parent=None):
        super().__init__(parent)
        self.setFixedSize(600, 650)
        self.setWindowTitle("Ver Fatura\Extrato: ")
        self.setWindowIcon(Icon('fatura.png'))

        layout = QFormLayout()
        self.account = QComboBox()
        accounts = DATABASE.getAccounts()
        for account in accounts:
            self.account.addItem(account)
        self.account.activated.connect(self.attPeriod)
        layout.addRow("Conta", self.account)

        self.period1 = QDateEdit()
        self.period1.setCalendarPopup(True)
        label = QLabel(" a ")
        label.setAlignment(Qt.AlignCenter)
        self.period2 = QDateEdit()
        self.period2.setCalendarPopup(True)
        dateLayout = QHBoxLayout()
        dateLayout.addWidget(self.period1, 1)
        dateLayout.addWidget(label)
        dateLayout.addWidget(self.period2, 1)
        layout.addRow("Periodo", dateLayout)

        infoBox = QHBoxLayout()
        infos = QFormLayout()
        self.accountView = QLabel()
        self.totalValue = QLabel()
        self.date1 = QLabel()
        label2 = QLabel(" a ")
        label2.setAlignment(Qt.AlignCenter)
        self.date2 = QLabel()
        dateLayout2 = QHBoxLayout()
        dateLayout2.addWidget(self.date1, 1)
        dateLayout2.addWidget(label2)
        dateLayout2.addWidget(self.date2, 1)
        infos.addRow("Conta", self.accountView)
        infos.addRow("Período ", dateLayout2)
        infos.addRow("Total", self.totalValue)
        infoBox.addLayout(infos)

        left = QToolButton()
        left.setArrowType(Qt.LeftArrow)
        left.clicked.connect(self.previousMonth)
        right = QToolButton()
        right.setArrowType(Qt.RightArrow)
        right.clicked.connect(self.nextMonth)
        infoBox.addWidget(left)
        infoBox.addWidget(right)
        infoBox.addStretch(1)
        layout.addRow(infoBox)

        self.table = Tree(4)
        self.table.setHeaderLabels(['Data', 'Descrição', 'Categoria', 'Valor'])
        self.table.setResizeColumn(2)
        self.table.itemDoubleClicked.connect(self.editItem)
        self.table.itemClicked.connect(self.alterSum)
        layout.addRow(self.table)

        self.attPeriod(0)
        self.period1.dateChanged.connect(self.showTable)
        self.period2.dateChanged.connect(self.showTable)
        self.setLayout(layout)