def __init__(self, parent=None): super(FeatureFormWidget, self).__init__(parent) self.setupUi(self) utils.install_touch_scroll(self.scrollArea) toolbar = QToolBar() size = QSize(48, 48) toolbar.setIconSize(size) style = Qt.ToolButtonTextUnderIcon toolbar.setToolButtonStyle(style) self.actionDelete = toolbar.addAction(QIcon(":/icons/delete"), "Delete") self.actionDelete.triggered.connect(self.delete_feature) label = '<b style="color:red">*</b> Required fields' self.missingfieldsLabel = QLabel(label) self.missingfieldsLabel.hide() self.missingfieldaction = toolbar.addWidget(self.missingfieldsLabel) titlespacer = QWidget() titlespacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) toolbar.addWidget(titlespacer) self.titlellabel = QLabel(label) self.titlellabel.setProperty("headerlabel", True) self.titlelabelaction = toolbar.addWidget(self.titlellabel) spacer = QWidget() spacer2 = QWidget() spacer2.setMinimumWidth(40) spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) spacer2.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) toolbar.addWidget(spacer) self.actionCancel = toolbar.addAction(QIcon(":/icons/cancel"), "Cancel") toolbar.addWidget(spacer2) self.actionSave = toolbar.addAction(QIcon(":/icons/save"), "Save") self.actionSave.triggered.connect(self.save_feature) self.layout().setContentsMargins(0, 3, 0, 3) self.layout().insertWidget(0, toolbar) self.actiontoolbar = QToolBar() self.actiontoolbar.setToolButtonStyle(Qt.ToolButtonTextUnderIcon) spacer = QWidget() spacer.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.actiontoolbar.addWidget(spacer) self.layout().insertWidget(1, self.actiontoolbar) self.featureform = None self.values = {} self.config = {} self.feature = None
def __init__(self, parent): super(InfoDock, self).__init__(parent) self.setupUi(self) # TODO Doesn't currently work with webview. Loop back and fix this. install_touch_scroll(self.attributesView) self.forms = {} self.layerList.currentRowChanged.connect(self.layerIndexChanged) self.attributesView.linkClicked.connect(self.handle_link) self.attributesView.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) action = self.attributesView.pageAction(QWebPage.Copy) action.setShortcut(QKeySequence.Copy) self.grabGesture(Qt.SwipeGesture) self.setAttribute(Qt.WA_AcceptTouchEvents) self.editButton.pressed.connect(self.openform) self.editGeomButton.pressed.connect(self.editgeom) self.parent().installEventFilter(self) self.project = None self.startwidth = self.width() self.expaned = False self.layerList.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.expandAction = QAction(QIcon(":/icons/expand"), "Expand Panel", self) self.expandAction.triggered.connect(self.change_expanded_state) self.navigateAction = QAction(QIcon(":/icons/navigate"), "Navigate To..", self) self.navigateAction.triggered.connect(self._navigate_to_selection) self.moreActionsButton.pressed.connect(self._show_more_actions) self.navwidget.mousePressEvent = self._sink self.bottomWidget.mousePressEvent = self._sink self.navwidget.mouseReleaseEvent = self._sink self.bottomWidget.mouseReleaseEvent = self._sink self.navwidget.mouseMoveEvent = self._sink self.bottomWidget.mouseMoveEvent = self._sink self.deleteFeatureButton.pressed.connect(self.delete_feature) self.deleteFeatureButton.setCheckable(False) self.quickInspectButton.hide() self.quickInspectButton.pressed.connect(self.quick_inspect_feature) self.nextButton.pressed.connect(self.pagenext) self.prevButton.pressed.connect(self.pageback) RoamEvents.selectioncleared.connect(self.clearResults) RoamEvents.editgeometry_complete.connect(self.refreshcurrent) RoamEvents.editgeometry_invalid.connect(self.refreshcurrent)
def __init__(self, parent=None, centeronparent=False, showsave=True): super(BigList, self).__init__(parent) self.setupUi(self) self.centeronparent = centeronparent self.listView.clicked.connect(self.selected) self.saveButton.pressed.connect(self.savewidget.emit) self.closebutton.pressed.connect(self.closewidget.emit) self._index = None self.search.textEdited.connect(self.set_filter) self.filtermodel = QSortFilterProxyModel() self.filtermodel.setFilterCaseSensitivity(Qt.CaseInsensitive) self.listView.setModel(self.filtermodel) self.listView.setWordWrap(True) self.saveButton.setVisible(showsave) utils.install_touch_scroll(self.listView)
def __init__(self, parent=None): super(HelpPage, self).__init__(parent) self.setupUi(self) if self.parent(): self.parent().installEventFilter(self) self.view = QGraphicsView() self.webView = QGraphicsWebView() self.scene = QGraphicsScene() self.webView.setResizesToContents(True) self.view.setScene(self.scene) self.scene.addItem(self.webView) self.webView.linkClicked.connect(RoamEvents.openurl.emit) self.webView.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks) install_touch_scroll(self.view) self.layout().addWidget(self.view)