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


Python QVBoxLayout.addWidget方法代码示例

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


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

示例1: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, parent = None, logger = Logger()):
        QWidgetWithLogger.__init__(self, parent, logger)

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

        # parameter action server topic selection
        topic_widget = QTopicWidget(self, 'vigir_footstep_planning_msgs/GetParameterSetNamesAction', True)
        vbox.addWidget(topic_widget)

        # parameter set selection
        self.parameter_set_selection_widget = QParameterSetSelectionWidget(self, logger)
        self.parameter_set_selection_widget.param_cleared_signal.connect(self.param_cleared)
        self.parameter_set_selection_widget.param_changed_signal.connect(self.param_changed)
        topic_widget.topic_changed_signal.connect(self.topic_changed)
        topic_widget.topic_changed_signal.connect(self.parameter_set_selection_widget.set_topic_name)
        vbox.addWidget(self.parameter_set_selection_widget)

        # end widget
        self.setLayout(vbox)

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

示例2: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, parent=None, current_values=None):
        super(BlacklistDialog, self).__init__(parent)
        self.setWindowTitle("Blacklist")
        vbox = QVBoxLayout()
        self.setLayout(vbox)

        self._blacklist = Blacklist()
        if isinstance(current_values, list):
            for val in current_values:
                self._blacklist.append(val)
        vbox.addWidget(self._blacklist)

        controls_layout = QHBoxLayout()
        add_button = QPushButton(icon=QIcon.fromTheme('list-add'))
        rem_button = QPushButton(icon=QIcon.fromTheme('list-remove'))
        ok_button = QPushButton("Ok")
        cancel_button = QPushButton("Cancel")
        add_button.clicked.connect(self._add_item)
        rem_button.clicked.connect(self._remove_item)
        ok_button.clicked.connect(self.accept)
        cancel_button.clicked.connect(self.reject)

        controls_layout.addWidget(add_button)
        controls_layout.addWidget(rem_button)
        controls_layout.addStretch(0)
        controls_layout.addWidget(ok_button)
        controls_layout.addWidget(cancel_button)
        vbox.addLayout(controls_layout)
开发者ID:cottsay,项目名称:rqt_graphprofiler,代码行数:30,代码来源:blacklist.py

示例3: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, status):
        super(InspectorWidget, self).__init__()
        self.status = status
        self.setWindowTitle(status.name)
        self.paused = False

        layout = QVBoxLayout()
        
        self.disp = QTextEdit()
        self.snapshot = QPushButton("Snapshot")

        self.time = TimelineWidget(self)

        layout.addWidget(self.disp, 1)
        layout.addWidget(self.time, 0)
        layout.addWidget(self.snapshot)

        self.snaps = []
        self.snapshot.clicked.connect(self.take_snapshot)

        self.write.connect(self.write_kv)
        self.newline.connect(lambda: self.disp.insertPlainText('\n'))
        self.clear.connect(lambda: self.disp.clear())

        self.setLayout(layout)
        self.setGeometry(0,0,300,400)
        self.show()
        self.update(status)
开发者ID:zklapow,项目名称:robot_monitor,代码行数:30,代码来源:robot_monitor.py

示例4: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, context):
        super(GhostRobotControlPlugin, self).__init__(context)
        self.setObjectName('GhostRobotControlPlugin')


        self.joint_states_to_ghost_pub = rospy.Publisher('/joint_states_to_ghost', JointState, queue_size=10)

        self.ghost_joint_states_sub = rospy.Subscriber('/ghost/joint_states', JointState, self.ghost_joint_states_cb)
        self.real_joint_states_sub = rospy.Subscriber('/atlas/joint_states', JointState, self.real_joint_states_cb)


        self.ghost_joint_states = JointState()
        self.real_joint_states = JointState()

        self.move_real_robot = False


        self.widget = QWidget()
        vbox = QVBoxLayout()


        self.real_to_ghost_push_button = QPushButton('Set Ghost from real robot')
        self.real_to_ghost_push_button.clicked.connect(self.handle_set_real_to_ghost)
        vbox.addWidget(self.real_to_ghost_push_button)

        self.send_motion_plan_to_real_robot_check_box = QCheckBox('Motion GUI moves real robot')
        self.send_motion_plan_to_real_robot_check_box.stateChanged.connect(self.handle_send_motion_plan_to_real_robot_check_box)
        vbox.addWidget(self.send_motion_plan_to_real_robot_check_box)

        self.widget.setLayout(vbox)

        context.add_widget(self.widget)
