import sys
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import *
from PyQt4.QtCore import pyqtSlot
from Source.partCount import refreshCountTable, PartCountEditorDialog
from Resources.CountScreenEditorDialog import Ui_PartCountEditDialog
class PartCountEditorDialog
(QDialog, Ui_PartCountEditDialog
): def __init__(self):
self.setupUi(self)
# self.ui = Ui_PartCountEditDialog
@pyqtSlot()
def showPartDescription(self):
part = self.pcePartNoEditor.text()
print(part)
partDesc = 'A Part'
self.pcePartDescription.setText(partDesc)
self.repaint()
pass
def __init__(self):
super(Example, self).__init__()
self.initUI()
def initUI(self):
qbtn.clicked.connect(lambda: self.launchPcDialog())
qbtn.resize(qbtn.sizeHint())
qbtn.move(50, 50)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Dialog Test')
self.show()
@pyqtSlot()
def launchPcDialog(self):
PartCountEditor = PartCountEditorDialog() # Create an edit dialog
pcUi = Ui_PartCountEditDialog()
pcUi.setupUi(PartCountEditor)
pcUi.pceDeleteWarning.hide() # This is not a delete so hide the delete message
result = PartCountEditor.exec_() # Launch the Part Count Edit Dialog. result = 0 for Cancel, 1 for Save
#
# MAIN WINDOW
#
# sub class MainWindow
class Main():
ex = Example()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
#
# def __init__(self):
# QtGui.QMainWindow.__init__(self)
# self.ui = Ui_MainWindow()
# self.ui.setupUi(self)
#
#
#
# app = QtGui.QApplication(sys.argv)
#
# MainWindow = Main()
#
# MainWindow.show()
#
# sys.exit(app.exec_())
import sys
from PyQt4 import QtCore, QtGui
from PyQt4.QtGui import *
from PyQt4.QtCore import pyqtSlot
from Source.partCount import refreshCountTable, PartCountEditorDialog
from Resources.CountScreenEditorDialog import Ui_PartCountEditDialog
class PartCountEditorDialog(QDialog, Ui_PartCountEditDialog):
def __init__(self):
QDialog.__init__((self))
self.setupUi(self)
# self.ui = Ui_PartCountEditDialog
@pyqtSlot()
def showPartDescription(self):
part = self.pcePartNoEditor.text()
print(part)
partDesc = 'A Part'
self.pcePartDescription.setText(partDesc)
self.repaint()
pass
class Example(QtGui.QWidget):
def __init__(self):
super(Example, self).__init__()
self.initUI()
def initUI(self):
qbtn = QtGui.QPushButton('Enter Count', self)
qbtn.clicked.connect(lambda: self.launchPcDialog())
qbtn.resize(qbtn.sizeHint())
qbtn.move(50, 50)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('Dialog Test')
self.show()
@pyqtSlot()
def launchPcDialog(self):
PartCountEditor = PartCountEditorDialog() # Create an edit dialog
pcUi = Ui_PartCountEditDialog()
pcUi.setupUi(PartCountEditor)
pcUi.pceDeleteWarning.hide() # This is not a delete so hide the delete message
result = PartCountEditor.exec_() # Launch the Part Count Edit Dialog. result = 0 for Cancel, 1 for Save
#
# MAIN WINDOW
#
# sub class MainWindow
class Main():
app = QtGui.QApplication(sys.argv)
ex = Example()
sys.exit(app.exec_())
if __name__ == '__main__':
main()
#
# def __init__(self):
# QtGui.QMainWindow.__init__(self)
# self.ui = Ui_MainWindow()
# self.ui.setupUi(self)
#
#
#
# app = QtGui.QApplication(sys.argv)
#
# MainWindow = Main()
#
# MainWindow.show()
#
# sys.exit(app.exec_())
To copy to clipboard, switch view to plain text mode
Bookmarks