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


Python QtGui.QVBoxLayout类代码示例

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


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

示例1: __init__

    def __init__(self):
        super(TopicSelection, self).__init__()
        master = rosgraph.Master('rqt_bag_recorder')
        self.setWindowTitle("Select the topics you want to record")
        self.resize(500, 700)

        self.topic_list = []
        self.selected_topics = []
        self.items_list = []

        self.area = QScrollArea(self)
        self.main_widget = QWidget(self.area)
        self.ok_button = QPushButton("Record", self)
        self.ok_button.clicked.connect(self.onButtonClicked)
        self.ok_button.setEnabled(False)

        self.main_vlayout = QVBoxLayout(self)
        self.main_vlayout.addWidget(self.area)
        self.main_vlayout.addWidget(self.ok_button)
        self.setLayout(self.main_vlayout)

        self.selection_vlayout = QVBoxLayout(self)
        self.item_all = QCheckBox("All", self)
        self.item_all.stateChanged.connect(self.updateList)
        self.selection_vlayout.addWidget(self.item_all)
        topic_data_list = master.getPublishedTopics('')
        topic_data_list.sort()
        for topic, datatype in topic_data_list:
            self.addCheckBox(topic)

        self.main_widget.setLayout(self.selection_vlayout)

        self.area.setWidget(self.main_widget)
        self.show()
开发者ID:OSUrobotics,项目名称:rqt_common_plugins,代码行数:34,代码来源:topic_selection.py

示例2: __init__

    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,代码行数:28,代码来源:blacklist.py

示例3: add_widget

    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,代码行数:26,代码来源:plugin_handler_xembed_client.py

示例4: __init__

    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,代码行数:32,代码来源:text_search_frame.py

示例5: __init__

    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,代码行数:28,代码来源:robot_monitor.py

示例6: __init__

    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,代码行数:32,代码来源:ghost_robot_control.py

示例7: __init__

 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,代码行数:8,代码来源:plot_2d.py

示例8: __init__

 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,代码行数:9,代码来源:buttonSetPopupSelector_ui.py

示例9: __init__

 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,代码行数:10,代码来源:plot_widget.py

示例10: __init__

    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,代码行数:25,代码来源:parameter_set_widget.py

示例11: __init__

    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,代码行数:12,代码来源:mat_data_plot.py

示例12: __init__

    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,代码行数:13,代码来源:pyqtgraph_data_plot.py

