当前位置: 首页>>代码示例>>Python>>正文


Python QtWidgets.QFrame方法代码示例

本文整理汇总了Python中qtpy.QtWidgets.QFrame方法的典型用法代码示例。如果您正苦于以下问题:Python QtWidgets.QFrame方法的具体用法?Python QtWidgets.QFrame怎么用?Python QtWidgets.QFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qtpy.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QFrame方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _make_widget

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QFrame [as 别名]
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() 
开发者ID:lneuhaus,项目名称:pyrpl,代码行数:14,代码来源:attribute_widgets.py

示例2: __init__

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QFrame [as 别名]
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) 
开发者ID:napari,项目名称:napari,代码行数:16,代码来源:qt_controls.py

示例3: __init__

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QFrame [as 别名]
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) 
开发者ID:napari,项目名称:napari,代码行数:13,代码来源:qt_modal.py

示例4: create_controls

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QFrame [as 别名]
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() 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:57,代码来源:FileRevisionWindow.py

示例5: __init__

# 需要导入模块: from qtpy import QtWidgets [as 别名]
# 或者: from qtpy.QtWidgets import QFrame [as 别名]
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) 
开发者ID:lneuhaus,项目名称:pyrpl,代码行数:50,代码来源:pyrpl_widget.py


注:本文中的qtpy.QtWidgets.QFrame方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。