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


Python qt.QWidget类代码示例

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


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

示例1: __init__

    def __init__(self):

        QWidget.__init__(self)

        self.textBrowser = QTextBrowser(self)
        self.textBrowser.setTextFormat(QTextBrowser.LogText)
        self.lineEdit = QLineEdit(self)
        self.startButton = QPushButton(self.tr("Start"), self)
        self.stopButton = QPushButton(self.tr("Stop"), self)
        self.stopButton.setEnabled(False)

        self.connect(self.lineEdit, SIGNAL("returnPressed()"), self.startCommand)
        self.connect(self.startButton, SIGNAL("clicked()"), self.startCommand)
        self.connect(self.stopButton, SIGNAL("clicked()"), self.stopCommand)
        layout = QGridLayout(self, 2, 3)
        layout.setSpacing(8)
        layout.addMultiCellWidget(self.textBrowser, 0, 0, 0, 2)
        layout.addWidget(self.lineEdit, 1, 0)
        layout.addWidget(self.startButton, 1, 1)
        layout.addWidget(self.stopButton, 1, 2)



        self.process = QProcess()
        self.connect(self.process, SIGNAL("readyReadStdout()"), self.readOutput)
        self.connect(self.process, SIGNAL("readyReadStderr()"), self.readErrors)
        self.connect(self.process, SIGNAL("processExited()"), self.resetButtons)
开发者ID:emayssat,项目名称:sandbox,代码行数:27,代码来源:qt3_qproc.py

示例2: closeEvent

 def closeEvent( self, event ):
     """Redefinicion del closeEvent de qt"""
     QWidget.closeEvent( self, event )
     if not self.parent.vprincipal.isVisible():
         qApp.exit(0)
     else:
         self.hide()
开发者ID:,项目名称:,代码行数:7,代码来源:

示例3: __init__

 def __init__(self, parent, umlmachines, name="InstallerWidget"):
     QWidget.__init__(self, parent, name)
     self.resize(600, 600)
     self.app = get_application_pointer()
     self.conn = self.app.conn
     self.umlmachines = umlmachines
     self.machine = self.umlmachines.current
     self.current_machine_process = "start"
     self.current_profile = None
     self.current_trait = None
     self.traitlist = []
     self.curenv = CurrentEnvironment(self.conn, self.machine)
     self.curenv["current_profile"] = "None"
     self.curenv["current_trait"] = "None"
     self.curenv["current_machine_process"] = self.current_machine_process
     self.timer = QTimer(self)
     self.connect(self.timer, SIGNAL("timeout()"), self.update_progress)
     self.timer.startTimer(1000)
     self.grid = QGridLayout(self, 4, 1, 5, 7)
     self.main_label = QLabel(self)
     self.main_label.setText(self._msg())
     self.grid.addWidget(self.main_label, 0, 0)
     self.profile_progress_lbl = QLabel(self)
     self.grid.addWidget(self.profile_progress_lbl, 1, 0)
     self.profile_progress = KProgress(self)
     self.grid.addWidget(self.profile_progress, 2, 0)
     self.logview = LogBrowser(self, "/tmp/uml-installer.log")
     self.grid.addWidget(self.logview, 3, 0)
     # self.console_view = StdOutBrowser(self)
     # self.console_view = KTextBrowser(self)
     # self.grid.addWidget(self.console_view, 4, 0)
     self.console_text = ""
开发者ID:joelsefus,项目名称:paella,代码行数:32,代码来源:installer.py