示例13: __init__

    def __init__(self, filenames, search_text='', parent=None):
        '''
        @param filenames: a list with filenames. The last one will be activated.
        @type filenames: C{[str, ...]}
        @param search_text: if not empty, searches in new document for first occurrence of the given text
        @type search_text: C{str} (Default: C{Empty String})
        '''
        QMainWindow.__init__(self, parent)
        self.setObjectName('Editor - %s' % utf8(filenames))
        self.setAttribute(Qt.WA_DeleteOnClose, True)
        self.setWindowFlags(Qt.Window)
        self.mIcon = QIcon(":/icons/crystal_clear_edit_launch.png")
        self._error_icon = QIcon(":/icons/crystal_clear_warning.png")
        self._empty_icon = QIcon()
        self.setWindowIcon(self.mIcon)
        window_title = "ROSLaunch Editor"
        if filenames:
            window_title = self.__getTabName(filenames[0])
        self.setWindowTitle(window_title)
        self.init_filenames = list(filenames)
        self._search_thread = None
        # list with all open files
        self.files = []
        # create tabs for files
        self.main_widget = QWidget(self)
        self.verticalLayout = QVBoxLayout(self.main_widget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(1)
        self.verticalLayout.setObjectName("verticalLayout")

        self.tabWidget = EditorTabWidget(self)
        self.tabWidget.setTabPosition(QTabWidget.North)
        self.tabWidget.setDocumentMode(True)
        self.tabWidget.setTabsClosable(True)
        self.tabWidget.setMovable(False)
        self.tabWidget.setObjectName("tabWidget")
        self.tabWidget.tabCloseRequested.connect(self.on_close_tab)
        self.tabWidget.currentChanged.connect(self.on_tab_changed)

        self.verticalLayout.addWidget(self.tabWidget)
        self.buttons = self._create_buttons()
        self.verticalLayout.addWidget(self.buttons)
        self.setCentralWidget(self.main_widget)

        self.find_dialog = TextSearchFrame(self.tabWidget, self)
        self.find_dialog.search_result_signal.connect(self.on_search_result)
        self.find_dialog.replace_signal.connect(self.on_replace)
        self.addDockWidget(Qt.RightDockWidgetArea, self.find_dialog)

        self.graph_view = GraphViewWidget(self.tabWidget, self)
        self.graph_view.load_signal.connect(self.on_graph_load_file)
        self.graph_view.goto_signal.connect(self.on_graph_goto)
        self.addDockWidget(Qt.RightDockWidgetArea, self.graph_view)
        # open the files
        for f in filenames:
            if f:
                self.on_load_request(os.path.normpath(f), search_text)
        self.readSettings()
        self.find_dialog.setVisible(False)
        self.graph_view.setVisible(False)
开发者ID:zhouchengming1,项目名称:multimaster_fkie,代码行数:60,代码来源:editor.py

示例14: __init__

    def __init__(self, context):
        super(LevelSelectorPlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('LevelSelectorPlugin')

        # Create QWidget
        self._widget = QWidget()
        # self._widget.setFont(QFont("Times", 15, QFont.Bold))
        self._button_layout = QVBoxLayout(self._widget)

        self.buttons = []
        self.text_label = QLabel("Waiting for MultiLevelMapData...", self._widget)
        self._button_layout.addWidget(self.text_label)

        self._widget.setObjectName('LevelSelectorPluginUI')
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)

        self.connect(self._widget, SIGNAL("update_buttons"), self.update_buttons)
        self.connect(self._widget, SIGNAL("update_button_status"), self.update_button_status)

        # Subcribe to the multi level map data to get information about all the maps.
        self.multimap_subscriber = rospy.Subscriber("map_metadata", MultiLevelMapData, self.process_multimap)
        self.levels = []
        self.current_level = None

        # Subscribe to the current level we are on.
        self.status_subscriber = None

        # Create a service proxy to change the current level.
        self.level_selector_proxy = rospy.ServiceProxy("level_mux/change_current_level", ChangeCurrentLevel)
        self.level_selector_proxy.wait_for_service()
开发者ID:nj1407,项目名称:bwi_common,代码行数:33,代码来源:plugins.py

示例15: __init__

    def __init__(self, map_topic='/map',
                 paths=['/move_base/NavFn/plan', '/move_base/TrajectoryPlannerROS/local_plan'],
                 polygons=['/move_base/local_costmap/robot_footprint']):
        super(NavViewWidget, self).__init__()
        self._layout = QVBoxLayout()
        self._button_layout = QHBoxLayout()

        self.setAcceptDrops(True)
        self.setWindowTitle('Navigation Viewer')

        self.paths = paths
        self.polygons = polygons
        self.map = map_topic
        self._tf = tf.TransformListener()

        self._nav_view = NavView(map_topic, paths, polygons, tf = self._tf, parent = self)

        self._set_pose = QPushButton('Set Pose')
        self._set_pose.clicked.connect(self._nav_view.pose_mode)
        self._set_goal = QPushButton('Set Goal')
        self._set_goal.clicked.connect(self._nav_view.goal_mode)

        self._button_layout.addWidget(self._set_pose)
        self._button_layout.addWidget(self._set_goal)

        self._layout.addLayout(self._button_layout)

        self._layout.addWidget(self._nav_view)

        self.setLayout(self._layout)
开发者ID:Aerobota,项目名称:rqt_robot_plugins,代码行数:30,代码来源:nav_view.py


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