开发者ID:team-vigir,项目名称:vigir_rqt,代码行数:34,代码来源:ghost_robot_control.py

示例5: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, context):
        super(RescueControlDialog, self).__init__(context)
        self.setObjectName('RescueControlDialog')

        self.joint_states_pub={}
        self._widget = QWidget()
        
        vbox = QVBoxLayout()

        
        #Add a Pushbutton for resetting the system state
        resetPushButton = QPushButton("Reset State")       
        resetPushButton.pressed.connect(self.handleReset)
        self._syscommand_pub = rospy.Publisher('syscommand', String)
        vbox.addWidget(resetPushButton)
        
        #Add a Pushbutton for adding a victim in front of the robot and projecting it against the wall
        addVictimInFrontOfRobotPushButton = QPushButton("Add victim in front of robot")       
        addVictimInFrontOfRobotPushButton.pressed.connect(self.on_add_victim_in_front_of_robot_pressed)
        vbox.addWidget(addVictimInFrontOfRobotPushButton)
        
        
        #add stretch at end so all GUI elements are at top of dialog
        vbox.addStretch(1)
                  
        self._widget.setLayout(vbox) 
        
        context.add_widget(self._widget)
开发者ID:clzh,项目名称:irrw2012,代码行数:30,代码来源:RescueControlDialog.py

示例6: add_widget

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def add_widget(self, widget):
        if widget in self._embed_widgets:
            qWarning('PluginHandlerXEmbedClient.add_widget() widget "%s" already added' % widget.objectName())
            return
        embed_widget = QX11EmbedWidget()
        layout = QVBoxLayout()
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(widget)
        embed_widget.setLayout(layout)

        # close embed widget when container is closed
        # TODO necessary?
        #embed_widget.containerClosed.connect(embed_widget.close)

        embed_container_window_id = self._remote_container.embed_widget(os.getpid(), widget.objectName())
        embed_widget.embedInto(embed_container_window_id)

        signaler = WindowChangedSignaler(widget, widget)
        signaler.window_icon_changed_signal.connect(self._on_embed_widget_icon_changed)
        signaler.window_title_changed_signal.connect(self._on_embed_widget_title_changed)
        self._embed_widgets[widget] = embed_widget, signaler
        # trigger to update initial window icon and title
        signaler.window_icon_changed_signal.emit(widget)
        signaler.window_title_changed_signal.emit(widget)

        embed_widget.show()
开发者ID:abhat91,项目名称:ros_osx,代码行数:28,代码来源:plugin_handler_xembed_client.py

示例7: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, tabwidget, parent=None):
        QDockWidget.__init__(self, "Find", parent)
        self.setObjectName('SearchFrame')
        self.setFeatures(QDockWidget.DockWidgetMovable | QDockWidget.DockWidgetFloatable)
        self._dockwidget = QFrame(self)
        self.vbox_layout = QVBoxLayout(self._dockwidget)
        self.layout().setContentsMargins(0, 0, 0, 0)
        self.layout().setSpacing(1)
        # frame with two rows for find and replace
        find_replace_frame = QFrame(self)
        find_replace_vbox_layout = QVBoxLayout(find_replace_frame)
        find_replace_vbox_layout.setContentsMargins(0, 0, 0, 0)
        find_replace_vbox_layout.setSpacing(1)
#        find_replace_vbox_layout.addSpacerItem(QSpacerItem(1, 1, QSizePolicy.Expanding, QSizePolicy.Expanding))
        # create frame with find row
        find_frame = self._create_find_frame()
        find_replace_vbox_layout.addWidget(find_frame)
        rplc_frame = self._create_replace_frame()
        find_replace_vbox_layout.addWidget(rplc_frame)
        # frame for find&replace and search results
        self.vbox_layout.addWidget(find_replace_frame)
        self.vbox_layout.addWidget(self._create_found_frame())
