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


Python QtGui.QWidget方法代码示例

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


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

示例1: fromUi

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def fromUi(*args, **kwargs):
    """ Returns a Qt object constructed using loadUiType
    based on its arguments. All QWidget objects in the
    form class are set in the returned object for easy
    accessability.
    """
    form_class, base_class = loadUiType(*args, **kwargs)
    widget = base_class()
    form = form_class()
    form.setupUi(widget)
    form.retranslateUi(widget)
    for name in dir(form):
        element = getattr(form, name)
        if isinstance(element, QtGui.QWidget):
            setattr(widget, name, element)
    return widget 
开发者ID:ralph-group,项目名称:pymeasure,代码行数:18,代码来源:Qt.py

示例2: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setFixedSize(QtCore.QSize(600, 400))
        w = QtGui.QWidget()
        self.setCentralWidget(w)
        vlayout = QtGui.QVBoxLayout()
        w.setLayout(vlayout)
        self.htmlView = QtWidgets.QTextBrowser(self)
        font = QtGui.QFont()
        font.setFamily('Arial')
        self.htmlView.setReadOnly(True)
        self.htmlView.setFont(font)
        self.htmlView.setOpenExternalLinks(True)
        self.htmlView.setObjectName('Help information')
        html_help_path = get_source_name('docs/help.html')
        ret = self.htmlView.setSource(QtCore.QUrl(html_help_path))
        print('load result:', ret)
#         self.htmlView.append(ret)
        vlayout.addWidget(self.htmlView) 
开发者ID:Marxlp,项目名称:pyFlightAnalysis,代码行数:21,代码来源:widgets.py

示例3: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self):
        # Here, you should call the inherited class' init, which is QDialog
        QtGui.QWidget.__init__(self)
        
        print("UIFO - UI Info constructor")
        
        # Window settings
        #self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.setWindowTitle('Astibot Information')
        self.setStyleSheet("background-color:#203044;")
        self.setWindowIcon(QtGui.QIcon("AstibotIcon.png"))
        self.setAutoFillBackground(True);
        self.setFixedSize(1060, 750)
        
        # Build layout
        self.BuildWindowLayout() 
开发者ID:Florian455,项目名称:Astibot,代码行数:18,代码来源:UIInfo.py

示例4: initWindow

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def initWindow(self):
        self.setWindowTitle('Real-time GCC-NMF')
        
        self.mainWidget = QtGui.QWidget()
        self.setCentralWidget(self.mainWidget)
        self.backgroundColor = self.mainWidget.palette().color(QtGui.QPalette.Background)
        self.borderColor = 'k'
        self.mainWidget.setStyleSheet('QSplitter::handle {image: url(images/notExists.png); background-color: #D8D8D8}')
        
        self.mainLayout = QtGui.QGridLayout()
        self.mainWidget.setLayout(self.mainLayout)
        self.mainWidget.setAutoFillBackground(True)
        p = QtGui.QPalette(self.mainWidget.palette())
        p.setColor(self.mainWidget.backgroundRole(), QtCore.Qt.black)
        self.mainWidget.setPalette(p)
        
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.mainLayout.setSpacing(1) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:20,代码来源:gccNMFInterface.py

示例5: initControlWidgets

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def initControlWidgets(self):
        self.initMaskFunctionControls()
        self.initMaskFunctionPlot()
        self.initNMFControls()
        self.initLocalizationControls()
        self.initUIControls()
         
        controlWidgetsLayout = QtGui.QVBoxLayout()
        controlWidgetsLayout.addWidget(self.gccPHATPlotWidget)
        controlWidgetsLayout.addLayout(self.maskFunctionControlslayout)
        self.addSeparator(controlWidgetsLayout)
        controlWidgetsLayout.addLayout(self.nmfControlsLayout)
        controlWidgetsLayout.addLayout(self.localizationControlsLayout)
        self.addSeparator(controlWidgetsLayout)
        controlWidgetsLayout.addWidget(self.uiConrolsWidget)
        
        self.controlsWidget = QtGui.QWidget()
        self.controlsWidget.setLayout(controlWidgetsLayout)
        self.controlsWidget.setAutoFillBackground(True) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:21,代码来源:gccNMFInterface.py

