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


Python QWidget.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
    def __init__(self):
        QWidget.__init__(self)

        self.setWindowTitle( 'Biofeedback' )

        self.button_start = QPushButton()
        self.button_start.setText("START")
        self.button_stop = QPushButton()
        self.button_stop.setText("STOP")

        layout = QHBoxLayout(self)
        layout.addWidget(self.button_start)
        layout.addWidget(self.button_stop)

        self.connect(self.button_start, SIGNAL("clicked(bool)"), self.start_session)
        self.connect(self.button_stop, SIGNAL("clicked(bool)"), self.stop_session)

        self.setLayout(layout)
        self.setGeometry(300,100,250,100)
        self.show()

        #self.datastorage = DataStorage()
        #settings = {'db_host':'amber','db_user':'root','db_pwd':'dbrootpass','db_dbname':'biodb'}
        #self.datastorage.enableDbStorage(settings)


        self.thread = ConnectionThread()
开发者ID:darkopetrovic,项目名称:ZephyrApp,代码行数:29,代码来源:zephyr_test_nogui.py

示例2: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        font = QFont(get_family(MONOSPACE), 10, QFont.Normal)

        info_icon = QLabel()
        icon = get_std_icon("MessageBoxInformation").pixmap(24, 24)
        info_icon.setPixmap(icon)
        info_icon.setFixedWidth(32)
        info_icon.setAlignment(Qt.AlignTop)

        self.service_status_label = QLabel()
        self.service_status_label.setWordWrap(True)
        self.service_status_label.setAlignment(Qt.AlignTop)
        self.service_status_label.setFont(font)

        self.desc_label = QLabel()
        self.desc_label.setWordWrap(True)
        self.desc_label.setAlignment(Qt.AlignTop)
        self.desc_label.setFont(font)

        self.group_desc = QGroupBox("Description", self)
        layout = QHBoxLayout()
        layout.addWidget(info_icon)
        layout.addWidget(self.desc_label)
        layout.addStretch()
        layout.addWidget(self.service_status_label)

        self.group_desc.setLayout(layout)

        self.editor = CodeEditor(self)
        self.editor.setup_editor(linenumbers=True, font=font)
        self.editor.setReadOnly(False)
        self.group_code = QGroupBox("Source code", self)
        layout = QVBoxLayout()
        layout.addWidget(self.editor)
        self.group_code.setLayout(layout)

        self.enable_button = QPushButton(get_icon("apply.png"), "Enable", self)

        self.save_button = QPushButton(get_icon("filesave.png"), "Save", self)

        self.disable_button = QPushButton(get_icon("delete.png"), "Disable", self)

        self.refresh_button = QPushButton(get_icon("restart.png"), "Refresh", self)
        hlayout = QHBoxLayout()
        hlayout.addWidget(self.save_button)
        hlayout.addWidget(self.enable_button)
        hlayout.addWidget(self.disable_button)
        hlayout.addWidget(self.refresh_button)

        vlayout = QVBoxLayout()
        vlayout.addWidget(self.group_desc)
        vlayout.addWidget(self.group_code)
        self.html_window = HTMLWindow()
        vlayout.addWidget(self.html_window)

        vlayout.addLayout(hlayout)
        self.setLayout(vlayout)

        self.current_file = None
开发者ID:hutchic,项目名称:dd-agent,代码行数:62,代码来源:gui.py

示例3: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent, x, y, func):
     QWidget.__init__(self, parent)
     self.setMinimumSize(320, 200)
     self.x = x
     self.y = y
     self.func = func
     #---guiqwt curve item attribute:
     self.curve_item = None
开发者ID:HaMF,项目名称:guiqwt,代码行数:10,代码来源:filtertest1.py