#        self.vbox_layout.addStretch(2024)
        self.setWidget(self._dockwidget)
        # intern search parameters
        self._tabwidget = tabwidget
        self.current_search_text = ''
        self.search_results = []
        self.search_results_fileset = set()
        self._search_result_index = -1
        self._search_recursive = False
        self._search_thread = None
开发者ID:fkie,项目名称:multimaster_fkie,代码行数:34,代码来源:text_search_frame.py

示例8: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
 def __init__(self, parent=None):
     super(MatPlot2D, self).__init__(parent)
     self._canvas = MatPlot2D.Canvas()
     self._toolbar = NavigationToolbar(self._canvas, self._canvas)
     vbox = QVBoxLayout()
     vbox.addWidget(self._toolbar)
     vbox.addWidget(self._canvas)
     self.setLayout(vbox)
开发者ID:DaikiMaekawa,项目名称:jsk_visualization,代码行数:10,代码来源:plot_2d.py

示例9: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
 def __init__(self):
     super(Tester, self).__init__();
     vlayout = QVBoxLayout();
     self.testButton = QPushButton("Exactly one row of buttons");
     vlayout.addWidget(self.testButton);
     self.testButton.clicked.connect(self.exactlyOneRow);
     
     self.setLayout(vlayout);
     self.show();
开发者ID:ros-visualization,项目名称:speakeasy,代码行数:11,代码来源:buttonSetPopupSelector_ui.py

示例10: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
 def __init__(self, parent=None):
     super(PlotWidget, self).__init__(parent)
     # create widgets
     self.canvas = PlotCanvas()
     self.toolbar = NavigationToolbar(self.canvas, self.canvas)
     self.toolbar.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred)
     vbox = QVBoxLayout()
     vbox.addWidget(self.toolbar)
     vbox.addWidget(self.canvas)
     self.setLayout(vbox)
开发者ID:aaravrav142,项目名称:rqt_joint_trajectory_plot,代码行数:12,代码来源:plot_widget.py

示例11: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, parent=None):
        super(MatDataPlot, self).__init__(parent)
        self._canvas = MatDataPlot.Canvas()
        self._toolbar = NavigationToolbar(self._canvas, self._canvas)
        vbox = QVBoxLayout()
        vbox.addWidget(self._toolbar)
        vbox.addWidget(self._canvas)
        self.setLayout(vbox)

        self._curves = {}
        self._current_vline = None
        self._canvas.mpl_connect('button_release_event', self._limits_changed)
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:14,代码来源:mat_data_plot.py

示例12: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, parent = None, logger = Logger(), step_plan_topic = str()):
        QWidgetWithLogger.__init__(self, parent, logger)

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

        # step plan input topic selection
        if len(step_plan_topic) == 0:
            step_plan_topic_widget = QTopicWidget(topic_type = 'vigir_footstep_planning_msgs/StepPlan')
            step_plan_topic_widget.topic_changed_signal.connect(self._init_step_plan_subscriber)
            vbox.addWidget(step_plan_topic_widget)
        else:
            self._init_step_plan_subscriber(step_plan_topic)

        # execute action server topic selection
        execute_topic_widget = QTopicWidget(topic_type = 'vigir_footstep_planning_msgs/ExecuteStepPlanAction', is_action_topic = True)
        execute_topic_widget.topic_changed_signal.connect(self._init_execute_action_client)
        vbox.addWidget(execute_topic_widget)

        # start button part
        buttons_hbox = QHBoxLayout()
        buttons_hbox.setMargin(0)

        # execute
        self.execute_command = QPushButton("Execute (Steps: 0)")
        self.execute_command.clicked.connect(self.execute_command_callback)
        self.execute_command.setEnabled(False)
        buttons_hbox.addWidget(self.execute_command)

        # repeat
        self.repeat_command = QPushButton("Repeat")
        self.repeat_command.clicked.connect(self.execute_command_callback)
        self.repeat_command.setEnabled(False)
        buttons_hbox.addWidget(self.repeat_command)

        # stop
        self.stop_command = QPushButton("Stop")
        self.stop_command.clicked.connect(self.stop_command_callback)
        self.stop_command.setEnabled(False)
        buttons_hbox.addWidget(self.stop_command)

        # end button part
        vbox.addLayout(buttons_hbox)

        # end widget
        self.setLayout(vbox)

        # init widget
        if len(step_plan_topic) == 0:
            step_plan_topic_widget.emit_topic_name()
        execute_topic_widget.emit_topic_name()
