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


Python QWidget.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
	def __init__(self):
		QWidget.__init__(self)
		rp = rospkg.RosPack()
		ui_file = os.path.join(rp.get_path('rqt_bag_annotation'), 'resource', 'export_widget.ui')
		loadUi(ui_file, self)

		self.add_topic_button.setIcon(QIcon.fromTheme('list-add'))
		self.remove_topic_button.setIcon(QIcon.fromTheme('list-remove'))
		self.refresh_button.setIcon(QIcon.fromTheme('view-refresh'))

		self.add_topic_button.clicked[bool].connect(self._handle_add_topic_clicked)
		self.remove_topic_button.clicked[bool].connect(self._handle_remove_topic_clicked)
		self.refresh_button.clicked[bool].connect(self._handle_refresh_clicked)
		self.export_button.clicked[bool].connect(self._handle_export_clicked)

		self.export_location_edit.setPlainText("./export_file.txt")
		self.rospack = rospkg.RosPack()

		self._exported_topics = list()
		self._exported_publisher_info = list()
		self._annotations = list()
		self._active_topics = list()
		self._dt = 0.1

		self._current_topic_paths = dict()
		self._current_msg_paths = dict()
		self._id_counter = 0
		self.current_output = ""
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:30,代码来源:export_widget.py

示例2: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent=None):
     QWidget.__init__(self, parent)
     self.setObjectName("MainBox")
     self.__on_intern_change = False
     boxLayout = QFormLayout()
     boxLayout.setVerticalSpacing(0)
     self.setLayout(boxLayout)
开发者ID:fkie,项目名称:multimaster_fkie,代码行数:9,代码来源:select_dialog.py

示例3: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
	def __init__(self, timeline_frame):
		QWidget.__init__(self)
		self.timeline_frame = timeline_frame
		rp = rospkg.RosPack()
		ui_file = os.path.join(rp.get_path('rqt_bag_annotation'), 'resource', 'annotation_widget.ui')

		loadUi(ui_file, self)
		self.setObjectName('AnnotationWidget')
		rd_file = os.path.join(rp.get_path('turtlebot_description'), 'robots', 'kobuki_hexagons_kinect.urdf.xacro')
		a = xacro.parse(rd_file)
		xacro.process_includes(a, rd_file)
		xacro.eval_self_contained(a)
		rospy.set_param('robot_description', a.toxml()) 
		
		self._cur_annotation = None
		self.save_button.clicked[bool].connect(self.save)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:18,代码来源:annotation_widget.py

示例4: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, path, parent=None):
     QWidget.__init__(self, parent)
     self.path = path
     self._layout = QHBoxLayout(self)
     self._layout.setContentsMargins(0, 0, 0, 0)
     self._layout.setSpacing(0)
     self._button = QPushButton('...')
     self._button.setMaximumSize(QSize(24, 20))
     self._button.clicked.connect(self._on_path_select_clicked)
     self._layout.addWidget(self._button)
     self._lineedit = QLineEdit(path)
     self._lineedit.returnPressed.connect(self._on_editing_finished)
     self._layout.addWidget(self._lineedit)
     self.setLayout(self._layout)
     self.setFocusProxy(self._button)
     self.setAutoFillBackground(True)
开发者ID:fkie,项目名称:multimaster_fkie,代码行数:18,代码来源:settings_widget.py

示例5: __init__

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

        # start widget
        vbox = QVBoxLayout()
        vbox.setMargin(0)
        vbox.setContentsMargins(0, 0, 0, 0)

        # add error status text edit
        self.error_status_text_box = QErrorStatusTextBox()
        self.error_status_text_box_layout = QHBoxLayout()
        self.error_status_text_box_layout.addWidget(self.error_status_text_box)
        vbox.addLayout(self.error_status_text_box_layout)

        # add panel
        hbox = QHBoxLayout()

        # clear push button
        self.execute_command = QPushButton("Clear")
        self.execute_command.clicked.connect(self.error_status_text_box.clear)
        hbox.addWidget(self.execute_command)

        hbox.addStretch()

        # hide window checkbox
        hide_window_check_box = QCheckBox("Hide")
        hide_window_check_box.stateChanged.connect(self.state_changed)
        hbox.addWidget(hide_window_check_box)

        # end panel
        vbox.addLayout(hbox)

        # end widget
        self.setLayout(vbox)
        #self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)

        # subscriber
        if (subscribe):
            self.error_status_sub = rospy.Subscriber("error_status", ErrorStatus, self.error_status_callback)
        self.subscribed = subscribe

        # connect signal slot internally to prevent crash by subscriber
        self.error_status_signal.connect(self.append_error_status)
开发者ID:TRECVT,项目名称:vigir_footstep_planning_basics,代码行数:45,代码来源:error_status_widget.py

示例6: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
    def __init__(self, parent = None, topic_type = str(), is_action_topic = False):
        QWidget.__init__(self, parent)

        if is_action_topic:
            self.topic_type = topic_type + "Goal"
        else:
            self.topic_type = topic_type
        self.is_action_topic = is_action_topic

        # start widget
        hbox = QHBoxLayout()
        hbox.setMargin(0)
        hbox.setContentsMargins(0, 0, 0, 0)

        # topic combo box
        self.topic_combo_box = QComboBox()
        self.topic_combo_box.setEnabled(False)
        self.topic_combo_box.blockSignals(True)
        self.topic_combo_box.setValidator(QRegExpValidator(QRegExp('((\d|\w|/)(?!//))*'), self))
        self.topic_combo_box.currentIndexChanged[str].connect(self.topic_changed)
        hbox.addWidget(self.topic_combo_box)

        # get system icon
        icon = QIcon.fromTheme("view-refresh")
        size = icon.actualSize(QSize(32, 32))

        # add refresh button
        refresh_topics_button = QPushButton()
        refresh_topics_button.clicked.connect(self.update_topic_list)
        refresh_topics_button.setIcon(icon)
        refresh_topics_button.setFixedSize(size.width()+2, size.height()+2)
        hbox.addWidget(refresh_topics_button)

        # end widget
        self.setLayout(hbox)

        # init widget
        self.update_topic_list()
开发者ID:TRECVT,项目名称:vigir_footstep_planning_basics,代码行数:40,代码来源:topic_widget.py

示例7: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, parent = None, logger = Logger()):
     QWidget.__init__(self, parent)
     self.set_logger(logger)
开发者ID:TRECVT,项目名称:vigir_footstep_planning_basics,代码行数:5,代码来源:logging.py

示例8: __init__

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import __init__ [as 别名]
 def __init__(self, *args):
     QWidget.__init__(self, *args)
     self.edit = None
     # it is the highest line that is currently visible.
     self.highest_line = 0
开发者ID:zhouchengming1,项目名称:multimaster_fkie,代码行数:7,代码来源:line_number_widget.py


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