def __init__(self, showColumnVisBox=True, showHeaderBox=True, parent=None): super(ViewSearchWidget, self).__init__(parent=parent) # TODO: these button colors need stylesheeting once Stylesheeting is moved to zoocore searchIcon = iconlib.iconColorized("magnifier", size=14, color=(255, 255, 255)) closeIcon = iconlib.iconColorized("close", size=14, color=(255, 255, 255)) self.searchFrame = QtWidgets.QFrame(parent=self) self.searchFrame.setFrameShape(QtWidgets.QFrame.NoFrame) self.searchFrame.setFrameShadow(QtWidgets.QFrame.Plain) self.searchLayout = QtWidgets.QHBoxLayout(self) self.searchLayout.setContentsMargins(0, 0, 0, 0) self.searchWidget = searchwidget.SearchLineEdit(searchIcon, closeIcon, parent=self) self.searchWidget.textCleared.connect(self.searchTextedCleared.emit) self.searchWidget.textChanged.connect(self.searchTextedChanged.emit) self.searchFrame.setLayout(self.searchLayout) self.columnVisibilityBox = combobox.ExtendedComboBox(parent=self) self.columnVisibilityBox.setMinimumWidth(100) self.columnVisibilityBox.checkStateChanged.connect(self.onVisibilityChanged) self.searchLayout.addWidget(self.columnVisibilityBox) self.searchHeaderBox = combobox.ExtendedComboBox(parent=self) self.searchHeaderBox.setMinimumWidth(100) self.searchHeaderBox.currentIndexChanged.connect(self.onFilterChanged) self.searchLayout.addWidget(self.searchHeaderBox) self.searchLayout.addWidget(self.searchWidget) if not showColumnVisBox: self.columnVisibilityBox.hide() if not showHeaderBox: self.searchHeaderBox.hide()
def __init__(self, showColumnVisBox=True, showHeaderBox=True, parent=None): super(ViewSearchWidget, self).__init__(parent=parent) searchIcon = iconlib.icon("magnifier", 16) closeIcon = iconlib.icon("close", 16) self.searchFrame = QtWidgets.QFrame(parent=self) self.searchFrame.setFrameShape(QtWidgets.QFrame.NoFrame) self.searchFrame.setFrameShadow(QtWidgets.QFrame.Plain) self.searchLayout = QtWidgets.QHBoxLayout(self) self.searchLayout.setContentsMargins(2, 2, 2, 2) self.searchWidget = searchwidget.SearchLineEdit(searchIcon, closeIcon, parent=self) self.searchWidget.textCleared.connect(self.searchTextedCleared.emit) self.searchWidget.textChanged.connect(self.searchTextedChanged.emit) self.searchFrame.setLayout(self.searchLayout) self.columnVisibilityBox = None self.columnVisibilityBox = combobox.ExtendedComboBox(parent=self) self.columnVisibilityBox.setMinimumWidth(100) self.columnVisibilityBox.checkStateChanged.connect(self.onVisibilityChanged) self.searchLayout.addWidget(self.columnVisibilityBox) self.searchHeaderBox = combobox.ExtendedComboBox(parent=self) self.searchHeaderBox.setMinimumWidth(100) self.searchHeaderBox.currentIndexChanged.connect(self.onFilterChanged) self.searchLayout.addWidget(self.searchHeaderBox) self.searchLayout.addWidget(self.searchWidget) if not showColumnVisBox: self.columnVisibilityBox.hide() if not showHeaderBox: self.searchHeaderBox.hide()
def _initUi(self): parent = self.parent() self.frame = QtWidgets.QFrame(parent) self.iconWidget = QtWidgets.QLabel(parent) self.iconWidget.setFixedWidth(29) self.label = _ExtendedQLabel(self._label, parent) self.optionBox = QtWidgets.QToolButton(parent) self.iconWidget.setFixedWidth(29) self.label.clicked.connect(self.triggered.emit) self.optionBox.clicked.connect(self.optionBoxTriggered.emit)
def buildHiderWidget(self): """Builds widget that is collapsable Widget can be toggled so it's a container for the layout """ self.widgetHider = QtWidgets.QFrame() self.widgetHider.setContentsMargins(0, 0, 0, 0) self.hiderLayout = QtWidgets.QVBoxLayout(self.widgetHider) self.hiderLayout.setContentsMargins(*self.contentMargins) self.hiderLayout.setSpacing(self.contentSpacing) self.widgetHider.setHidden(self.collapsed)
def __init__(self, widget, width=450, height=50, iconSize=40, parent=None, showOnInitialize=False, stylesheet="", popupRelease=QtCore.Qt.Key_Control, showAtCursor=True): super(ExpandedTooltipPopup, self).__init__(None, width, height, "", parent, showOnInitialize) self.layout = QtWidgets.QVBoxLayout(self) self.font = QtGui.QFont("sans") self.titleFont = QtGui.QFont("sans") # Maybe should link this with the stylesheets self.iconColour = self.ETT_ICONCOLOUR self.themeColour = self.ETT_THEMECOLOUR self.linkColour = self.ETT_LINKCOLOUR self.popupKey = popupRelease self.iconSize = iconSize self.frameLayout = QtWidgets.QVBoxLayout() self.titleLayout = QtWidgets.QHBoxLayout() self.frame = QtWidgets.QFrame(self) self.titleLabel = QtWidgets.QLabel(self) self.tooltipIcon = None # type: QtCore.QIcon self.widget = widget if stylesheet != "": self.setStyleSheet(stylesheet) self.initUi() self.show() if showAtCursor: self.move(QtGui.QCursor.pos()) self.setStyle(self.style())
def _setupFilter(self): self.searchBoxLabel = QtWidgets.QLabel("Search By: ", parent=self) self.searchHeaderBox = QtWidgets.QComboBox(parent=self) self.refreshBtn = QtWidgets.QToolButton(parent=self) self.refreshBtn.setIcon(iconlib.icon("reload")) self.searchFrame = QtWidgets.QFrame(parent=self) self.searchFrame.setFrameShape(QtWidgets.QFrame.NoFrame) self.searchFrame.setFrameShadow(QtWidgets.QFrame.Plain) self.searchLayout = QtWidgets.QHBoxLayout(self) self.searchLayout.setContentsMargins(2, 2, 2, 2) self.searchClearBtn = QtWidgets.QPushButton("Clear", parent=self) self.searchLabel = QtWidgets.QLabel("Search", parent=self) self.searchEdit = QtWidgets.QLineEdit(self) self.searchFrame.setLayout(self.searchLayout) self.searchLayout.addWidget(self.refreshBtn) self.searchLayout.addWidget(self.searchBoxLabel) self.searchLayout.addWidget(self.searchHeaderBox) self.searchLayout.addWidget(self.searchLabel) self.searchLayout.addWidget(self.searchEdit) self.searchLayout.addWidget(self.searchClearBtn) self.mainLayout.addWidget(self.searchFrame)
def vframeLayout(parent=None): subFrame = QtWidgets.QFrame(parent=parent) layout = vBoxLayout(subFrame) subFrame.setLayout(layout) return subFrame, layout