Python qtpy.QtWidgets.QFrame() Examples
The following are 6
code examples of qtpy.QtWidgets.QFrame().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
qtpy.QtWidgets
, or try the search function
.
Example #1
Source File: qt_controls.py From napari with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, viewer): super().__init__() self.setProperty("emphasized", True) self.viewer = viewer self.setMouseTracking(True) self.empty_widget = QFrame() self.widgets = {} self.addWidget(self.empty_widget) self._display(None) self.viewer.layers.events.added.connect(self._add) self.viewer.layers.events.removed.connect(self._remove) self.viewer.events.active_layer.connect(self._display)
Example #2
Source File: qt_modal.py From napari with BSD 3-Clause "New" or "Revised" License | 5 votes |
def __init__(self, parent): super().__init__(parent) self.setObjectName("QtModalPopup") self.setModal(False) # if False, then clicking anywhere else closes it self.setWindowFlags(Qt.Popup | Qt.FramelessWindowHint) self.setLayout(QVBoxLayout()) self.frame = QFrame() self.frame.setObjectName("QtPopupFrame") self.layout().addWidget(self.frame) self.layout().setContentsMargins(0, 0, 0, 0)
Example #3
Source File: attribute_widgets.py From pyrpl with GNU General Public License v3.0 | 5 votes |
def _make_widget(self): self.widget = QtWidgets.QFrame() self.widget_layout = QtWidgets.QVBoxLayout() self.widget.setLayout(self.widget_layout) self.widgets = [] self.button_add = QtWidgets.QPushButton("+") self.button_add.clicked.connect(self.append_default) self.widget_layout.addWidget(self.button_add) self.widget_layout.addStretch(1) self.widget_layout.setContentsMargins(0, 0, 0, 0) self.selected = None self.update_widget_names()
Example #4
Source File: FileRevisionWindow.py From P4VFX with MIT License | 4 votes |
def create_controls(self): ''' Create the widgets for the dialog ''' self.descriptionWidget = QtWidgets.QPlainTextEdit("<Enter Description>") self.descriptionLabel = QtWidgets.QLabel("Change Description:") self.getRevisionBtn = QtWidgets.QPushButton("Revert to Selected Revision") self.getLatestBtn = QtWidgets.QPushButton("Sync to Latest Revision") self.getPreviewBtn = QtWidgets.QPushButton("Preview Scene") self.getPreviewBtn.setEnabled(False) self.getRevisionBtn.setVisible(False) self.getLatestBtn.setVisible(False) self.getPreviewBtn.setVisible(False) # self.root = "//{0}".format(self.p4.client) # self.root = "//depot" # self.model = DepotClientViewModel.PerforceItemModel(self.p4) # self.model.populate(self.root, showDeleted=False) # self.model.populate('//depot', showDeleted=True) self.fileTree = QtWidgets.QTreeView() self.fileTree.expandAll() # self.fileTree.setModel(self.model) self.fileTree.setColumnWidth(0, 220) self.fileTree.setColumnWidth(1, 100) self.fileTree.setColumnWidth(2, 120) self.fileTree.setColumnWidth(3, 60) self.fileTree.setModel(self.model) # self.fileTree.setRootIndex(self.model.index(self.p4.cwd)) self.fileTree.setColumnWidth(0, 180) headers = ["Revision", "User", "Action", "Date", "Client", "Description"] self.tableWidget = QtWidgets.QTableWidget() self.tableWidget.setColumnCount(len(headers)) self.tableWidget.setMaximumHeight(200) self.tableWidget.setMinimumWidth(500) self.tableWidget.setHorizontalHeaderLabels(headers) self.tableWidget.verticalHeader().setVisible(False) self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.statusBar = QtWidgets.QStatusBar() # self.statusBar.showMessage("Test") self.horizontalLine = QtWidgets.QFrame() # self.horizontalLine.setFrameShape(QtWidgets.QFrame.Shape.HLine) if interop.getCurrentSceneFile(): # self.fileTree.setCurrentIndex(self.model.index(interop.getCurrentSceneFile())) self.populateFileRevisions()
Example #5
Source File: FileRevisionWindow.py From P4VFX with MIT License | 4 votes |
def create_controls(self): ''' Create the widgets for the dialog ''' self.descriptionWidget = QtWidgets.QPlainTextEdit("<Enter Description>") self.descriptionLabel = QtWidgets.QLabel("Change Description:") self.getRevisionBtn = QtWidgets.QPushButton("Revert to Selected Revision") self.getLatestBtn = QtWidgets.QPushButton("Sync to Latest Revision") self.getPreviewBtn = QtWidgets.QPushButton("Preview Scene") self.getPreviewBtn.setEnabled(False) self.getRevisionBtn.setVisible(False) self.getLatestBtn.setVisible(False) self.getPreviewBtn.setVisible(False) # self.root = "//{0}".format(self.p4.client) # self.root = "//depot" # self.model = DepotClientViewModel.PerforceItemModel(self.p4) # self.model.populate(self.root, showDeleted=False) # self.model.populate('//depot', showDeleted=True) self.fileTree = QtWidgets.QTreeView() self.fileTree.expandAll() # self.fileTree.setModel(self.model) self.fileTree.setColumnWidth(0, 220) self.fileTree.setColumnWidth(1, 100) self.fileTree.setColumnWidth(2, 120) self.fileTree.setColumnWidth(3, 60) self.fileTree.setModel(self.model) # self.fileTree.setRootIndex(self.model.index(self.p4.cwd)) self.fileTree.setColumnWidth(0, 180) headers = ["Revision", "User", "Action", "Date", "Client", "Description"] self.tableWidget = QtWidgets.QTableWidget() self.tableWidget.setColumnCount(len(headers)) self.tableWidget.setMaximumHeight(200) self.tableWidget.setMinimumWidth(500) self.tableWidget.setHorizontalHeaderLabels(headers) self.tableWidget.verticalHeader().setVisible(False) self.tableWidget.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows) self.tableWidget.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection) self.statusBar = QtWidgets.QStatusBar() # self.statusBar.showMessage("Test") self.horizontalLine = QtWidgets.QFrame() # self.horizontalLine.setFrameShape(QtWidgets.QFrame.Shape.HLine) if interop.getCurrentSceneFile(): # self.fileTree.setCurrentIndex(self.model.index(interop.getCurrentSceneFile())) self.populateFileRevisions()
Example #6
Source File: pyrpl_widget.py From pyrpl with GNU General Public License v3.0 | 4 votes |
def __init__(self, pyrpl_instance): self.parent = pyrpl_instance self.logger = self.parent.logger self.handler = LogHandler() self.logger.addHandler(self.handler) super(PyrplWidget, self).__init__() self.setDockNestingEnabled(True) # allow dockwidget nesting self.setAnimated(True) # animate docking of dock widgets self.dock_widgets = {} self.last_docked = None self.menu_modules = self.menuBar().addMenu("Modules") self.module_actions = [] for module in self.parent.software_modules: self.add_dock_widget(module._create_widget, module.name) # self.showMaximized() # maximized by default self.centralwidget = QtWidgets.QFrame() self.setCentralWidget(self.centralwidget) self.centrallayout = QtWidgets.QVBoxLayout() self.centrallayout.setAlignment(QtCore.Qt.AlignCenter) self.centralwidget.setLayout(self.centrallayout) self.centralbutton = QtWidgets.QPushButton('Click on "Modules" in the ' 'upper left corner to load a ' 'specific PyRPL module!') self.centralbutton.clicked.connect(self.click_menu_modules) self.centrallayout.addWidget(self.centralbutton) self.set_window_position() self.timer_save_pos = QtCore.QTimer() self.timer_save_pos.setInterval(1000) self.timer_save_pos.timeout.connect(self.save_window_position) self.timer_save_pos.start() self.timer_toolbar = QtCore.QTimer() self.timer_toolbar.setInterval(1000) self.timer_toolbar.setSingleShot(True) self.timer_toolbar.timeout.connect(self.vanish_toolbar) self.status_bar = self.statusBar() EL.show_exception.connect(self.show_exception) self.handler.show_log.connect(self.show_log) self.setWindowTitle(self.parent.c.pyrpl.name) self.timers = [self.timer_save_pos, self.timer_toolbar] #self.set_background_color(self)