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


Python QtGui.QDockWidget方法代码示例

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


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

示例1: onTimer

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def onTimer(self):
        if a2plib.getConstraintEditorRef(): # != None
            # the editor box is active, do not show self
            self.hide()
        else:
            if not self.isVisible():
                self.show()
                self.resize(200,250)
            # calculate window center position and save it
            # self.rect().center() does not work here somehow
            frame = QtGui.QDockWidget.frameGeometry(self)
            x = frame.x()
            y = frame.y()

            global CONSTRAINT_DIALOG_STORED_POSITION
            CONSTRAINT_DIALOG_STORED_POSITION = QtCore.QPoint(x,y)

        self.timer.start(100) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:20,代码来源:a2p_constraintDialog.py

示例2: restore_Main_Tools

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

    #Getting the main window will allow us to start setting things up the way we want
    mw = FreeCADGui.getMainWindow()

    #Adjust the docks as usual
    dockWidgets = mw.findChildren(QtGui.QDockWidget)
    for widget in dockWidgets:
        if (widget.objectName() == "Report view") or (widget.objectName() == "Python console") or (widget.objectName() == "Combo View"):
            widget.setVisible(True)
        if (widget.objectName()=="cqCodeView"):
            widget.setVisible(False)

    return 0


###################################################################
# z_RotateObject()  maui
#   Function to z-rotate an object
#
################################################################### 
开发者ID:easyw,项目名称:kicad-3d-models-in-freecad,代码行数:23,代码来源:cq_cad_tools.py

示例3: getComboView

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def getComboView(mw):
   dw=mw.findChildren(QtGui.QDockWidget)
   for i in dw:
       if str(i.objectName()) == "Combo View":
           return i.findChild(QtGui.QTabWidget)
       elif str(i.objectName()) == "Python Console":
           return i.findChild(QtGui.QTabWidget)
   raise Exception ("No tab widget found") 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:10,代码来源:SurfaceEdit.py

示例4: getComboView

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def getComboView(mw):
   dw = mw.findChildren(QtGui.QDockWidget)
   for i in dw:
       if str(i.objectName()) == "Combo View":
           return i.findChild(QtGui.QTabWidget)
       elif str(i.objectName()) == "Python Console":
           return i.findChild(QtGui.QTabWidget)
   raise Exception ("No tab widget found") 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:10,代码来源:sublink_edit.py

示例5: __init__

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def __init__(self, obj):
        self.obj = obj
        self.main_win = FreeCADGui.getMainWindow()
        self.widget = QtGui.QDockWidget()
        self.widget.ui = myWidget_Ui(obj)
        self.widget.ui.setupUi(self.widget)
        
        self.widget.ui.pushButton_7.clicked.connect(self.accept)
        
        self.main_win.addDockWidget(QtCore.Qt.RightDockWidgetArea,self.widget)
        self.widget.setFloating(True)
        
        self.initial_visibility = self.obj.ViewObject.Visibility
        self.obj.ViewObject.Visibility = False 
开发者ID:tomate44,项目名称:CurvesWB,代码行数:16,代码来源:sublink_edit.py

示例6: storeWindowPosition

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def storeWindowPosition(self):
        # ConstraintDialog has Priority on storing its position
        if a2plib.getConstraintDialogRef() != None:
            return
        frame = QtGui.QDockWidget.frameGeometry(self)
        x = frame.x()
        y = frame.y()

        global CONSTRAINT_DIALOG_STORED_POSITION
        CONSTRAINT_DIALOG_STORED_POSITION = QtCore.QPoint(x,y) 
开发者ID:kbwbe,项目名称:A2plus,代码行数:12,代码来源:a2p_constraintDialog.py

示例7: setupDock

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def setupDock(self):
        '''Setup empty Dock at startup. '''
        self.dock = QtGui.QDockWidget("Classes", self)
        self.dock.setWidget(self.tree)
        self.dock.setFeatures(QtGui.QDockWidget.NoDockWidgetFeatures)
        self.addDockWidget(QtCore.Qt.LeftDockWidgetArea, self.dock) 
开发者ID:DroidTest,项目名称:TimeMachine,代码行数:8,代码来源:mainwindow.py

示例8: Activated

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def Activated(self):
        # Grab our main window so we can interact with it
        mw = FreeCADGui.getMainWindow()

        reportView = mw.findChild(QtGui.QDockWidget, "Report view")

        # Clear the view because it gets overwhelmed sometimes and won't scroll to the bottom
        reportView.widget().clear() 
开发者ID:jmwright,项目名称:cadquery-freecad-module,代码行数:10,代码来源:Command.py