示例6: initUIControls

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def initUIControls(self):
        self.uiConrolsWidget = QtGui.QWidget()
        buttonBarWidgetLayout = QtGui.QHBoxLayout(spacing=0)
        buttonBarWidgetLayout.setContentsMargins(0, 0, 0, 0)
        buttonBarWidgetLayout.setSpacing(0)
        self.uiConrolsWidget.setLayout(buttonBarWidgetLayout)
        
        def addButton(label, widget=None, function=None):
            button = QtGui.QPushButton(label)
            if function is None:
                button.clicked.connect(lambda: widget.setVisible(widget.isHidden()))
            else:
                button.clicked.connect(function)
            button.setStyleSheet('QPushButton {'
                                 'border-color: black;'
                                 'border-width: 5px;}')
            buttonBarWidgetLayout.addWidget(button)
            return button

        addButton('Info', function=self.toggleInfoViews)
        self.toggleSeparationButton = addButton(self.separationOnIconString, function=self.toggleSeparation)
        self.playPauseButton = addButton(self.playIconString, function=self.togglePlay) 
开发者ID:seanwood,项目名称:gcc-nmf,代码行数:24,代码来源:gccNMFInterface.py

示例7: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_Form()
        self.cw = QtGui.QWidget()
        self.setCentralWidget(self.cw)
        self.ui.setupUi(self.cw)

        self.codeBtn = QtGui.QPushButton('Run Edited Code')
        self.codeLayout = QtGui.QGridLayout()
        self.ui.codeView.setLayout(self.codeLayout)
        self.codeLayout.addItem(QtGui.QSpacerItem(100,100,QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Expanding), 0, 0)
        self.codeLayout.addWidget(self.codeBtn, 1, 1)
        self.codeBtn.hide()

        global examples
        self.itemCache = []
        self.populateTree(self.ui.exampleTree.invisibleRootItem(), examples)
        self.ui.exampleTree.expandAll()

        self.resize(1000,500)
        self.show()
        self.ui.splitter.setSizes([250,750])
        self.ui.loadBtn.clicked.connect(self.loadFile)
        self.ui.exampleTree.currentItemChanged.connect(self.showFile)
        self.ui.exampleTree.itemDoubleClicked.connect(self.loadFile)
        self.ui.codeView.textChanged.connect(self.codeEdited)
        self.codeBtn.clicked.connect(self.runEditedCode) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:29,代码来源:__main__.py

示例8: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self):
        QtGui.QWidget.__init__(self)
        
        self.animations = []
        self.animTimer = QtCore.QTimer()
        self.animTimer.timeout.connect(self.stepAnimation)
        self.animTime = 0
        self.animDt = .016
        self.lastAnimTime = 0
        
        self.setupGUI()
        
        self.objectGroup = ObjectGroupParam()
        
        self.params = Parameter.create(name='params', type='group', children=[
            dict(name='Load Preset..', type='list', values=[]),
            #dict(name='Unit System', type='list', values=['', 'MKS']),
            dict(name='Duration', type='float', value=10.0, step=0.1, limits=[0.1, None]),
            dict(name='Reference Frame', type='list', values=[]),
            dict(name='Animate', type='bool', value=True),
            dict(name='Animation Speed', type='float', value=1.0, dec=True, step=0.1, limits=[0.0001, None]),
            dict(name='Recalculate Worldlines', type='action'),
            dict(name='Save', type='action'),
            dict(name='Load', type='action'),
            self.objectGroup,
            ])
        self.tree.setParameters(self.params, showTop=False)
        self.params.param('Recalculate Worldlines').sigActivated.connect(self.recalculate)
        self.params.param('Save').sigActivated.connect(self.save)
        self.params.param('Load').sigActivated.connect(self.load)
        self.params.param('Load Preset..').sigValueChanged.connect(self.loadPreset)
        self.params.sigTreeStateChanged.connect(self.treeChanged)
        
        ## read list of preset configs
        presetDir = os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])), 'presets')
        if os.path.exists(presetDir):
            presets = [os.path.splitext(p)[0] for p in os.listdir(presetDir)]
            self.params.param('Load Preset..').setLimits(['']+presets) 
开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:40,代码来源:relativity.py