示例4: __init__

    def __init__(self, interfazdato, cajadisponible):
        """Caja disponible son los elementos que aparecen a la izquierda en el selector"""
        #VARIABLES PUBLICAS
        QWidget.__init__(self, None, "selector", 0)

        image1 = QPixmap(IMAGE1DATA)
        image2 = QPixmap(IMAGE2DATA)

        selectorsimplelayout = QHBoxLayout(self, 11, 6, "WSelectorSimpleLayout")
        layout2 = QVBoxLayout(None, 0, 6, "layout2")
        widgetstack1 = QWidgetStack(self, "staaack")
        widgetstack1.addWidget(cajadisponible)
        widgetstack1.raiseWidget(cajadisponible)
        widgetstack1.setSizePolicy(QSizePolicy(\
                QSizePolicy.Expanding, QSizePolicy.Expanding, \
                0, 0, widgetstack1.sizePolicy().hasHeightForWidth()))
        self._cajadisponible = cajadisponible
        layout2.addWidget(widgetstack1)
        selectorsimplelayout.addLayout(layout2)
        
        layout1 = QVBoxLayout(None, 0, 6, "layout1")
        
        self.__pushbutton1 = QPushButton(self, "pushButton1")
        self.__pushbutton1.setMaximumSize(QSize(30, 30))
        self.__pushbutton1.setPixmap(image1)
        layout1.addWidget(self.__pushbutton1)
        spacer1 = QSpacerItem(30, 122, QSizePolicy.Minimum, QSizePolicy.Expanding)
        layout1.addItem(spacer1)
        
        self.__pushbutton2 = QPushButton(self,"pushButton2")
        self.__pushbutton2.setMaximumSize(QSize(30, 30))
        self.__pushbutton2.setPixmap(image2)
        self.__pushbutton2.setAccel("Del")
        layout1.addWidget(self.__pushbutton2)
        selectorsimplelayout.addLayout(layout1)
        
        layout3 = QVBoxLayout(None, 0, 6, "layout3")
        
        self._textlabel2 = QLabel(self, "textLabel2")
        layout3.addWidget(self._textlabel2)
        
        self._cajaseleccion = QListBox(self,"cajaseleccion")
        self._cajaseleccion.setMinimumSize(QSize(0, 60))
        layout3.addWidget(self._cajaseleccion)
        selectorsimplelayout.addLayout(layout3)
        self._cajaseleccion.setSizePolicy(QSizePolicy(\
                QSizePolicy.Expanding,QSizePolicy.Expanding, 0, 0, \
                self._cajaseleccion.sizePolicy().hasHeightForWidth()))
        
        self.setCaption("Form1")
        self._textlabel2.setText(u"Selección")
        
        self.resize(QSize(294, 240).expandedTo(self.minimumSizeHint()))
        self.clearWState(Qt.WState_Polished)
        self.__conexiones()
        #Miembros !qt

        self.seleccion = []
        self._dato = interfazdato
开发者ID:,项目名称:,代码行数:59,代码来源:

示例5: __init__

 def __init__(self, parent, name='TestConfigTab'):
     QWidget.__init__(self, parent, name)
     self.grid = QGridLayout(self, 2, 1, 0, 1, 'TestConfigTabLayout')
     self.textbrowser = KTextBrowser(self)
     self.grid.addWidget(self.textbrowser, 0, 0)
     self.button = KPushButton(self)
     self.button.setText('test get_config')
     self.grid.addWidget(self.button, 1, 0)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:8,代码来源:cfgmain.py

示例6: __init__

 def __init__(self, parent, text='', name='LabeledProgress'):
     QWidget.__init__(self, parent, name)
     self.grid = QGridLayout(self, 2, 1, 5, 7)
     self.label = QLabel(self)
     if text:
         self.label.setText(text)
     self.progressbar = SimpleProgress(self)
     self.grid.addWidget(self.label, 0, 0)
     self.grid.addWidget(self.progressbar, 1, 0)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:9,代码来源:progress.py

示例7: set_board_widget

    def set_board_widget(self, board_widget):
        self.board_widget = board_widget

        layout = QHBoxLayout()
        layout.addWidget(board_widget, 2)
        layout.addWidget(self.create_sidebar_widget())
        central_widget = QWidget(self)
        central_widget.setLayout(layout)
        self.setCentralWidget(central_widget)

        self.repaint()
开发者ID:oleglite,项目名称:checkers,代码行数:11,代码来源:window.py

示例8: __init__

 def __init__(self, parent, name="SoundBlasterHardwareOptions"):
     QWidget.__init__(self, parent, name)
     numrows = 2
     numcols = 1
     margin = 0
     space = 1
     self.grid = QGridLayout(self, numrows, numcols, margin, space, "SoundBlasterHardwareOptionsLayout")
     self._default_oplmodes = ["auto", "cms", "opl2", "dualopl2", "opl3"]
     self.oplmode_box = ConfigComboBoxWidget(self, "OPL mode", self._default_oplmodes)
     self.grid.addWidget(self.oplmode_box, 0, 0)
     self.oplrate_box = SampleRateOption(self, "OPL sample rate")
     self.grid.addWidget(self.oplrate_box, 1, 0)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:12,代码来源:sndcfg.py

示例9: __init__

 def __init__(self, parent, fields=[], data={}, name='VariablesEditor'):
     QWidget.__init__(self, parent, name)
     self.initPaellaCommon()
     self.grid = QGridLayout(self, len(fields), 2, 1, -1, 'VariablesEditorLayout')
     self.fields = fields
     self.fields.sort()
     self._data = data
     self.entries = {}
     self._labels = {}
     if fields:
         self._setup_grid()
     self.grid.setSpacing(7)
     self.grid.setMargin(10)
开发者ID:joelsefus,项目名称:paella,代码行数:13,代码来源:recordedit.py

