pyuic

Why is PyQt executing my actions three times?

こ雲淡風輕ζ 提交于 2019-12-03 15:49:20
I'm still kind of new to PyQt but I really have no idea why this is happening. I have a Mainwindow that I create like this: class MainWindow(QtGui.QMainWindow): #initialize def __init__(self): #Call parent constructor super(MainWindow, self).__init__() #Load the interface self.ui = uic.loadUi(r"Form Files/rsleditor.ui") #Show the ui self.ui.show() and when I wanted to override the close event with: def closeEvent(self, event): quit_msg = "Are you sure you want to exit the program?" reply = QtGui.QMessageBox.question(self, 'Message', quit_msg, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) if

'Pyuic4' is not recognized as an internal external command

拜拜、爱过 提交于 2019-12-01 15:52:51
问题 Im trying to compile a ui file by using Pyuic, but i can't get it to work... Every time i try using the command pyuic4 -o OutFile_ui.py InFile.ui it just givet me this error C:\Windows\system32>pyuic4 'pyuic4' is not recognized as an internal or external command, operable program or batch file. I actually dont't know where the pyuic file should be located, should PyQt, be located within the Python files or something? Please Help 回答1: When you install PyQt , it gets install under Python's site

How to create new PyQt4 windows from an existing window?

為{幸葍}努か 提交于 2019-11-30 05:22:46
I've been trying to call a new window from an existing one using python3 and Qt4. I've created two windows using Qt Designer (the main application and another one), and I've converted the .ui files generated by Qt Designer into .py scripts - but I can't seem to create new windows from the main application. I tried doing this: ############### MAIN APPLICATION SCRIPT ################ from PyQt4 import QtCore, QtGui import v2 try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError: _fromUtf8 = lambda s: s class Ui_Form(object): def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form"))

How to create new PyQt4 windows from an existing window?

杀马特。学长 韩版系。学妹 提交于 2019-11-29 03:42:38
问题 I've been trying to call a new window from an existing one using python3 and Qt4. I've created two windows using Qt Designer (the main application and another one), and I've converted the .ui files generated by Qt Designer into .py scripts - but I can't seem to create new windows from the main application. I tried doing this: ############### MAIN APPLICATION SCRIPT ################ from PyQt4 import QtCore, QtGui import v2 try: _fromUtf8 = QtCore.QString.fromUtf8 except AttributeError:

Change QLabel text dynamically in PyQt4

点点圈 提交于 2019-11-26 21:02:53
问题 My question is: how can I change the text in a label? The label is inside a layout, but setText() does not seem to work - maybe I am not doing it right. Here is my code: this is the Main windows GUI, the one Qt-Designer gives: class Ui_dashboard(QtGui.QMainWindow): def setupUi(self, dashboard): dashboard.setObjectName(_fromUtf8("dashboard")) dashboard.resize(734, 703) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8("../../../../Documents and Settings/cgarcia/Escritorio/metromara -