def createUI(self, n, connector = None, parent = None, name = None): if not ".ui" in n: n = n +".ui" form_path = parent.prj.path(n) qt3ui.loadUi(form_path, parent.widget)
def createUI(self, n, connector=None, parent=None, name=None): if ".ui" not in n: n += ".ui" form_path = parent.prj.path(n) if form_path is None: raise AttributeError("File %r not found in project" % n) qt3ui.loadUi(form_path, parent.widget)
def load(self): if self.loaded: return print("Loading (record) form %s . . . " % self.action.formrecord) self.script = None self.iface = None try: script = self.action.scriptformrecord or None except AttributeError: script = None self.load_script(script) self.resize(550,350) self.layout.insertWidget(0,self.widget) if self.action.form: form_path = self.prj.path(self.action.formrecord+".ui") qt3ui.loadUi(form_path, self.widget) self.loaded = True
def createUI(self, n, connector=None, parent=None, name=None): if ".ui" not in n: n += ".ui" if getattr(parent, "prj", None) is None: form_path = self._prj.path(n) else: form_path = parent.prj.path(n) if form_path is None: raise AttributeError("File %r not found in project" % n) return if getattr(parent, "widget", None) is None: w_ = parent else: w_ = parent.widget qt3ui.loadUi(form_path, w_) return w_
def load(self): if self.loaded: return print "Loading form %s . . . " % self.action.form self.script = None self.iface = None try: script = self.action.scriptform or None except AttributeError: script = None if script: self.load_script(script) else: print "WARN: Ingored script for form %s." % self.action.form self.widget = QtGui.QWidget() self.resize(550,350) self.layout.insertWidget(0,self.widget) if self.action.form: form_path = self.prj.path(self.action.form+".ui") qt3ui.loadUi(form_path, self.widget) self.loaded = True
def __init__(self, parent=None, name=0, embedInParent=False, rptEngine=0): pParam = 0 if parent and embedInParent else 0 pParam = pParam | Qt.WindowMaximizeButtonHint | Qt.WindowTitleHint pParam = pParam | 0 | Qt.Dialog | Qt.WindowModal pParam = pParam | Qt.WindowSystemMenuHint super(FLReportViewer, self).__init__(parent, pParam) self.loop_ = False self.reportPrinted_ = False self.rptViewer_ = 0 self.rptEngine_ = 0 self.report_ = 0 self.qry_ = 0 self.slotsPrintDisabled_ = False self.slotsExportedDisabled_ = False self.printing_ = False self.embedInParent_ = True if parent and embedInParent else False self.ui_ = {} qt3ui.loadUi(filedir('forms/FLWidgetReportViewer.ui'), self) if not name: self.setName("FLReportViewer") if self.embedInParent_: self.autoClose_ = False self.ui_["menubar"].hide() # Descomentar cuando se añada en qt3ui #FIXME # self.ui_["chkAutoClose"].hide() self.ui_["spnResolution"].hide() self.ui_["spnPixel"].hide() self.ui_["salir"].setVisible(False) if not parent.layout(): lay = QtCore.QVBoxLayout(parent) lay.addWidget(self) else: parent.layout().add(self) else: self.autoClose_ = bool(FLUtil().readSettingEntry( "rptViewer/autoClose", "false")) # Descomentar cuando se añada en qt3ui #FIXME # self.ui_["chkAutoClose"].setChecked(self.autoClose_) self.rptViewer_ = MReportViewer(self) self.setReportEngine( FLReportEngine(self) if rptEngine == 0 else rptEngine) self.setFont(QtWidgets.QApplication.font()) self.setFocusPolicy(Qt.StrongFocus) util = FLUtil() self.ui_["lePara"].setText(str(util.readSettingEntry("email/to"))) self.ui_["leDe"].setText(str(util.readSettingEntry("email/from"))) self.ui_["leMailServer"].setText( str(util.readSettingEntry("email/mailserver"))) wrv = self.ui_["FLWidgetReportViewer"] self.initCentralWidget_ = wrv.centralWidget() self.smtpClient_ = FLSmtpClient(self) self.smtpClient_.status.connect(self.ui_["lblEstado"].setText) wrv.setCentralWidget(self.rptViewer_) self.ui_["frEMail"].hide() if self.initCentralWidget_: self.initCentralWidget_.hide() if not self.embedInParent_: # Descomentar cuando se añada en qt3ui #FIXME pass # self.ui_["spnResolution"].setValue(int(FLUtil.readDBSettingEntry( # "rptViewer/dpi", str(self.rptViewer_.resolution())))) # self.ui_["spnPixel"].setValue(float(FLUtil.readDBSettingEntry( # "rptViewer/pixel", float(self.rptEngine_.relDpi()))) * 10.) self.report_ = self.rptViewer_.reportPages()
def load(self,path): self.ui = qt3ui.loadUi(path, self)
def createUI(self, n, connector=None, parent=None, name=None): if not ".ui" in n: n = n + ".ui" form_path = parent.prj.path(n) qt3ui.loadUi(form_path, parent.widget)