本文整理汇总了Python中ui_mainwindow.Ui_MainWindow类的典型用法代码示例。如果您正苦于以下问题:Python Ui_MainWindow类的具体用法?Python Ui_MainWindow怎么用?Python Ui_MainWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ui_MainWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: MainWindow
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.nameLabel.setProperty("class", "mandatory QLabel")
self.styleSheetEditor = StyleSheetEditor(self)
self.statusBar().addWidget(QLabel("Ready"))
self.ui.exitAction.triggered.connect(QApplication.instance().quit)
self.ui.aboutQtAction.triggered.connect(QApplication.instance().aboutQt)
def on_editStyleAction_triggered(self):
self.styleSheetEditor.show()
self.styleSheetEditor.activateWindow()
def on_aboutAction_triggered(self):
QMessageBox.about(
self,
"About Style sheet",
"The <b>Style Sheet</b> example shows how widgets can be "
"styled using "
'<a href="http://doc.qt.digia.com/4.5/stylesheet.html">Qt '
"Style Sheets</a>. Click <b>File|Edit Style Sheet</b> to pop "
"up the style editor, and either choose an existing style "
"sheet or design your own.",
)
示例2: MainWindow
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
# Load the ui.
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
# Assign the actions.
self.ui.ui_exec_btn.setDefaultAction(self.ui.ui_exec_act)
self.ui.ui_show_btn.setDefaultAction(self.ui.ui_show_act)
self.ui.ui_count_btn.setDefaultAction(self.ui.ui_count_act)
# Create the connections.
self.ui.ui_exec_act.triggered.connect(self.execDialog)
self.ui.ui_show_act.triggered.connect(self.showDialog)
self.ui.ui_count_act.triggered.connect(self.showCount)
def execDialog(self):
dlg = SampleDialog(self)
dlg.exec_()
def showDialog(self):
dlg = SampleDialog(self)
dlg.setAttribute(QtCore.Qt.WA_DeleteOnClose)
dlg.show()
def showCount(self):
count = len(self.findChildren(QtGui.QDialog))
QtGui.QMessageBox.information(self, "Dialog Count", str(count))
示例3: main
def main():
app = QApplication(sys.argv)
window = QDialog()
mainmenu = QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(mainmenu)
mainmenu.show()
sys.exit(app.exec_())
示例4: setupUi
def setupUi(window):
pkg_path = os.path.dirname(__file__)
mainwindow_file = os.path.join(pkg_path, 'mainwindow.ui')
if os.path.exists(mainwindow_file):
from PyQt4 import uic
ui = uic.loadUi(mainwindow_file, window)
else:
from ui_mainwindow import Ui_MainWindow
ui = Ui_MainWindow()
ui.setupUi(window)
return ui
示例5: setupUi
def setupUi(self, MainWindowBase):
"""setup the window.
First, the method of the base class is called, and then all the
functionality is installed (signal/slot connections mainly).
"""
Ui_MainWindow.setupUi(self, MainWindowBase)
self.widget = MainWindowBase
QObject.connect(self.actionAbout, SIGNAL("triggered()"), self.openAbout)
QObject.connect(self.actionFileOpen, SIGNAL("triggered()"), self.openFile)
self.statusBar().showMessage(self.tr("Ready"))
示例6: MainWindow
class MainWindow(QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.gl_widget = GLWidget()
self.ui.gl_layout.addWidget(self.gl_widget)
#singal slot connect
# self.connect(self.ui.apk1_open, SIGNAL('clicked()'),self.apk1_open_onclicked)
# @pyqtSlot()
# def apk1_open_onclicked(self):
# self.emit(SIGNAL('open_apk1'))
示例7: MainWindow
class MainWindow(QtWidgets.QMainWindow):
def __init__(self, parent=None):
super().__init__(parent)
# UI initialize
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.initModels()
self.initProgress()
self.connectProgress(self.jsonModel)
def initModels(self):
self.jsonModel = JsonTreeModel(self)
self.ui.treeView.setModel(self.jsonModel)
def initProgress(self):
self.progress = QtWidgets.QProgressBar(self.ui.statusbar)
self.progress.setVisible(False)
def connectProgress(self, obj):
obj.startProgress.connect(self.progress.setRange)
obj.startProgress.connect(self.startProgress)
obj.updateProgress.connect(self.progress.setValue)
obj.finishProgress.connect(self.finishProgress)
@QtCore.pyqtSlot()
def startProgress(self):
self.progress.setValue(0)
self.progress.setVisible(True)
@QtCore.pyqtSlot()
def finishProgress(self):
self.progress.setVisible(False)
@QtCore.pyqtSlot()
def on_actionOpen_triggered(self):
filepath, ext_filter = QtWidgets.QFileDialog.getOpenFileName(self,
'',
'.',
self.tr('Json (*.json)')
)
if not filepath:
return
with BusyCursor(self):
data = json.load(open(str(filepath)))
self.jsonModel.setJsonDocument(data)
示例8: __init__
def __init__(self, db):
QtGui.QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ind_product = []
self.ui.setupUi(self)
self.db = db
self.cur = db.cursor()
self.r = []
self.indice = int()
self.vittoria = ()
self.comparsa = ()
self.mossa = ()
self.queryPalio()
self.graphicScene = QtGui.QGraphicsScene()
self.graphicsView = QtGui.QGraphicsView(self.graphicScene, self.ui.tabPalio)
self.graphicsView.setGeometry(QtCore.QRect(710, 10, 120, 380))
self.graphicsView.setObjectName("graphicsView")
self.graphicsView.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.graphicsView.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
#QtCore.QObject.connect(self.ui.actionModifica, QtCore.SIGNAL('triggered()'), self.sceltaPalio)
QtCore.QObject.connect(self.ui.tableWidget, QtCore.SIGNAL('cellChanged(int, int)'), self.newTableLine)
#QtCore.QObject.connect(self.ui.lineEdit_12, QtCore.SIGNAL('editingFinished()'), self.queryPalio)
QtCore.QObject.connect(self.ui.comboBox_5, QtCore.SIGNAL('currentIndexChanged(int)'), self.sceltaPalio)
QtCore.QObject.connect(self.ui.buttonAggiorna, QtCore.SIGNAL('pressed()'), self.aggiorna)
QtCore.QObject.connect(self.ui.buttonNuovo, QtCore.SIGNAL('pressed()'), self.nuovoPalio)
QtCore.QObject.connect(self.ui.aggiungiMonturato, QtCore.SIGNAL('pressed()'), self.nuovoMonturato)
QtCore.QObject.connect(self.ui.eliminaMonturato, QtCore.SIGNAL('pressed()'), self.togliMonturato)
示例9: __init__
def __init__(self, parent=None):
super(MainWidget, self).__init__(parent)
#uic.loadUi(os.path.dirname(os.path.realpath(__file__))+'/mainwindow.ui', self)
# Set up the user interface from Designer.
self.ui = Ui_MainWindow()
self.ui.pageUsers = pageUsers(self)
self.ui.setupUi(self)
self.ui.stackedWidget.setCurrentIndex(0)
# connect signals to slots
self.connect(self.ui.buttonBack, QtCore.SIGNAL("clicked(bool)"), self.switchToMain)
# main
self.connect(self.ui.buttonDrinks, QtCore.SIGNAL("clicked(bool)"), self.switchToUsers)
# radio
# users
#self.connect(self.ui.buttonUser1, QtCore.SIGNAL("clicked(bool)"), self.handleUser1)
# drinks
self.connect(self.ui.buttonPay, QtCore.SIGNAL("clicked(bool)"), self.switchToPayment)
# payment
self.connect(self.ui.buttonNum0, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad0)
self.connect(self.ui.buttonNum1, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad1)
self.connect(self.ui.buttonNum2, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad2)
self.connect(self.ui.buttonNum3, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad3)
self.connect(self.ui.buttonNum4, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad4)
self.connect(self.ui.buttonNum5, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad5)
self.connect(self.ui.buttonNum6, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad6)
self.connect(self.ui.buttonNum7, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad7)
self.connect(self.ui.buttonNum8, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad8)
self.connect(self.ui.buttonNum9, QtCore.SIGNAL("clicked(bool)"), self.paymentNumPad9)
self.connect(self.ui.buttonNumDel, QtCore.SIGNAL("clicked(bool)"), self.paymentNumDel)
示例10: __init__
def __init__(self, parent = None, flags = 0):
super(MainWindow, self).__init__(parent, QtCore.Qt.WindowFlags(flags))
self.languages = QtGui.QMenu()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.fillLanguages()
self.retranslate()
示例11: __init__
def __init__(self,parent=None):
super(MainWindow,self).__init__(parent)
self.ui = Ui_MainWindow(self)
self.ui.setupUi(self)
self.boundsbox = BoundsBox(self)
self.boundsbox.hide()
self.data = {} #data
self.fn = None #filename
self.xdata = None #temperature
self.ydata = None #strainrate
self.zdata = None #strain
self.kdata = None #stress
self.model = None #model
self.fc = None #flowcurve
self.params = None #parameters
self.ue = None #uniform elongation
self.yl = None #yieldloci
self.criterion = None #yieldcriterion
self.ui.actionOpen.triggered.connect(self.openfile)
self.ui.action.triggered.connect(self.about)
self.connect(self.ui.actionExit,QtCore.SIGNAL('triggered()'),
QtCore.SLOT('close()'))
self.ui.pushButton_FC.clicked.connect(self.on_pushButton_FC_clicked_)
self.ui.pushButton_YL.clicked.connect(self.on_pushButton_YL_clicked_)
示例12: __init__
def __init__(self, exchangeName):
QtGui.QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.setWindowTitle("PyArbitrageTrader - " + exchangeName)
self.maxProfit = Decimal("-1")
self.model = QtGui.QStandardItemModel()
self.model.setHorizontalHeaderLabels(
[
"Time",
"TradeDirection",
"Ask1",
"Ask1 amount",
"Bid1",
"Bid1 amount",
"Ask2",
"Ask2 amount",
"Bid2",
"Bid2 amount",
"Ask3",
"Ask3 amount",
"Bid3",
"Bid3 amount",
"ProfitPercent",
"USD profit",
]
)
self.ui.tableView_history.setModel(self.model)
示例13: __init__
def __init__(self, parent=None):
""" init UI """
QMainWindow.__init__(self, parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.actionSaveSession.setEnabled(False)
self.distributedObjects = DistributedObjects()
self.act = self.distributedObjects.actions
self.debugController = self.distributedObjects.debugController
self.settings = self.debugController.settings
self.signalproxy = self.distributedObjects.signalProxy
self.pluginloader = PluginLoader(self.distributedObjects)
self.editorController = self.distributedObjects.editorController
self.act = self.distributedObjects.actions
# init RecentFileHandler
self.recentFileHandler = RecentFileHandler(self, self.ui.menuRecentlyUsedFiles, self.distributedObjects)
self.debugController.executableOpened.connect(self.recentFileHandler.addToRecentFiles)
self.debugController.executableOpened.connect(self.__observeWorkingBinary)
self.debugController.executableOpened.connect(self.showExecutableName)
self.debugController.executableOpened.connect(self.disableButtons)
# signal proxy
self.signalproxy.inferiorIsRunning.connect(self.targetStartedRunning, Qt.QueuedConnection)
self.signalproxy.inferiorStoppedNormally.connect(self.targetStopped, Qt.QueuedConnection)
self.signalproxy.inferiorReceivedSignal.connect(self.targetStopped, Qt.QueuedConnection)
self.signalproxy.inferiorHasExited.connect(self.targetExited, Qt.QueuedConnection)
self.signalproxy.addDockWidget.connect(self.addPluginDockWidget)
self.signalproxy.removeDockWidget.connect(self.removeDockWidget)
# Plugin Loader
self.pluginloader.insertPluginAction.connect(self.addPluginAction)
self.ui.actionSavePlugins.triggered.connect(self.showSavePluginsDialog)
self.ui.actionLoadPlugins.triggered.connect(self.showLoadPluginsDialog)
# Add editor to main window.
self.ui.gridLayout.addWidget(self.distributedObjects.editorController.editor_view, 0, 0, 1, 1)
self.pluginloader.addAvailablePlugins()
# Tell everyone to insert their dock widgets into the main window
self.signalproxy.emitInsertDockWidgets()
# get filelist dockwidget
self.filelist_dockwidget = self.findChild(QDockWidget, "FileListView")
self.setWindowFilePath("<none>")
self.setupUi()
self.createInitialWindowPlacement()
self.readSettings()
self.quickwatch = QuickWatch(self, self.distributedObjects)
self.binaryName = None
self.fileWatcher = QFileSystemWatcher()
self.fileWatcher.fileChanged.connect(self.__binaryChanged)
示例14: __init__
def __init__(self):
super(MainWindow, self).__init__()
self.dataDir = os.path.dirname(__file__)
self.setupQueryList()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.centralWidget().layout().setMargin(0)
self.setupQueryListWidget()
self.setupFilter()
self.setupActions()
self.setupJinjaEnv()
self.setupFilterWidgets()
for obj, signal in [
(self.ui.fromDateEdit, "dateChanged(QDate)"),
(self.ui.toDateEdit, "dateChanged(QDate)"),
(self.filterLineEdit, "textEdited(QString)"),
]:
QObject.connect(obj, SIGNAL(signal), self.updateQuery)
QObject.connect(self.ui.queryListWidget, SIGNAL("itemSelectionChanged()"), self.onCurrentQueryChanged)
QObject.connect(self.ui.webView, SIGNAL("linkClicked(const QUrl&)"), self.openUrl)
self.updateFilterWidgets()
self.updateQuery()
示例15: __init__
def __init__(self, parent=None,customPath=None,styles=None):
super(UVCDATMainWindow, self).__init__(parent)
self.root=self
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.setDocumentMode(True)
#init user options
self.initCustomize(customPath,styles)
self.root = self
#self.tool_bar = mainToolbarWidget.QMainToolBarContainer(self)
self.canvas=[]
self.canvas.append(vcs.init())
self.colormapEditor =QColormapEditor(self)
# Create the command recorder widget
self.recorder = commandsRecorderWidget.QCommandsRecorderWidget(self)
#Adds a shortcut to the record function
self.record = self.recorder.record
self.preferences = preferencesWidget.QPreferencesDialog(self)
self.preferences.hide()
self.cdmsCacheWidget = CdmsCacheWidget(self)
# self.regridding = regriddingWidget.QRegriddingDialog(self)
# self.regridding.hide()
###########################################################
# Init Menu Widget
###########################################################
self.mainMenu = mainMenuWidget.QMenuWidget(self)
self.createDockWindows()
self.createActions()
self.updateMenuActions()
self.embedSpreadsheet()
self.connectSignals()
self.resize(1150,800)