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


Python QtGui.QWidget方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def __init__(self, name, layout=None, widget=None, palette=None):
        self._name = name

        if not layout:
            layout = QtGui.QHBoxLayout()
        self._layout = layout

        if not widget:
            widget = QtGui.QWidget()
            widget.setLayout(self.layout)
        self._widget = widget

        if not palette:
            palette = mari.palettes.create(name, widget)
        self._palette = palette

        self._palette.show()

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:21,代码来源:shelf.py

示例2: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def setupUi(self, DockWidget):
        DockWidget.setObjectName(_fromUtf8("DockWidget"))
        DockWidget.resize(400, 200)
        self.dockWidgetContents = QtGui.QWidget()
        self.dockWidgetContents.setObjectName(_fromUtf8("dockWidgetContents"))
        self.verticalLayout = QtGui.QVBoxLayout(self.dockWidgetContents)
        #self.verticalLayout.setMargin(0)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        
        for link in self.link_sub:
            groupBox = myGrpBox(self.dockWidgetContents, link, self.obj)
            self.verticalLayout.addWidget(groupBox)
        
        self.pushButton_7 = QtGui.QPushButton(self.dockWidgetContents)
        self.pushButton_7.setObjectName(_fromUtf8("pushButton_7"))
        self.verticalLayout.addWidget(self.pushButton_7, 0, QtCore.Qt.AlignHCenter)
        spacerItem = QtGui.QSpacerItem(20, 237, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        DockWidget.setWidget(self.dockWidgetContents)

        self.retranslateUi(DockWidget)
        QtCore.QMetaObject.connectSlotsByName(DockWidget) 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:24,代码来源:sublink_edit.py

示例3: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def __init__(self, obj):
        self.object = obj
        if obj == None:
            self.baseObj = Gui.Selection.getSelection()[0]
            edgelist = []
        else:
            edgelist = obj.diameters
            self.baseObj = obj.baseObject[0]
            Gui.ActiveDocument.getObject(obj.Name).Visibility = False
            Gui.ActiveDocument.getObject(self.baseObj.Name).Visibility = True
        FSFilletDialog = QtGui.QWidget()
        FSFilletDialog.ui = Ui_DlgCountersunktHoles()
        FSFilletDialog.ui.setupUi(FSFilletDialog)
        FreeCAD.Console.PrintLog(str(self.baseObj) + "\n")
        FSFilletDialog.ui.fillTable(FSFilletDialog, self.baseObj, edgelist)
        FSFilletDialog.ui.labelBaseObject.setText(self.baseObj.Name)
        FSFilletDialog.ui.model.itemChanged.connect(self.onItemChanged)
                
        self.form = FSFilletDialog
        self.form.setWindowTitle("Chamfer holes for countersunk screws")
        Gui.Selection.addSelectionGate(FSSelectionFilterGate)
        self.selobserver = FSSelObserver(self) 
        Gui.Selection.addObserver(self.selobserver) 
        self.RefreshSelection() 
开发者ID:shaise,项目名称:FreeCAD_FastenersWB,代码行数:26,代码来源:CountersunkHoles.py

示例4: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def __init__(self, parent=None, App=None):
        super(IPythonConsole, self).__init__(parent)
        self.App = App
        self.console = EmbedIPython(App=self.App)
        self.console.kernel.shell.run_cell('%pylab qt')
        self.console.kernel.shell.run_cell("import numpy as np")
        self.console.kernel.shell.run_cell("from matplotlib import rcParams")
        self.console.kernel.shell.run_cell("rcParams['backend.qt4']='PySide'")
        self.console.kernel.shell.run_cell("import matplotlib.pyplot as plt")

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.console)

        b = QtGui.QWidget()
        b.setLayout(vbox)
        self.setCentralWidget(b) 
开发者ID:mmolero,项目名称:pcloudpy,代码行数:18,代码来源:IPythonConsole.py

示例5: quickMsg

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def quickMsg(self, msg, block=1):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            tmpLabel = QtWidgets.QLabel(msg)
            tmpLabel.setTextInteractionFlags(QtCore.Qt.TextSelectableByMouse)
            layout.addWidget(tmpLabel)
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        if block:
            tmpMsg.exec_()
        else:
            tmpMsg.show() 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:26,代码来源:universal_tool_template_1115.py

