當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。