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


Python QWidget.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:34,代码来源:installer.py

示例2: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
    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,代码行数:29,代码来源:qt3_qproc.py

示例3: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
    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:,项目名称:,代码行数:61,代码来源:

示例4: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:10,代码来源:cfgmain.py

示例5: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:11,代码来源:progress.py

示例6: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:14,代码来源:sndcfg.py

示例7: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:15,代码来源:recordedit.py

示例8: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:16,代码来源:differ.py

示例9: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 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,代码行数:19,代码来源:runner.py

示例10: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, parent, name='WinSizeEntryWidget'):
     QWidget.__init__(self, parent, name)
     numrows = 2
     numcols = 2
     margin = 0
     space = 1
     self.grid = QGridLayout(self, numrows, numcols,
                             margin, space, 'WinSizeEntryWidgetLayout')
     self.w_label = QLabel('width', self)
     self.grid.addWidget(self.w_label, 0, 0)
     # should be using KIntSpinBox instead of text entry
     self.w_entry = KLineEdit(self)
     self.grid.addWidget(self.w_entry, 1, 0)
     self.h_label = QLabel('height', self)
     self.grid.addWidget(self.h_label, 0, 1)
     # should be using KIntSpinBox instead of text entry
     self.h_entry = KLineEdit(self)
     self.grid.addWidget(self.h_entry, 1, 1)
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:20,代码来源:config.py

示例11: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, parent, suite, name="RunnerWidget"):
     QWidget.__init__(self, parent, name)
     self.app = get_application_pointer()
     cfg = self.app.umlcfg
     basefile = make_base_filesystem(suite, "%s.base" % suite, cfg=cfg, size=300, mkfs="mke2fs")
     self.bootstrapper = UmlBootstrapper(suite, basefile, cfg=self.cfg)
     self._mainbox = QVBoxLayout(self, 5, 7)
     # add label
     self.mainlabel = QLabel(self)
     self.mainlabel.setText("Bootstrapping suite %s" % suite)
     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,代码行数:20,代码来源:bootstrapper.py

示例12: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, app, parent, name='SuiteTraitCombo'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.suiteCursor = Suites(self.conn)
     self.suites = self.suiteCursor.list()
     self.traits = Traits(self.conn, self.suites[0])
     self.scombo = SuiteCombo(self, self.suites)
     self.tcombo = MyCombo(self, 'TypeCombo')
     self.tcombo.fill(['template', 'script'])
     self.ubutton = KPushButton('update', self)
     self.listView = TraitList(self.app, self)
     self.vbox = QVBoxLayout(self)
     for member in ['listView', 'scombo', 'tcombo', 'ubutton']:
         widget = getattr(self, member)
         self.vbox.addWidget(widget)
     self.connect(self.scombo,
                  SIGNAL('highlighted(int)'), self.update_traits)
     self.connect(self.ubutton,
                  SIGNAL('clicked()'), self.refreshlistView)
开发者ID:BackupTheBerlios,项目名称:paella-svn,代码行数:21,代码来源:differ.py

示例13: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, scene):
     QWidget.__init__(self)
     self.scene = scene
     decorateWindow(self, m18n("Scoring for this Hand"))
     self.nameLabels = [None] * 4
     self.spValues = [None] * 4
     self.windLabels = [None] * 4
     self.wonBoxes = [None] * 4
     self.detailsLayout = [None] * 4
     self.details = [None] * 4
     self.__tilePixMaps = []
     self.__meldPixMaps = []
     grid = QGridLayout(self)
     pGrid = QGridLayout()
     grid.addLayout(pGrid, 0, 0, 2, 1)
     pGrid.addWidget(QLabel(m18nc("kajongg", "Player")), 0, 0)
     pGrid.addWidget(QLabel(m18nc("kajongg", "Wind")), 0, 1)
     pGrid.addWidget(QLabel(m18nc("kajongg", "Score")), 0, 2)
     pGrid.addWidget(QLabel(m18n("Winner")), 0, 3)
     self.detailTabs = QTabWidget()
     self.detailTabs.setDocumentMode(True)
     pGrid.addWidget(self.detailTabs, 0, 4, 8, 1)
     for idx in range(4):
         self.setupUiForPlayer(pGrid, idx)
     self.draw = QCheckBox(m18nc("kajongg", "Draw"))
     self.draw.clicked.connect(self.wonChanged)
     btnPenalties = QPushButton(m18n("&Penalties"))
     btnPenalties.clicked.connect(self.penalty)
     self.btnSave = QPushButton(m18n("&Save Hand"))
     self.btnSave.clicked.connect(self.game.nextScoringHand)
     self.btnSave.setEnabled(False)
     self.setupUILastTileMeld(pGrid)
     pGrid.setRowStretch(87, 10)
     pGrid.addWidget(self.draw, 7, 3)
     self.cbLastTile.currentIndexChanged.connect(self.slotLastTile)
     self.cbLastMeld.currentIndexChanged.connect(self.slotInputChanged)
     btnBox = QHBoxLayout()
     btnBox.addWidget(btnPenalties)
     btnBox.addWidget(self.btnSave)
     pGrid.addLayout(btnBox, 8, 4)
     StateSaver(self)
     self.refresh()
开发者ID:KDE,项目名称:kajongg,代码行数:44,代码来源:scoringdialog.py

示例14: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, parent, action, name='MultiGameProgress'):
     QWidget.__init__(self, parent, name)
     self.app = get_application_pointer()
     self.fhandler = self.app.make_new_fileshandler()
     self.action = action
     self.game_progressBar = KProgress(self)
     self.file_progressBar = KProgress(self)
     self.file_progressBarLbl = QLabel(self)
     self.game_progressBarLbl = QLabel(self)
     self.grid = QGridLayout(self, 4, 1, 5, 7)
     self.grid.addWidget(self.file_progressBarLbl, 0, 0)
     self.grid.addWidget(self.file_progressBar, 1, 0)
     self.grid.addWidget(self.game_progressBarLbl, 2, 0)
     self.grid.addWidget(self.game_progressBar, 3, 0)
     if action == 'prepare_game':
         self.game_action = 'Prepare'
         self.fhandler._report_extract_from_installed_archive = self.report_file_extracted
     else:
         self.game_action = 'Clean up'
         self.fhandler.archivehelper.report_installed_file_handled = self.report_file_handled
开发者ID:BackupTheBerlios,项目名称:dosbox-pykde-svn,代码行数:22,代码来源:progress_dialogs.py

示例15: __init__

# 需要导入模块: from qt import QWidget [as 别名]
# 或者: from qt.QWidget import __init__ [as 别名]
 def __init__(self, parent, name='SettingsWidget'):
     QWidget.__init__(self, parent, name)
开发者ID:umeboshi2,项目名称:lilali,代码行数:4,代码来源:widgets.py


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