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