示例4: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
    def __init__(self, parent, options=None):
        QWidget.__init__(self, parent=parent)

        if options is None:
            options = {}
        self.imagewidget = ImageWidget(self, **options)
        self.imagewidget.register_all_image_tools()

        hlayout = QHBoxLayout()
        self.add_buttons_to_layout(hlayout)
        
        vlayout = QVBoxLayout()
        vlayout.addWidget(self.imagewidget)
        vlayout.addLayout(hlayout)
        self.setLayout(vlayout)
开发者ID:alimuldal,项目名称:guiqwt,代码行数:17,代码来源:base.py

示例5: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
    def __init__(self, parent):
        QWidget.__init__(self, parent)

        layout = QGridLayout()
        self.setLayout(layout)

        self.plot1 = ImagePlot(self)
        layout.addWidget(self.plot1, 0, 0, 1, 1)
        self.plot2 = ImagePlot(self)
        layout.addWidget(self.plot2, 1, 0, 1, 1)

        self.contrast = ContrastAdjustment(self)
        layout.addWidget(self.contrast, 2, 0, 1, 2)
        self.itemlist = PlotItemList(self)
        layout.addWidget(self.itemlist, 0, 1, 2, 1)

        self.manager = PlotManager(self)
        for plot in (self.plot1, self.plot2):
            self.manager.add_plot(plot)
        for panel in (self.itemlist, self.contrast):
            self.manager.add_panel(panel)
开发者ID:gyenney,项目名称:Tools,代码行数:23,代码来源:manager.py

示例6: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     font = QFont(get_family(MONOSPACE), 10, QFont.Normal)
     
     info_icon = QLabel()
     icon = get_std_icon('MessageBoxInformation').pixmap(24, 24)
     info_icon.setPixmap(icon)
     info_icon.setFixedWidth(32)
     info_icon.setAlignment(Qt.AlignTop)
     self.desc_label = QLabel()
     self.desc_label.setWordWrap(True)
     self.desc_label.setAlignment(Qt.AlignTop)
     self.desc_label.setFont(font)
     group_desc = QGroupBox(_("Description"), self)
     layout = QHBoxLayout()
     layout.addWidget(info_icon)
     layout.addWidget(self.desc_label)
     group_desc.setLayout(layout)
     
     self.editor = CodeEditor(self)
     self.editor.setup_editor(linenumbers=True, font=font)
     self.editor.setReadOnly(True)
     group_code = QGroupBox(_("Source code"), self)
     layout = QVBoxLayout()
     layout.addWidget(self.editor)
     group_code.setLayout(layout)
     
     self.run_button = QPushButton(get_icon("apply.png"),
                                   _("Run this script"), self)
     self.quit_button = QPushButton(get_icon("exit.png"), _("Quit"), self)
     hlayout = QHBoxLayout()
     hlayout.addWidget(self.run_button)
     hlayout.addStretch()
     hlayout.addWidget(self.quit_button)
     
     vlayout = QVBoxLayout()
     vlayout.addWidget(group_desc)
     vlayout.addWidget(group_code)
     vlayout.addLayout(hlayout)
     self.setLayout(vlayout)
开发者ID:stonebig,项目名称:guidata,代码行数:42,代码来源:guitest.py

示例7: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     layout = QHBoxLayout()
     row_nb = 14
     cindex = 0
     for child in dir(QStyle):
         if child.startswith('SP_'):
             if cindex == 0:
                 col_layout = QVBoxLayout()
             icon_layout = QHBoxLayout()
             icon = get_std_icon(child)
             label = QLabel()
             label.setPixmap(icon.pixmap(32, 32))
             icon_layout.addWidget( label )
             icon_layout.addWidget( QLineEdit(child.replace('SP_', '')) )
             col_layout.addLayout(icon_layout)
             cindex = (cindex+1) % row_nb
             if cindex == 0:
                 layout.addLayout(col_layout)                    
     self.setLayout(layout)
     self.setWindowTitle('Standard Platform Icons')
     self.setWindowIcon(get_std_icon('TitleBarMenuButton'))
开发者ID:Alwnikrotikz,项目名称:guidata,代码行数:24,代码来源:qthelpers.py

