本文整理汇总了Python中ui_mainwindow.Ui_MainWindow类的典型用法代码示例。如果您正苦于以下问题:Python Ui_MainWindow类的具体用法?Python Ui_MainWindow怎么用?Python Ui_MainWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Ui_MainWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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.",
)
开发者ID:Magdno1,项目名称:Arianrhod,代码行数:27,代码来源:stylesheet.py
示例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))
开发者ID:mstreatfield,项目名称:bitesofcode,代码行数:30,代码来源:3_comparison_of_loading_techniques_pyuic4.py
示例3: main
def main():
app = QApplication(sys.argv)
window = QDialog()
mainmenu = QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(mainmenu)
mainmenu.show()
sys.exit(app.exec_())
开发者ID:PeterRyder,项目名称:HackRU,代码行数:9,代码来源:GUI_2.0.py
示例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
开发者ID:mwicat,项目名称:batchui,代码行数:11,代码来源:qtutil.py
示例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"))
开发者ID:andreas-koukorinis,项目名称:PySPA,代码行数:11,代码来源:mainwindow.py
示例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'))
开发者ID:zombiecry,项目名称:GameFluid,代码行数:12,代码来源:mainwindow.py
示例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)
开发者ID:mugwort-rc,项目名称:pyJsonViewer,代码行数:48,代码来源:mainwindow.py
示例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)
开发者ID:matteosan1,项目名称:python_code,代码行数:27,代码来源:palio_mainwindow.py
示例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)
开发者ID:clau30,项目名称:rpi-control-gui,代码行数:30,代码来源:main.py
示例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()
开发者ID:AlexDoul,项目名称:PyQt4,代码行数:7,代码来源:lang.py
示例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_)
开发者ID:puwe,项目名称:Semester-Project-FS-2015,代码行数:30,代码来源:main.py
示例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)
开发者ID:victorshch,项目名称:pytrader,代码行数:31,代码来源:mainwindow.py
示例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)
开发者ID:bernschab,项目名称:ricodebug,代码行数:60,代码来源:mainwindow.py
示例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()
开发者ID:agateau,项目名称:qyok,代码行数:29,代码来源:mainwindow.py
示例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)
开发者ID:benbu,项目名称:uvcdat-gui,代码行数:33,代码来源:mainwindow.py
示例16: __init__
def __init__(self, testing=False):
# Initialize object using ui_mainwindow
super(MainWindow, self).__init__()
self.window = QMainWindow()
self.ui = Ui_MainWindow()
self.ui.setupUi(self.window)
self.connectSlots()
self.testing = testing
self.scheduler = Scheduler()
开发者ID:diana134,项目名称:afs,代码行数:9,代码来源:mainwindow-old.py
示例17: __init__
def __init__(self):
super(MainWindow, self).__init__()
# Set up the user interface from Designer.
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.actionVolumetric_Efficiency.triggered.connect(self.openVE)
self.ui.actionSpark_Advance.triggered.connect(self.openSA)
self.currentport = ""
layout = QGridLayout(self.ui.centralwidget)
self.ui.centralwidget.setLayout(layout)
try:
self.vetable = pickle.load(open("tuningve.smv", "rb"))
except FileNotFoundError:
print("No existing tuning found!")
self.vetable = ModelVE()
try:
self.satable = pickle.load(open("tuningsa.smv", "rb"))
except FileNotFoundError:
print("No existing tuning found!")
self.satable = ModelSA()
self.vemodel = TableModel(self.vetable)
self.vewindow = TableWindow("Volumetric Efficiency Table")
self.vewindow.setModel(self.vemodel)
self.samodel = TableModel(self.satable)
self.sawindow = TableWindow("Spark Advance Table")
self.sawindow.setModel(self.samodel)
self.value = 0
self.meters = []
for i in range(0,3):
for k in range(0,2):
spd = Speedometer("testlol", "units", 0, 100)
self.meters.append(spd)
layout.addWidget(spd, k, i)
ports = self.serial_ports()
if len(ports):
self.ui.menuSerial_Port.clear()
self.actiongroup = QActionGroup(self.ui.menuSerial_Port)
for port in ports:
action = QAction(port, self.ui.menuSerial_Port)
action.setCheckable(True)
self.actiongroup.addAction(action)
self.actiongroup.actions()[0].setChecked(True)
self.setSerialPort()
self.ui.menuSerial_Port.addActions(self.actiongroup.actions())
self.actiongroup.triggered.connect(self.setSerialPort)
QTimer.singleShot(20, self.increment)
开发者ID:cpsmv,项目名称:ecu,代码行数:56,代码来源:MainWindow.py
示例18: __init__
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)
开发者ID:PWilsonUofC,项目名称:VGenes,代码行数:10,代码来源:stylesheet.py
示例19: MainWindow
class MainWindow(QWidget):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.resize(1024, 768)
self.mostWatchedItems = MostWatchedItems()
self.ui.tabWidget.addTab(self.mostWatchedItems, 'Most Watched Items')
self.topSellingProducts = TopSellingProducts()
self.ui.tabWidget.addTab(self.topSellingProducts, 'Top Selling Products')
self.popularItems = PopularItems()
self.ui.tabWidget.addTab(self.popularItems, 'Popular Items')
self.popularSearches = PopularSearches()
self.ui.tabWidget.addTab(self.popularSearches, 'Popular Searches')
开发者ID:xlongfeng,项目名称:oceanix,代码行数:19,代码来源:mainwindow.py
示例20: __init__
def __init__(self):
QMainWindow.__init__(self)
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.initBoard()
self.ui.actionJUEGO_NUEVO.triggered.connect(self.onActionJuegoNuevoTriggered)
self.ui.actionSALIR.triggered.connect(self.onActionSalirTriggered)
self.ui.actionATRAS.triggered.connect(self.onActionAtrasTriggered)
self.loadGamesWindow = LoadGames(self)
开发者ID:juanmisak,项目名称:PySudoku,代码行数:11,代码来源:mainwindow.py
注:本文中的ui_mainwindow.Ui_MainWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论