示例10: setupInputFrame

 def setupInputFrame(self, parent=None):
   if not parent:
     parent = self.layout
   self.bgMultiVolumeSelector = slicer.qMRMLNodeComboBox()
   self.bgMultiVolumeSelector.nodeTypes = ['vtkMRMLMultiVolumeNode']
   self.bgMultiVolumeSelector.setMRMLScene(slicer.mrmlScene)
   self.bgMultiVolumeSelector.addEnabled = 0
   self._bgMultiVolumeSelectorLabel = QLabel('Input multivolume')
   inputFrameWidget = QWidget()
   self.inputFrameLayout = QFormLayout()
   inputFrameWidget.setLayout(self.inputFrameLayout)
   self.inputFrameLayout.addRow(self._bgMultiVolumeSelectorLabel, self.bgMultiVolumeSelector)
   parent.addWidget(inputFrameWidget)
开发者ID:naucoin,项目名称:MultiVolumeExplorer,代码行数:13,代码来源:qSlicerMultiVolumeExplorerModuleWidget.py

示例11: __init__

 def __init__(self, app, parent, dtype='trait', name='BaseDiffer'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.dtype = dtype
     if dtype == 'trait':
         boxtype = SuiteTraitCombo
     elif dtype == 'family':
         boxtype = FamilyList
     self.leftBox = boxtype(self.app, self, 'leftBox')
     self.rightBox = boxtype(self.app, self, 'rightBox')
     self.vbox = QVBoxLayout(self)
     self.list_hbox = QHBoxLayout(self.vbox, 5)
     self.list_hbox.addWidget(self.leftBox)
     self.list_hbox.addWidget(self.rightBox)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:14,代码来源:differ.py

示例12: setup

  def setup(self):
    self.widget = QWidget()
    layout = QGridLayout()
    self.widget.setLayout(layout)
    self.layout.addWidget(self.widget)
    self.widget.show()
    self.layout = layout

    self.setupInputFrame()
    self.setupFrameControlFrame()
    self.setupAdditionalFrames()
    self.setupPlottingFrame()

    self.setFramesEnabled(False)

    self.timer = QTimer()
    self.timer.setInterval(50)

    self.setupConnections()

    # initialize slice observers (from DataProbe.py)
    # keep list of pairs: [observee,tag] so they can be removed easily
    self.styleObserverTags = []
    # keep a map of interactor styles to sliceWidgets so we can easily get sliceLogic
    self.sliceWidgetsPerStyle = {}
    self.refreshObservers()
开发者ID:naucoin,项目名称:MultiVolumeExplorer,代码行数:26,代码来源:qSlicerMultiVolumeExplorerModuleWidget.py

示例13: create_sidebar_widget

    def create_sidebar_widget(self):
        self.lcd_widget = QLCDNumber(self)
        self.lcd_widget.setFixedHeight(100)
        self.set_score(0, 0)
        self.log_widget = QPlainTextEdit(self)

        sidebar = QWidget(self)
        sidebar_layout = QVBoxLayout()
        sidebar_layout.addWidget(self.lcd_widget)
        sidebar_layout.addWidget(self.log_widget)
        sidebar.setLayout(sidebar_layout)

        sidebar.setFixedWidth(250)


        return sidebar
开发者ID:oleglite,项目名称:checkers,代码行数:16,代码来源:window.py

示例14: sizeHint

 def sizeHint(self):
     """we never want a horizontal scrollbar for player names,
     we always want to see them in full"""
     result = QWidget.sizeHint(self)
     available = KApplication.kApplication().desktop().availableGeometry()
     height = max(result.height(), available.height() * 2 // 3)
     width = max(result.width(), available.width() // 2)
     return QSize(width, height)
开发者ID:KDE,项目名称:kajongg,代码行数:8,代码来源:rulesetselector.py

示例15: __init__

 def __init__(self, parent, umlmachines, name='RunnerWidget'):
     QWidget.__init__(self, parent, name)
     self.app = get_application_pointer()
     self.umlmachines = umlmachines
     self.proc = self.umlmachines.run_machine()
     self._mainbox = QVBoxLayout(self, 5, 7)
     # add label
     self.mainlabel = QLabel(self)
     self.mainlabel.setText('Running Umlmachine %s' % self.umlmachines.current)
     self._mainbox.addWidget(self.mainlabel)
     # add stdout viewer
     logfile = self.umlmachines.stdout_logfile.name
     self.logbrowser = LogBrowser(self, logfile)
     self._mainbox.addWidget(self.logbrowser)
     self.timer = QTimer(self)
     self.connect(self.timer, SIGNAL('timeout()'), self.update_progress)
     self.timer.startTimer(1000)
开发者ID:joelsefus,项目名称:paella,代码行数:17,代码来源:runner.py


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