示例6: quickMsg

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def quickMsg(self, msg, block=1):
        tmpMsg = QtWidgets.QMessageBox(self) # for simple msg that no need for translation
        tmpMsg.setWindowTitle("Info")
        lineCnt = len(msg.split('\n'))
        if lineCnt > 25:
            scroll = QtWidgets.QScrollArea()
            scroll.setWidgetResizable(1)
            content = QtWidgets.QWidget()
            scroll.setWidget(content)
            layout = QtWidgets.QVBoxLayout(content)
            layout.addWidget(QtWidgets.QLabel(msg))
            tmpMsg.layout().addWidget(scroll, 0, 0, 1, tmpMsg.layout().columnCount())
            tmpMsg.setStyleSheet("QScrollArea{min-width:600 px; min-height: 400px}")
        else:
            tmpMsg.setText(msg)
        if block == 0:
            tmpMsg.setWindowModality( QtCore.Qt.NonModal )
        tmpMsg.addButton("OK",QtWidgets.QMessageBox.YesRole)
        if block:
            tmpMsg.exec_()
        else:
            tmpMsg.show() 
开发者ID:shiningdesign,项目名称:universal_tool_template.py,代码行数:24,代码来源:universal_tool_template_1112.py

示例7: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(529, 329)
        self.selInfoWidget = QtGui.QWidget(Form)
        self.selInfoWidget.setGeometry(QtCore.QRect(260, 10, 264, 222))
        self.selInfoWidget.setObjectName("selInfoWidget")
        self.gridLayout = QtGui.QGridLayout(self.selInfoWidget)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setObjectName("gridLayout")
        self.selDescLabel = QtGui.QLabel(self.selInfoWidget)
        self.selDescLabel.setText("")
        self.selDescLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.selDescLabel.setWordWrap(True)
        self.selDescLabel.setObjectName("selDescLabel")
        self.gridLayout.addWidget(self.selDescLabel, 0, 0, 1, 1)
        self.selNameLabel = QtGui.QLabel(self.selInfoWidget)
        font = QtGui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.selNameLabel.setFont(font)
        self.selNameLabel.setText("")
        self.selNameLabel.setObjectName("selNameLabel")
        self.gridLayout.addWidget(self.selNameLabel, 0, 1, 1, 1)
        self.selectedTree = DataTreeWidget(self.selInfoWidget)
        self.selectedTree.setObjectName("selectedTree")
        self.selectedTree.headerItem().setText(0, "1")
        self.gridLayout.addWidget(self.selectedTree, 1, 0, 1, 2)
        self.hoverText = QtGui.QTextEdit(Form)
        self.hoverText.setGeometry(QtCore.QRect(0, 240, 521, 81))
        self.hoverText.setObjectName("hoverText")
        self.view = FlowchartGraphicsView(Form)
        self.view.setGeometry(QtCore.QRect(0, 0, 256, 192))
        self.view.setObjectName("view")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:38,代码来源:FlowchartTemplate_pyside.py

示例8: main_window

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def main_window(self):
        """Returns the Qt main window used to parent dialogs/widgets."""

        if not MAYA_UI_IMPORTED:
            return None

        if not hasattr(self, '_main_window'):
            self._main_window = wrapInstance(
                long(omui.MQtUtil.mainWindow()), QtGui.QWidget) 

        return self._main_window

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:15,代码来源:session.py

示例9: main_window

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def main_window(self):
        """Returns the Qt main window used to parent dialogs/widgets."""

        if not MARI_UI_IMPORTED:
            return None

        if not hasattr(self, '_main_window'):
            self._main_window = QtGui.QWidget()

        return self._main_window

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:14,代码来源:session.py

示例10: import_options_page

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def import_options_page(self):

        if hasattr(self, '_import_options_page'):
            return self._import_options_page

        page = QtGui.QWizardPage()
        page.setTitle("Options")
        page.setSubTitle(
            "Set the options for the products being imported.")

        self._options = defaultdict(dict)

        options_layout = QtGui.QVBoxLayout()

        options_widget = QtGui.QWidget()
        options_widget.setLayout(options_layout)

        scroll_area = QtGui.QScrollArea()
        scroll_area.setFocusPolicy(QtCore.Qt.NoFocus)
        scroll_area.setWidgetResizable(True)
        scroll_area.setWidget(options_widget)

        layout = QtGui.QVBoxLayout()
        layout.addWidget(scroll_area)

        page.setLayout(layout)

        self._import_options_page = page
        return self._import_options_page

    # ------------------------------------------------------------------------- 
开发者ID:Clemson-DPA,项目名称:dpa-pipe,代码行数:33,代码来源:imports.py