示例8: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
    def __init__(self, parent):
        QWidget.__init__(self, parent)
        font = QFont(get_family(MONOSPACE), 10, QFont.Normal)
        
        info_icon = QLabel()
        icon = get_std_icon('MessageBoxInformation').pixmap(24, 24)
        info_icon.setPixmap(icon)
        info_icon.setFixedWidth(32)
        info_icon.setAlignment(Qt.AlignTop)

        self.service_status_label = QLabel()
        self.service_status_label.setWordWrap(True)
        self.service_status_label.setAlignment(Qt.AlignTop)
        self.service_status_label.setFont(font)

        self.desc_label = QLabel()
        self.desc_label.setWordWrap(True)
        self.desc_label.setAlignment(Qt.AlignTop)
        self.desc_label.setFont(font)

        group_desc = QGroupBox("Description", self)
        layout = QHBoxLayout()
        layout.addWidget(info_icon)
        layout.addWidget(self.desc_label)
        layout.addStretch()
        layout.addWidget(self.service_status_label  )

        group_desc.setLayout(layout)
        
        self.editor = CodeEditor(self)
        self.editor.setup_editor(linenumbers=True, font=font)
        self.editor.setReadOnly(False)
        group_code = QGroupBox("Source code", self)
        layout = QVBoxLayout()
        layout.addWidget(self.editor)
        group_code.setLayout(layout)
        
        self.enable_button = QPushButton(get_icon("apply.png"),
                                      "Enable", self)

        self.save_button = QPushButton(get_icon("filesave.png"),
                                      "Save", self)

        self.edit_datadog_conf_button = QPushButton(get_icon("edit.png"),
                                      "Edit agent settings", self)

        self.disable_button = QPushButton(get_icon("delete.png"),
                                      "Disable", self)


        self.view_log_button = QPushButton(get_icon("txt.png"), 
                                      "View log", self)

        self.menu_button = QPushButton(get_icon("settings.png"),
                                      "Manager", self)



        hlayout = QHBoxLayout()
        hlayout.addWidget(self.save_button)
        hlayout.addStretch()
        hlayout.addWidget(self.enable_button)
        hlayout.addStretch()
        hlayout.addWidget(self.disable_button)
        hlayout.addStretch()
        hlayout.addWidget(self.edit_datadog_conf_button)
        hlayout.addStretch()
        hlayout.addWidget(self.view_log_button)
        hlayout.addStretch()
        hlayout.addWidget(self.menu_button)
        
        vlayout = QVBoxLayout()
        vlayout.addWidget(group_desc)
        vlayout.addWidget(group_code)
        vlayout.addLayout(hlayout)
        self.setLayout(vlayout)

        self.current_file = None
开发者ID:arthurnn,项目名称:dd-agent,代码行数:80,代码来源:gui.py

示例9: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, wintitle=None, icon="guiqwt.svg", toolbar=False,
              options=None, parent=None, panels=None,
              param_cols=1, legend_anchor='TR', auto_fit=False):
     QWidget.__init__(self, parent)
     FitWidgetMixin.__init__(self, wintitle, icon, toolbar, options, panels,
                             param_cols, legend_anchor, auto_fit)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:8,代码来源:fit.py

示例10: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent):
     if PYQT5:
         super(DockableWidget, self).__init__(parent, parent=parent)
     else:
         QWidget.__init__(self, parent)
         DockableWidgetMixin.__init__(self, parent)
开发者ID:CaptainAL,项目名称:Spyder,代码行数:8,代码来源:qtwidgets.py

示例11: __init__

# 需要导入模块: from guidata.qt.QtGui import QWidget [as 别名]
# 或者: from guidata.qt.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent):
     QWidget.__init__(self, parent)
     DockableWidgetMixin.__init__(self, parent)
开发者ID:Alwnikrotikz,项目名称:guidata,代码行数:5,代码来源:qtwidgets.py


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