示例9: Activated

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def Activated(self):
        import os
        try:
            from . import module_locator
        except:
            import module_locator
        try:
            from CadQuery.CQGui import ImportCQ
        except:
            from CQGui import ImportCQ

        module_base_path = module_locator.module_path()

        import cadquery
        from PySide import QtGui, QtCore

        msg = QtGui.QApplication.translate(
            "cqCodeWidget",
            "CadQuery " + cadquery.__version__ + "\r\n"
            "CadQuery is a parametric scripting API "
            "for creating and traversing CAD models\r\n"
            "Author: David Cowden\r\n"
            "License: Apache-2.0\r\n"
            "Website: https://github.com/dcowden/cadquery\r\n",
            None)
        FreeCAD.Console.PrintMessage(msg)

        #Getting the main window will allow us to start setting things up the way we want
        mw = FreeCADGui.getMainWindow()

        dockWidgets = mw.findChildren(QtGui.QDockWidget)

        for widget in dockWidgets:
            if widget.objectName() == "Report view":
                widget.setVisible(True)

        # Set up the paths to allow us to open the template
        # template_path = os.path.join(module_base_path, 'Templates')
        # template_path = os.path.join(template_path, 'script_template.py')
        #
        # ImportCQ.open(template_path) 
开发者ID:jmwright,项目名称:cadquery-freecad-module,代码行数:43,代码来源:InitGui.py

示例10: populateParameterEditor

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def populateParameterEditor(parameters):
    """Puts the proper controls in the script variable editor pane based on the parameters found"""

    mw = FreeCADGui.getMainWindow()

    # If the widget is open, we need to close it
    dockWidgets = mw.findChildren(QtGui.QDockWidget)
    for widget in dockWidgets:
        if widget.objectName() == "cqVarsEditor":
            gridLayout = QtGui.QGridLayout()

            line = 1

            # Add controls for all the parameters so that they can be edited from the GUI
            for pKey, pVal in list(parameters.items()):
                label = QtGui.QLabel(pKey)

                # We want to keep track of this parameter value field so that we can pull its value later when executing
                value = QtGui.QLineEdit()
                value.setText(str(pVal.default_value))
                value.setObjectName("pcontrol_" + pKey)

                # Add the parameter control sets, one set per line
                gridLayout.addWidget(label, line, 0)
                gridLayout.addWidget(value, line, 1)

                line += 1

            # Create a widget we can put the layout in and add a scrollbar
            newWidget = QtGui.QWidget()
            newWidget.setLayout(gridLayout)

            # Add a scroll bar in case there are a lot of variables in the script
            scrollArea = QtGui.QScrollArea()
            scrollArea.setBackgroundRole(QtGui.QPalette.Light)
            scrollArea.setStyleSheet("QLabel { color : black; }");
            scrollArea.setWidget(newWidget)

            widget.setWidget(scrollArea) 
开发者ID:jmwright,项目名称:cadquery-freecad-module,代码行数:41,代码来源:Shared.py

示例11: config

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def config(self):
		self.dialog=HingeWidget(self)
		# self.dialog.show()
		
		mw = FreeCADGui.getMainWindow()
		dock = QtGui.QDockWidget(self.Object.Label, mw)
		dock.setStyleSheet("background-color:lightblue;color:blue;")
		mw.centralWidget = QtGui.QWidget(dock)
		mw.addDockWidget(QtCore.Qt.LeftDockWidgetArea, dock)
		dock.setWidget(self.dialog)
		say("widget set") 
开发者ID:microelly2,项目名称:Animation,代码行数:13,代码来源:transform.py

示例12: close_CQ_Example

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def close_CQ_Example(App, Gui):

    #close the example
    App.setActiveDocument("Ex000_Introduction")
    App.ActiveDocument=App.getDocument("Ex000_Introduction")
    Gui.ActiveDocument=Gui.getDocument("Ex000_Introduction")
    App.closeDocument("Ex000_Introduction")
    FreeCAD.Console.PrintMessage('\r\nEx000 Closed\r\n')

    #Getting the main window will allow us to start setting things up the way we want
    mw = FreeCADGui.getMainWindow()

    #Adjust the docks as usual
    dockWidgets = mw.findChildren(QtGui.QDockWidget)
    for widget in dockWidgets:
        if (widget.objectName() == "Report view") or (widget.objectName() == "Python console") or (widget.objectName() == "Combo View"):
            widget.setVisible(True)
        if (widget.objectName()=="cqCodeView"):
            widget.setVisible(False)
    FreeCAD.Console.PrintMessage('Dock adjusted\r\n')

    return 0


###################################################################
# FuseObjs_wColors()  maui
#   Function to fuse two objects together.
################################################################### 
开发者ID:easyw,项目名称:kicad-3d-models-in-freecad,代码行数:30,代码来源:cq_cad_tools.py

示例13: createConsoleWindow

# 需要导入模块: from PySide import QtGui [as 别名]
# 或者: from PySide.QtGui import QDockWidget [as 别名]
def createConsoleWindow(self):
        '''  The information output shall replace the outputs from the python shell '''

        self.textOutput = windowConsole.WindowConsole(self)
        self.dockTextOutput = QtGui.QDockWidget('Information output', self)
        self.dockTextOutput.setWidget(self.textOutput)
        self.addDockWidget(QtCore.Qt.BottomDockWidgetArea, self.dockTextOutput)
        self._origStdout = sys.stdout
        sys.stdout = self.textOutput  # sometimes causes crashes of Python.exe 
开发者ID:PySimulator,项目名称:PySimulator,代码行数:11,代码来源:PySimulator.py


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