示例11: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def __init__(self):

        super(zebra, self).__init__()
        #self.zebraWidget = QtGui.QWidget()
        self.ui = Zebra_Gui.Ui_Zebra()
        self.ui.setupUi(self) #.zebraWidget)
        self.tabIndex = 0
        self.comboview = None

        self.StripeWidth = 25
        self.Scale = 20
        self.Rotation = 157

        self.coinSetUp()

        self.ui.horizontalSlider.setMaximum(50)
        self.ui.horizontalSlider.valueChanged[int].connect(self.changeSlide_1)
        self.ui.horizontalSlider.setValue(self.StripeWidth)

        self.ui.horizontalSlider_2.setMaximum(40)
        self.ui.horizontalSlider_2.valueChanged[int].connect(self.changeSlide_2)
        self.ui.horizontalSlider_2.setValue(self.Scale)

        self.ui.horizontalSlider_3.setMaximum(314)
        self.ui.horizontalSlider_3.valueChanged[int].connect(self.changeSlide_3)
        self.ui.horizontalSlider_3.setValue(self.Rotation)

        self.ui.pushButton.clicked.connect(self.quit)

        #self.zebraWidget.show() 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:32,代码来源:ZebraTool.py

示例12: setupUi

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def setupUi(self, Zebra):
        Zebra.setObjectName(_fromUtf8("Zebra"))
        Zebra.resize(241, 302)
        self.verticalLayoutWidget = QtGui.QWidget(Zebra)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.verticalLayoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
        self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
        self.verticalLayout.addWidget(self.horizontalSlider)
        self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
        self.verticalLayout.addWidget(self.horizontalSlider_2)
        self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
        self.verticalLayout.addWidget(self.horizontalSlider_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)

        self.retranslateUi(Zebra)
#        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
#        QtCore.QMetaObject.connectSlotsByName(Zebra) 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:40,代码来源:Zebra_Gui.py

示例13: maya_main_window

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def maya_main_window():
    """Get Maya's main window

    Returns:
        QMainWindow: main window.

    """

    main_window_ptr = omui.MQtUtil.mainWindow()
    return QtCompat.wrapInstance(long(main_window_ptr), QtWidgets.QWidget) 
开发者ID:mgear-dev,项目名称:mgear_core,代码行数:12,代码来源:pyqt.py

示例14: BT_GetMayaWindow

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def BT_GetMayaWindow():
    ptr = apiUI.MQtUtil.mainWindow()
    if ptr is not None:
        if BT_MayaVersionNumber < 2014:
            return wrapinstance(long(ptr), QtCore.QObject)
        else:
            return wrapInstance(long(ptr), QtGui.QWidget) 
开发者ID:duncanskertchly,项目名称:BlendTransforms,代码行数:9,代码来源:BlendTransforms.py

示例15: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QWidget [as 别名]
def __init__(self, obj):
        self.object = obj
        self.baseObj = obj
        self.disableUpdate = True
        self.selection = Gui.Selection.getSelection()
        self.matchOuter = FastenerBase.FSMatchOuter
        FSChangeParamDialog = QtGui.QWidget()
        FSChangeParamDialog.ui = Ui_DlgChangeParams()
        FSChangeParamDialog.ui.setupUi(FSChangeParamDialog)
        ui = FSChangeParamDialog.ui
        #FSChangeParamDialog.ui.widgetVarLength.hide()
                
        self.form = FSChangeParamDialog
        self.form.setWindowTitle("Change fastener parameters")
        Gui.Selection.addSelectionGate(FSCPSelectionFilterGate)
        self.selobserver = FSCPSelObserver(self.selection) 
        Gui.Selection.addObserver(self.selobserver) 
        ui.comboFastenerType.currentIndexChanged.connect(self.onFastenerChange)
        ui.comboDiameter.currentIndexChanged.connect(self.onDiameterChange)
        ui.checkAutoDiameter.stateChanged.connect(self.onAutoDiamChange)
        ui.checkSetLength.stateChanged.connect(self.onSetLengthChange)
        ui.spinLength.setEnabled(False)
        self.hatMatchOption = False
        if len(self.selection) > 0:
          selobj = self.selection[0]
          #FreeCAD.Console.PrintLog("selobj: " + str(selobj.Proxy) + "\n")
          if hasattr(selobj, 'Proxy') and hasattr(selobj.Proxy, 'VerifyCreateMatchOuter'):
            self.hatMatchOption = True
        if self.hatMatchOption:
          ui.comboMatchType.addItem("No Change")
          ui.comboMatchType.addItem(QtGui.QIcon(os.path.join(iconPath , 'IconMatchTypeInner.svg')), "Match inner thread")
          ui.comboMatchType.addItem(QtGui.QIcon(os.path.join(iconPath , 'IconMatchTypeOuter.svg')), "Match outer thread")
          ui.comboMatchType.setEnabled(False)
          ui.comboMatchType.setCurrentIndex(0)
        else:
          ui.comboMatchType.hide() 
开发者ID:shaise,项目名称:FreeCAD_FastenersWB,代码行数:38,代码来源:FSChangeParams.py


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