hi List,<br>I tried to execute the following python code in scribus but it shows the error <br><br>QCoreApplication::exec: The event loop is already running<br>Scribus Crash<br>-------------<br>Scribus crashes due to Signal #11<br>
QWidget: Must construct a QApplication before a QPaintDevice<br><br>code works well simply in python.<br><br>following is the python code i tried. can any one help me?<br><br>from PyQt4 import QtCore, QtGui<br><br>try:<br>
_fromUtf8 = QtCore.QString.fromUtf8<br>except AttributeError:<br> _fromUtf8 = lambda s: s<br><br>class Ui_SelectPage(object):<br> def setupUi(self, SelectPage):<br> SelectPage.setObjectName(_fromUtf8("SelectPage"))<br>
SelectPage.resize(382, 325)<br> self.centralwidget = QtGui.QWidget(SelectPage)<br> self.centralwidget.setObjectName(_fromUtf8("centralwidget"))<br> self.lineEdit = QtGui.QLineEdit(self.centralwidget)<br>
self.lineEdit.setGeometry(QtCore.QRect(190, 50, 113, 29))<br> self.lineEdit.setObjectName(_fromUtf8("lineEdit"))<br> self.label = QtGui.QLabel(self.centralwidget)<br> self.label.setGeometry(QtCore.QRect(90, 60, 55, 19))<br>
self.label.setObjectName(_fromUtf8("label"))<br> self.comboBox = QtGui.QComboBox(self.centralwidget)<br> self.comboBox.setGeometry(QtCore.QRect(190, 100, 111, 29))<br> self.comboBox.setObjectName(_fromUtf8("comboBox"))<br>
self.comboBox.addItem(_fromUtf8(""))<br> self.label_2 = QtGui.QLabel(self.centralwidget)<br> self.label_2.setGeometry(QtCore.QRect(90, 110, 71, 19))<br> self.label_2.setObjectName(_fromUtf8("label_2"))<br>
self.label_3 = QtGui.QLabel(self.centralwidget)<br> self.label_3.setGeometry(QtCore.QRect(90, 160, 55, 19))<br> self.label_3.setObjectName(_fromUtf8("label_3"))<br> self.dateEdit = QtGui.QDateEdit(self.centralwidget)<br>
self.dateEdit.setGeometry(QtCore.QRect(190, 150, 110, 29))<br> self.dateEdit.setObjectName(_fromUtf8("dateEdit"))<br> self.pushButton = QtGui.QPushButton(self.centralwidget)<br> self.pushButton.setGeometry(QtCore.QRect(100, 230, 85, 29))<br>
self.pushButton.setObjectName(_fromUtf8("pushButton"))<br> self.pushButton_2 = QtGui.QPushButton(self.centralwidget)<br> self.pushButton_2.setGeometry(QtCore.QRect(220, 230, 85, 29))<br> self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))<br>
SelectPage.setCentralWidget(self.centralwidget)<br> self.statusbar = QtGui.QStatusBar(SelectPage)<br> self.statusbar.setObjectName(_fromUtf8("statusbar"))<br> SelectPage.setStatusBar(self.statusbar)<br>
<br> self.retranslateUi(SelectPage)<br> QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.lineEdit.selectAll)<br> QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.lineEdit.copy)<br>
QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), self.dateEdit.selectAll)<br> QtCore.QMetaObject.connectSlotsByName(SelectPage)<br><br> def retranslateUi(self, SelectPage):<br>
SelectPage.setWindowTitle(QtGui.QApplication.translate("SelectPage", "MainWindow", None, QtGui.QApplication.UnicodeUTF8))<br> self.label.setText(QtGui.QApplication.translate("SelectPage", "Page No", None, QtGui.QApplication.UnicodeUTF8))<br>
self.comboBox.setItemText(0, QtGui.QApplication.translate("SelectPage", "Select Publication", None, QtGui.QApplication.UnicodeUTF8))<br> self.label_2.setText(QtGui.QApplication.translate("SelectPage", "Publication", None, QtGui.QApplication.UnicodeUTF8))<br>
self.label_3.setText(QtGui.QApplication.translate("SelectPage", "Date", None, QtGui.QApplication.UnicodeUTF8))<br> self.pushButton.setText(QtGui.QApplication.translate("SelectPage", "Fetch", None, QtGui.QApplication.UnicodeUTF8))<br>
self.pushButton_2.setText(QtGui.QApplication.translate("SelectPage", "Cancel", None, QtGui.QApplication.UnicodeUTF8))<br><br><br>if __name__ == "__main__":<br> import sys<br> app = QtGui.QApplication(sys.argv)<br>
SelectPage = QtGui.QMainWindow()<br> ui = Ui_SelectPage()<br> ui.setupUi(SelectPage)<br> SelectPage.show()<br> sys.exit(app.exec_())<br><br clear="all"><br>-- <br>with warm regards<br>Sivahari Nandakumar<br>
Appropriate Technology Promotion Society<br>Eroor, Vyttila 09446582917<br><a href="http://sivaharicec.blogspot.com" target="_blank">http://sivaharicec.blogspot.com</a><br>--------------------------------------------------------<br>
fighting for knowledge freedom<br>