示例9: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self, parent=None, size=(5.0, 4.0), dpi=100):
        QtGui.QWidget.__init__(self)
        super(MatplotlibWidget, self).__init__(parent)
        self.fig = Figure(size, dpi=dpi)
        self.canvas = FigureCanvas(self.fig)
        self.canvas.setParent(self)
        # self.toolbar = NavigationToolbar(self.canvas, self)
        
        self.vbox = QtGui.QVBoxLayout()
        # self.vbox.addWidget(self.toolbar)
        self.vbox.addWidget(self.canvas)
        
        self.setLayout(self.vbox) 
开发者ID:salan668,项目名称:FAE,代码行数:15,代码来源:MatplotlibWidget.py

示例10: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self, settings):
        # Here, you should call the inherited class' init, which is QDialog
        QtGui.QWidget.__init__(self)
        
        print("UIST - UI Settings constructor")
        
        # Application settings data instance
        self.theSettings = settings
        
        # Window settings
        self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.setWindowTitle('Astibot Settings')
        self.setStyleSheet("background-color:#203044;")
        self.setWindowIcon(QtGui.QIcon("AstibotIcon.png"))
        self.setAutoFillBackground(True);
        self.setFixedSize(646, 610)
        
        # Build layout
        self.BuildWindowLayout()
        
        # Timer to make API textboxes blink
        self.timerBlinkStuffs = QtCore.QTimer()
        self.timerBlinkStuffs.timeout.connect(self.TimerRaisedBlinkStuff)    
        self.blinkIsOn = False
        self.blinkCounter = 0
              
        # Apply saved (or default) settings
        self.ApplySettings() 
开发者ID:Florian455,项目名称:Astibot,代码行数:30,代码来源:UISettings.py

示例11: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self, settings):
        # Here, you should call the inherited class' init, which is QDialog
        QtGui.QWidget.__init__(self)
        
        print("UIDO - UI Donating constructor")
        
        # Application settings data instance
        self.theSettings = settings
        
        # Functional
        self.BTCBalance = -1.0
        self.windowIsShown = False
        self.timerRefreshBTCBalance = QtCore.QTimer()
        self.timerRefreshBTCBalance.timeout.connect(self.TimerRaisedRefreshBTCBalance)
        self.timerRefreshBTCBalance.start(200)
        self.withdrawHasBeenPerformed = False
    
        # Window settings
        self.setWindowModality(QtCore.Qt.ApplicationModal)
        self.setWindowTitle('Astibot')
        self.setStyleSheet("background-color:#203044;")
        self.setWindowIcon(QtGui.QIcon("AstibotIcon.png"))
        self.setAutoFillBackground(True);
        self.setFixedSize(450, 350)
        
        # Build layout
        self.BuildWindowLayout() 
开发者ID:Florian455,项目名称:Astibot,代码行数:29,代码来源:UIDonation.py

示例12: __init__

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def __init__(self, width=300, height=300):
        QtGui.QWidget.__init__(self)
        self.image = None
        self.lut=None
        self.init(width, height) 
开发者ID:FabianIsensee,项目名称:BatchViewer,代码行数:7,代码来源:batchviewer.py

示例13: widget

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 3, 1)

        return w 
开发者ID:strfry,项目名称:OpenNFB,代码行数:14,代码来源:emg.py

示例14: widget

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 3, 1)
        layout.addWidget(self.DCOSC.widget(), 3, 1)

        return w 
开发者ID:strfry,项目名称:OpenNFB,代码行数:16,代码来源:multiband.py

示例15: widget

# 需要导入模块: from pyqtgraph.Qt import QtGui [as 别名]
# 或者: from pyqtgraph.Qt.QtGui import QWidget [as 别名]
def widget(self):
        w = QtGui.QWidget()
        layout = QtGui.QGridLayout()
        w.setLayout(layout)

        layout.addWidget(self.OSC1.widget(), 0, 0)
        layout.addWidget(self.OSC2.widget(), 1, 0)
        layout.addWidget(self.OSC3.widget(), 2, 0)
        layout.addWidget(self.OSC4.widget(), 3, 0)

        layout.addWidget(self.Spec.widget(), 0, 1, 4, 1)

        return w 
开发者ID:strfry,项目名称:OpenNFB,代码行数:15,代码来源:smr.py


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