开发者ID:TRECVT,项目名称:vigir_footstep_planning_basics,代码行数:55,代码来源:execute_step_plan_widget.py

示例13: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
    def __init__(self, parent=None):
        super(PyQtGraphDataPlot, self).__init__(parent)
        self._plot_widget = PlotWidget()
        self._plot_widget.getPlotItem().addLegend()
        self._plot_widget.setBackground((255, 255, 255))
        self._plot_widget.setXRange(0, 10, padding=0)
        vbox = QVBoxLayout()
        vbox.addWidget(self._plot_widget)
        self.setLayout(vbox)
        self._plot_widget.getPlotItem().sigRangeChanged.connect(self.limits_changed)

        self._curves = {}
        self._current_vline = None
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:15,代码来源:pyqtgraph_data_plot.py

示例14: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
 def __init__(self, parent=None, buffer_length=100, use_poly=True, 
              no_legend=False):
     super(MatDataPlot3D, self).__init__(parent)
     self._canvas = MatDataPlot3D.Canvas()
     self._use_poly = use_poly
     self._buffer_length = buffer_length
     self._toolbar = NavigationToolbar(self._canvas, self._canvas)
     vbox = QVBoxLayout()
     vbox.addWidget(self._toolbar)
     vbox.addWidget(self._canvas)
     self.setLayout(vbox)
     self._curves_verts = {}
     self._color_index = 0
     self._curves = {}
     self._no_legend = no_legend
     self._autoscroll = False
开发者ID:AtsushiSakai,项目名称:jsk_visualization,代码行数:18,代码来源:plot.py

示例15: __init__

# 需要导入模块: from python_qt_binding.QtGui import QVBoxLayout [as 别名]
# 或者: from python_qt_binding.QtGui.QVBoxLayout import addWidget [as 别名]
	def __init__(self,):
		super(LocalNavGUI, self).__init__()
		self.setObjectName("LocalNavGUI")
		self._widget = QWidget()

		ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'localnav_gui.ui')
		loadUi(ui_file, self._widget)
		l = QVBoxLayout(self)
		l.addWidget(self._widget)
		
		# set ROS subscriber
		#rospy.Subscriber("/SLAM/current_pose", Pose2D, self.currentPoseCallback)
		rospy.Subscriber("/localnav/sensor_data", PointCloud, self.sensorDataCallback)
		rospy.Subscriber("/localnav/objects", Object, self.objectCallback)
		
		# set UI stuff
		self._widget.map.setScene(QtGui.QGraphicsScene(self))
		
		self.viewRect = self._widget.map.rect()
		self.mapHeight = self.viewRect.height()
		self.mapWidth = self.viewRect.width()
		
		self._widget.map.setSceneRect(QtCore.QRectF(self.viewRect))
		
		self.scene = self._widget.map.scene()
		
		# link buttons to functions
		self._widget.buttonClear.clicked.connect(self.buttonClear)
		
		self._widget.checkGrid.stateChanged.connect(self.filterGrid)
		self._widget.checkAxis.stateChanged.connect(self.filterAxis)
		self._widget.checkRobot.stateChanged.connect(self.filterRobot)
		self._widget.checkOrientation.stateChanged.connect(self.filterOrientation)
		self._widget.checkPath.stateChanged.connect(self.filterPath)
		self._widget.checkSensorData.stateChanged.connect(self.filterSensorData)
		self._widget.checkObjects.stateChanged.connect(self.filterObjects)
		self._widget.checkObstacles.stateChanged.connect(self.filterObstacles)
		
		
		# subscribe to signals
		self.sigRedraw.connect(self.sigRedrawHandler)
		
		
		# launch thread that redraws the map at a set rate
		t_redraw = threading.Thread(target=self.threadRedraw)
		t_redraw.daemon = True
		t_redraw.start()
开发者ID:SaxionLED,项目名称:skynav,代码行数:49,代码来源:localnav_gui.py


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