Beispiel #1
0
class PyDBWin(QtGui.QMainWindow):
	""" Sets up gui and a DBConnection."""

	def __init__(self):
		QtGui.QMainWindow.__init__(self)
		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		
		exitAction = QtGui.QAction('&Exit', self)
		exitAction.setShortcut('Ctrl+Q')
		exitAction.setStatusTip('Exit application')
		exitAction.triggered.connect(QtGui.qApp.quit)
		self.ui.menuFile.addAction(exitAction)
		self.books = BooksIface()
		self.ui.loadBooks.setEnabled(True)
		self.ui.loadBooks.clicked.connect(self.loadBooks)
		self.ui.updateButton.clicked.connect(self.updateBooks)
		
	def updateBooks(self):
		pass
	
	def loadBooks(self):
		if debug:
			print "Books loaded"
		data = self.books.getAll()
		n = 0
		for key in data:
			m = 0
			for item in data[key]:
				self.ui.tableWidget.setItem(n,m,QTableWidgetItem(item))
				m+=1
			n+=1
Beispiel #2
0
class MainWindow(QMainWindow):
    def __init__(self):
        super().__init__()
        self.__ui = Ui_MainWindow()
        self.__ui.setupUi(self)
        self.setFixedSize(800, 370)

        self.__ui.pushButton.clicked.connect(self.open_add)
        self.__ui.pushButton_2.clicked.connect(self.open_search)
        self.__ui.pushButton_3.clicked.connect(self.open_delete)


    @Slot()
    def open_add(self):
        self.add_widget = AddWidget()
        self.add_widget.resize(400, 400)
        self.add_widget.show()

        # self.main_widget = AddWidget()
        # main_widget = self.main_widget
        # main_widget.show()

    @Slot()
    def open_search(self):
        self.search_widget = SearchWidget()
        self.search_widget.resize(400, 400)
        self.search_widget.show()

    @Slot()
    def open_delete(self):
        self.delete_widget = DeleteWidget()
        self.delete_widget.resize(400, 400)
        self.delete_widget.show()
Beispiel #3
0
    def __init__(self):
        super().__init__()
        self.__ui = Ui_MainWindow()
        self.__ui.setupUi(self)
        self.setFixedSize(800, 370)

        self.__ui.pushButton.clicked.connect(self.open_add)
        self.__ui.pushButton_2.clicked.connect(self.open_search)
        self.__ui.pushButton_3.clicked.connect(self.open_delete)
Beispiel #4
0
	def __init__(self):
		QtGui.QMainWindow.__init__(self)
		self.ui = Ui_MainWindow()
		self.ui.setupUi(self)
		
		exitAction = QtGui.QAction('&Exit', self)
		exitAction.setShortcut('Ctrl+Q')
		exitAction.setStatusTip('Exit application')
		exitAction.triggered.connect(QtGui.qApp.quit)
		self.ui.menuFile.addAction(exitAction)
		self.books = BooksIface()
		self.ui.loadBooks.setEnabled(True)
		self.ui.loadBooks.clicked.connect(self.loadBooks)
		self.ui.updateButton.clicked.connect(self.updateBooks)