def __init__(self, diagramName = "Unnamed", parent = None, name = None): """ Constructor @param diagramName name of the diagram (string) @param parent parent widget of the view (QWidget) @param name name of the view widget (QString or string) """ KQMainWindow.__init__(self, parent) if not name: self.setObjectName("UMLDialog") else: self.setObjectName(name) self.scene = QGraphicsScene(0.0, 0.0, 800.0, 600.0) self.umlView = UMLGraphicsView(self.scene, diagramName, self, "umlView") self.closeAct = \ QAction(UI.PixmapCache.getIcon("close.png"), self.trUtf8("Close"), self) self.connect(self.closeAct, SIGNAL("triggered()"), self.close) self.windowToolBar = QToolBar(self.trUtf8("Window"), self) self.windowToolBar.setIconSize(UI.Config.ToolBarIconSize) self.windowToolBar.addAction(self.closeAct) self.umlToolBar = self.umlView.initToolBar() self.addToolBar(Qt.TopToolBarArea, self.windowToolBar) self.addToolBar(Qt.TopToolBarArea, self.umlToolBar) self.setCentralWidget(self.umlView)
def __init__(self, parent = None): """ Constructor @param parent reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.cw = DiffDialog(self) self.cw.installEventFilter(self) size = self.cw.size() self.setCentralWidget(self.cw) self.resize(size)
def __init__(self, files = [], parent = None): """ Constructor @param files list of files to compare and their label (list of two tuples of two strings) @param parent reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.cw = CompareDialog(files, self) self.cw.installEventFilter(self) size = self.cw.size() self.setCentralWidget(self.cw) self.resize(size)
def __init__(self, parent = None): """ Constructor @param parent reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.cw = QRegExpWizardWidget(self, fromEric = False) size = self.cw.size() self.setCentralWidget(self.cw) self.resize(size) self.connect(self.cw.buttonBox, SIGNAL("accepted()"), self.close) self.connect(self.cw.buttonBox, SIGNAL("rejected()"), self.close)
def __init__(self, parent = None): """ Constructor @param parent reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.cw = PluginUninstallWidget(None, self) size = self.cw.size() self.setCentralWidget(self.cw) self.resize(size) self.connect(self.cw, SIGNAL("accepted()"), self.close) self.connect(self.cw.buttonBox, SIGNAL("rejected()"), self.close)
def __init__(self, pluginFileNames, parent = None): """ Constructor @param pluginFileNames list of plugin files suggested for installation (QStringList) @param parent reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.cw = PluginInstallWidget(None, pluginFileNames, self) size = self.cw.size() self.setCentralWidget(self.cw) self.resize(size) self.connect(self.cw.buttonBox, SIGNAL("accepted()"), self.close) self.connect(self.cw.buttonBox, SIGNAL("rejected()"), self.close)
def __init__(self, connections = [], parent = None): """ Constructor @param connections list of database connections to add (list of strings) @param reference to the parent widget (QWidget) """ KQMainWindow.__init__(self, parent) self.setObjectName("SqlBrowser") self.setWindowTitle(self.trUtf8("SQL Browser")) self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) self.__browser = SqlBrowserWidget(self) self.setCentralWidget(self.__browser) self.connect(self.__browser, SIGNAL("statusMessage(QString)"), self.statusBar().showMessage) self.__initActions() self.__initMenus() self.__initToolbars() self.resize(self.__browser.size()) self.__warnings = [] for connection in connections: url = QUrl(connection, QUrl.TolerantMode) if not url.isValid(): self.__warnings.append(self.trUtf8("Invalid URL: %1").arg(connection)) continue err = self.__browser.addConnection(url.scheme(), url.path(), url.userName(), url.password(), url.host(), url.port(-1)) if err.type() != QSqlError.NoError: self.__warnings.append( self.trUtf8("Unable to open connection: %1").arg(err.text())) QTimer.singleShot(0, self.__uiStartUp)
def __init__(self, pixmap, parent = None, name = None): """ Constructor @param pixmap filename of a graphics file to show (QString or string) @param parent parent widget of the view (QWidget) @param name name of the view widget (QString or string) """ KQMainWindow.__init__(self, parent) if name: self.setObjectName(name) else: self.setObjectName("PixmapDiagram") self.setWindowTitle(self.trUtf8("Pixmap-Viewer")) self.pixmapLabel = QLabel() self.pixmapLabel.setObjectName("pixmapLabel") self.pixmapLabel.setBackgroundRole(QPalette.Base) self.pixmapLabel.setSizePolicy(QSizePolicy.Ignored, QSizePolicy.Ignored) self.pixmapLabel.setScaledContents(True) self.pixmapView = QScrollArea() self.pixmapView.setObjectName("pixmapView") self.pixmapView.setBackgroundRole(QPalette.Dark) self.pixmapView.setWidget(self.pixmapLabel) self.setCentralWidget(self.pixmapView) # polish up the dialog self.resize(QSize(800, 600).expandedTo(self.minimumSizeHint())) self.zoom = 1.0 self.pixmapfile = pixmap self.status = self.__showPixmap(self.pixmapfile) self.__initActions() self.__initContextMenu() self.__initToolBars()
def __init__(self, filenames = [], parent = None, name = None): """ Constructor @param filenames filenames of form and/or translation files to load @param parent parent widget of this window (QWidget) @param name name of this window (string or QString) """ self.mainWidget = None self.currentFile = QDir.currentPath() KQMainWindow.__init__(self, parent) if not name: self.setObjectName("TRPreviewer") else: self.setObjectName(name) self.resize(QSize(800, 600).expandedTo(self.minimumSizeHint())) self.setAttribute(Qt.WA_DeleteOnClose) self.statusBar() self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) self.setWindowTitle(self.trUtf8("Translations Previewer")) self.cw = QWidget(self) self.cw.setObjectName("qt_central_widget") self.TRPreviewerLayout = QVBoxLayout(self.cw) self.TRPreviewerLayout.setMargin(6) self.TRPreviewerLayout.setSpacing(6) self.TRPreviewerLayout.setObjectName("TRPreviewerLayout") self.languageLayout = QHBoxLayout() self.languageLayout.setMargin(0) self.languageLayout.setSpacing(6) self.languageLayout.setObjectName("languageLayout") self.languageLabel = QLabel(self.trUtf8("Select language file"), self.cw) self.languageLabel.setObjectName("languageLabel") self.languageLayout.addWidget(self.languageLabel) self.languageCombo = QComboBox(self.cw) self.languageCombo.setObjectName("languageCombo") self.languageCombo.setEditable(False) self.languageCombo.setToolTip(self.trUtf8("Select language file")) self.languageLayout.addWidget(self.languageCombo) languageSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.languageLayout.addItem(languageSpacer) self.TRPreviewerLayout.addLayout(self.languageLayout) self.preview = WidgetWorkspace(self.cw) self.preview.setObjectName("preview") self.TRPreviewerLayout.addWidget(self.preview) self.connect(self.preview, SIGNAL('lastWidgetClosed'), self.__updateActions) self.setCentralWidget(self.cw) self.connect(self.languageCombo,SIGNAL("activated(const QString&)"), self.setTranslation) self.translations = TranslationsDict(self.languageCombo, self) self.connect(self.translations, SIGNAL('translationChanged'), self.preview, SIGNAL('rebuildWidgets')) self.__initActions() self.__initMenus() self.__initToolbars() self.__updateActions() # fire up the single application server self.SAServer = TRSingleApplicationServer(self) self.connect(self.SAServer, SIGNAL('loadForm'), self.preview.loadWidget) self.connect(self.SAServer, SIGNAL('loadTranslation'), self.translations.add) # defere loading of a UI file until we are shown self.filesToLoad = filenames[:]
def __init__(self, filename = None, parent = None, name = None): """ Constructor @param filename name of a UI file to load @param parent parent widget of this window (QWidget) @param name name of this window (string or QString) """ self.mainWidget = None self.currentFile = QDir.currentPath() KQMainWindow.__init__(self, parent) if not name: self.setObjectName("UIPreviewer") else: self.setObjectName(name) self.resize(QSize(600, 480).expandedTo(self.minimumSizeHint())) self.setAttribute(Qt.WA_DeleteOnClose) self.statusBar() self.setWindowIcon(UI.PixmapCache.getIcon("eric.png")) self.setWindowTitle(self.trUtf8("UI Previewer")) self.cw = QWidget(self) self.cw.setObjectName("centralWidget") self.UIPreviewerLayout = QVBoxLayout(self.cw) self.UIPreviewerLayout.setMargin(6) self.UIPreviewerLayout.setSpacing(6) self.UIPreviewerLayout.setObjectName("UIPreviewerLayout") self.styleLayout = QHBoxLayout() self.styleLayout.setMargin(0) self.styleLayout.setSpacing(6) self.styleLayout.setObjectName("styleLayout") self.styleLabel = QLabel(self.trUtf8("Select GUI Theme"), self.cw) self.styleLabel.setObjectName("styleLabel") self.styleLayout.addWidget(self.styleLabel) self.styleCombo = QComboBox(self.cw) self.styleCombo.setObjectName("styleCombo") self.styleCombo.setEditable(False) self.styleCombo.setToolTip(self.trUtf8("Select the GUI Theme")) self.styleLayout.addWidget(self.styleCombo) self.styleCombo.addItems(QStyleFactory().keys()) self.styleCombo.setCurrentIndex(\ Preferences.Prefs.settings.value('UIPreviewer/style').toInt()[0]) styleSpacer = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.styleLayout.addItem(styleSpacer) self.UIPreviewerLayout.addLayout(self.styleLayout) self.previewSV = QScrollArea(self.cw) self.previewSV.setObjectName("preview") self.previewSV.setFrameShape(QFrame.NoFrame) self.previewSV.setFrameShadow(QFrame.Plain) self.previewSV.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.UIPreviewerLayout.addWidget(self.previewSV) self.setCentralWidget(self.cw) self.connect(self.styleCombo, SIGNAL("activated(const QString&)"), self.__guiStyleSelected) self.__initActions() self.__initMenus() self.__initToolbars() self.__updateActions() # defere loading of a UI file until we are shown self.fileToLoad = filename