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


Python QWidget.setWindowTitle方法代码示例

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


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

示例1: MyPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class MyPlugin(Plugin):

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

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser
        parser.add_argument("-q", "--quiet", action="store_true",
                            dest="quiet",
                            help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns

        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which should be in the "resource" folder of this package
        ui_file = os.path.join(rospkg.RosPack().get_path('rqt_mypkg'), 'resource', 'MyPlugin.ui')
        # Extend the widget with all atrributes and children from UI File
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('MyPluginUi')
        # Show _widget.windowTitle on left-top of each plugin(when it's set in _widget).
        # This is useful when you open multiple plugins aat once. Also if you open multiple
        # instances of your plugin at once, these lines add number to make it easy to
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' %d' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)
        self._widget.cancelButton.clicked[bool].connect(self._handle_cancel_clicked)
        self._widget.okButton.clicked[bool].connect(self._handle_ok_clicked)


    def shutdown_plugin(self):
        # TODO unregister all publishers here
        pass

    def save_settings(self, plugin_settings, instance_settings):
        # TODO save intrinsic configuration, usually using:
        # instance_settings.get_value(k, v)
        pass

    def restore_settings(self, pluign_settings, instance_settings):
        # TODO restore intrinsic configuration, usually using:
        # v = instance_settings.value(k)
        pass

    def _handle_cancel_clicked(self):
        print "cancelButton is clicked"

    def _handle_ok_clicked(self):
        print "okButton is clicked"
开发者ID:AriYu,项目名称:rqt_mypkg,代码行数:60,代码来源:my_module.py

示例2: skeletonPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class skeletonPlugin(Plugin):


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

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns
        
        
        
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'skeleton.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('skeletonUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)



    def shutdown_plugin(self):
        # TODO unregister all publishers here
        pass

    def save_settings(self, plugin_settings, instance_settings):
        # TODO save intrinsic configuration, usually using:
        # instance_settings.set_value(k, v)
        pass

    def restore_settings(self, plugin_settings, instance_settings):
        # TODO restore intrinsic configuration, usually using:
        # v = instance_settings.value(k)
        pass
开发者ID:KTH-AEROWORKS,项目名称:quad-suspended-load,代码行数:59,代码来源:skeleton.py

示例3: ExampleGuiPub

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class ExampleGuiPub(Plugin):
   
    def __init__(self, context=None):
        super(ExampleGuiPub, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('ExampleGuiPub')
  
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file        
        pkg_dir = roslib.packages.get_pkg_dir('example_gui_pub')
        ui_file_path = os.path.join(pkg_dir, 'ui/example_gui_pub.ui')


        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file_path, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('ExampleGuiPubUi')

	    # Show _widget.windowTitle on left-top of each plugin (when 
     	# it's set in _widget). This is useful when you open multiple
	    # plugins at once. Also if you open multiple instances of your 
	    # plugin at once, these lines add number to make it easy to
	    # tell from pane to pane.        
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))

        # Add widget to the user interface
        context.add_widget(self._widget)
    	
        # Now Set up our own interface:
        # ==> Connect the buttons to the functions        
        self._widget.btn_ok.clicked.connect(self.btn_ok_clicked)
	
    def shutdown_plugin(self):
        """Kill all subscribers and publishers."""
	pass

    def save_settings(self, plugin_settings, instance_settings):
        # TODO save intrinsic configuration, usually using:
        # instance_settings.set_value(k, v)
    	pass
 
    def restore_settings(self, plugin_settings, instance_settings):
        # TODO restore intrinsic configuration, usually using:
        # v = instance_settings.value(k)
	pass    

    
        
    def btn_ok_clicked(self):
        #printing the word in the ui label box
        spin_speed = 3.0
        self._widget.StatusReturn.setText('set LIDAR speed to ' + str(spin_speed))
        #publisher the data to multisense_sl        
        self.pub = rospy.Publisher('multisense_sl/set_spindle_speed', Float64, queue_size=10)      
        self.pub.publish(spin_speed)
开发者ID:1508189250,项目名称:birl_baxter,代码行数:59,代码来源:_example_gui_pub_module.py

示例4: BalanceModeWidget

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class BalanceModeWidget(Plugin):
    def __init__(self, context):
        super(BalanceModeWidget, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('BalanceMode')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                            dest="quiet",
                            help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns

        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which should be in the "resource" folder of this package
        ui_file = os.path.join(rospkg.RosPack().get_path('rsv_balance_rqt'), 'resource', 'BalanceModeWidget.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('BalanceModeWidgetUI')
        # Numerated windowTitle
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        self._widget.set_park.clicked[bool].connect(self.on_set_park_button)
        self._widget.set_tractor.clicked[bool].connect(self.on_set_tractor_button)
        self._widget.set_balance.clicked[bool].connect(self.on_set_balance_button)

        self._widget.topic_line_edit.textChanged.connect(self.on_topic_changed)

        # Set mode client
        self.set_mode_srv = None
        self.on_topic_changed()

    def shutdown_plugin(self):
        pass

    def save_settings(self, plugin_settings, instance_settings):
        instance_settings.set_value('topic', self._widget.topic_line_edit.text())

    def restore_settings(self, plugin_settings, instance_settings):
        value = instance_settings.value('topic', "/set_mode")
        self._widget.topic_line_edit.setText(value)

    def on_set_park_button(self):
        try:
            self.set_mode_srv(rsv_balance_msgs.srv.SetModeRequest.PARK)
        except rospy.ServiceException, e:
            rospy.logwarn("Service call failed: %s" % e)
开发者ID:robosavvy,项目名称:rsv_balance_desktop,代码行数:59,代码来源:balance_mode_widget.py

示例5: RunStopPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class RunStopPlugin(Plugin):

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

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns

        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file
        ui_file = os.path.join(rospkg.RosPack().get_path('rqt_runstop'), 'src', 'rqt_runstop', 'runstop.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('RunStopPluginUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)


        # initialize publisher to publish cancel messages
        self._publisher = rospy.Publisher('move_base/cancel', GoalID, queue_size=10)

        self._widget.runstopButton.clicked.connect(self.runstopButton_clicked)  # button handler


    # cancel all goals by sending empty goal to /move_base/cancel
    def runstopButton_clicked(self):
        emptyGoal = GoalID()
        self._publisher.publish(emptyGoal)
        return
开发者ID:OSUrobotics,项目名称:wheelchair-automation,代码行数:51,代码来源:rqt_runstop_module.py

示例6: Builder

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class Builder(Plugin):

    def __init__(self, context):
        super(Builder, self).__init__(context)

        self.setObjectName('BeetreeBuilder')
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        rospack = rospkg.RosPack()
        ui_path = rospack.get_path('beetree_builder') + '/ui/main.ui'
        # Load the ui attributes into the main widget
        loadUi(ui_path, self._widget)
        self._widget.setObjectName('BeetreeBuilderPluginUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))

        # Add widget to the user interface
        context.add_widget(self._widget)
        palette = QPalette ()
        palette.setColor(QPalette.Background, Qt.white)
        self._widget.setPalette(palette)

        # Add custom options
        self._widget.node_type_list.addItems(['test1','test2'])

    def shutdown_plugin(self):
        # TODO unregister all publishers here
        pass

    def save_settings(self, plugin_settings, instance_settings):
        # TODO save intrinsic configuration, usually using:
        # instance_settings.set_value(k, v)
        pass

    def restore_settings(self, plugin_settings, instance_settings):
        # TODO restore intrinsic configuration, usually using:
        # v = instance_settings.value(k)
        pass
开发者ID:futureneer,项目名称:beetree_builder,代码行数:46,代码来源:builder.py

示例7: QuestionDialogPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class QuestionDialogPlugin(Plugin):

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

        # Create QWidget
        self._widget = QWidget()
        self._widget.setFont(QFont("Times", 14, QFont.Bold))
        self._layout = QVBoxLayout(self._widget)
        self._text_browser = QTextBrowser(self._widget)
        self._layout.addWidget(self._text_browser)
        self._button_layout = QHBoxLayout()
        self._layout.addLayout(self._button_layout)

        # layout = QVBoxLayout(self._widget)
        # layout.addWidget(self.button)
        self._widget.setObjectName('QuestionDialogPluginUI')
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + 
                                        (' (%d)' % context.serial_number()))
        context.add_widget(self._widget)

        # Setup service provider
        self.service = rospy.Service('question_dialog', QuestionDialog,
                                     self.service_callback)
        self.response_ready = False
        self.response = None
        self.buttons = []
        self.text_label = None
        self.text_input = None

        self.connect(self._widget, SIGNAL("update"), self.update)
        self.connect(self._widget, SIGNAL("timeout"), self.timeout)

    def shutdown_plugin(self):
        self.service.shutdown()

    def service_callback(self, req):
        self.response_ready = False
        self.request = req
        self._widget.emit(SIGNAL("update"))
        # Start timer against wall clock here instead of the ros clock.
        start_time = time.time()
        while not self.response_ready:
            if req.timeout != QuestionDialogRequest.NO_TIMEOUT:
                current_time = time.time()
                if current_time - start_time > req.timeout:
                    self._widget.emit(SIGNAL("timeout"))
                    return QuestionDialogResponse(
                            QuestionDialogRequest.TIMED_OUT, "")
            time.sleep(0.2)
        return self.response

    def update(self):
        self.clean()
        req = self.request
        self._text_browser.setText(req.message)
        if req.type == QuestionDialogRequest.DISPLAY:
            # All done, nothing more too see here.
            self.response = QuestionDialogResponse(
                    QuestionDialogRequest.NO_RESPONSE, "")
            self.response_ready = True
        elif req.type == QuestionDialogRequest.CHOICE_QUESTION:
            for index, options in enumerate(req.options): 
                button = QPushButton(options, self._widget)
                button.clicked.connect(partial(self.handle_button, index))
                self._button_layout.addWidget(button)
                self.buttons.append(button)
        elif req.type == QuestionDialogRequest.TEXT_QUESTION:
            self.text_label = QLabel("Enter here: ", self._widget)
            self._button_layout.addWidget(self.text_label)
            self.text_input = QLineEdit(self._widget)
            self.text_input.editingFinished.connect(self.handle_text)
            self._button_layout.addWidget(self.text_input)

    def timeout(self):
        self._text_browser.setText("Oh no! The request timed out.")
        self.clean()

    def clean(self):
        while self._button_layout.count():
            item = self._button_layout.takeAt(0)
            item.widget().deleteLater()
        self.buttons = []
        self.text_input = None
        self.text_label = None

    def handle_button(self, index):
        self.response = QuestionDialogResponse(index, "")
        self.clean()
        self.response_ready = True

    def handle_text(self):
        self.response = QuestionDialogResponse(
            QuestionDialogRequest.TEXT_RESPONSE,
            self.text_input.text())
        self.clean()
        self.response_ready = True
#.........这里部分代码省略.........
开发者ID:shiqizhang6,项目名称:segbot_apps,代码行数:103,代码来源:plugins.py

示例8: LogicalMarkerPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class LogicalMarkerPlugin(Plugin):

    def __init__(self, context):
        super(LogicalMarkerPlugin, self).__init__(context)

        # Create an image for the original map. This will never change.
        try:
            self.map_yaml_file_str = rospy.get_param("~map_file")
            self.data_directory = rospy.get_param("~data_directory")
        except KeyError:
            rospy.logfatal("~map_file and ~data_directory need to be set to use the logical marker")
            return

        map_image_location = getImageFileLocation(self.map_yaml_file_str)
        map = loadMapFromFile(self.map_yaml_file_str)
        locations_file = getLocationsFileLocationFromDataDirectory(self.data_directory)
        doors_file = getDoorsFileLocationFromDataDirectory(self.data_directory)
        objects_file = getObjectsFileLocationFromDataDirectory(self.data_directory)

        # Give QObjects reasonable names
        self.setObjectName('LogicalMarkerPlugin')

        # Create QWidget
        self.master_widget = QWidget()
        self.master_layout = QVBoxLayout(self.master_widget)

        # Main Functions - Doors, Locations, Objects
        self.function_layout = QHBoxLayout()
        self.master_layout.addLayout(self.function_layout)
        self.function_buttons = []
        self.current_function = None
        for button_text in ['Locations', 'Doors', 'Objects']:
            button = QPushButton(button_text, self.master_widget)
            button.clicked[bool].connect(self.handle_function_button)
            button.setCheckable(True)
            self.function_layout.addWidget(button)
            self.function_buttons.append(button)
        self.function_layout.addStretch(1)

        self.master_layout.addWidget(self.get_horizontal_line())

        # Subfunction toolbar
        self.subfunction_layout = QHBoxLayout()
        clearLayoutAndFixHeight(self.subfunction_layout)
        self.master_layout.addLayout(self.subfunction_layout)
        self.current_subfunction = None

        self.master_layout.addWidget(self.get_horizontal_line())

        self.image = MapImage(map_image_location, self.master_widget)
        self.master_layout.addWidget(self.image)

        self.master_layout.addWidget(self.get_horizontal_line())

        # Configuration toolbar
        self.configuration_layout = QHBoxLayout()
        clearLayoutAndFixHeight(self.configuration_layout)
        self.master_layout.addLayout(self.configuration_layout)

        # Add a stretch at the bottom.
        self.master_layout.addStretch(1)

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


        # Activate the functions
        self.functions = {}
        self.functions['Locations'] = LocationFunction(locations_file,
                                                       map,
                                                       self.master_widget, 
                                                       self.subfunction_layout, 
                                                       self.configuration_layout,
                                                       self.image)
        self.functions['Doors'] = DoorFunction(doors_file,
                                               map,
                                               self.functions['Locations'],
                                               self.master_widget, 
                                               self.subfunction_layout, 
                                               self.configuration_layout,
                                               self.image)
        self.functions['Objects'] = ObjectFunction(objects_file,
                                                   map,
                                                   self.functions['Locations'],
                                                   self.master_widget, 
                                                   self.subfunction_layout, 
                                                   self.configuration_layout,
                                                   self.image)
    def construct_layout(self):
        pass

    def get_horizontal_line(self):
        """
        http://stackoverflow.com/questions/5671354/how-to-programmatically-make-a-horizontal-line-in-qt
        """
        hline = QFrame()
        hline.setFrameShape(QFrame.HLine)
        hline.setFrameShadow(QFrame.Sunken)
#.........这里部分代码省略.........
开发者ID:nj1407,项目名称:bwi_common,代码行数:103,代码来源:plugins.py

示例9: Overview

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class Overview(Plugin):
    setImageSignal = pyqtSignal(Image)
    setBaseMaskSignal = pyqtSignal(Image)
    setBatteryMaskSignal = pyqtSignal(Image)
    setCupMaskSignal = pyqtSignal(Image)
    def __init__(self, context):
        super(Overview, self).__init__(context)
        
        # Give QObjects reasonable names
        self.setObjectName('rqt_calibration_blob')
        self.__imageTopic = "/camera/rgb/image_rect_color"
        self.__pickedColour = None
        self.__lastHSVimage = None

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-i", "--imageTopic", dest="imageTopic", help="set image topic")
        args, unknowns = parser.parse_known_args(context.argv())
        if args.imageTopic:
            self.__imageTopic = args.imageTopic
        else:
            self.__imageTopic = "/object_detection_blob_node/object_detection_blob_node/lightCorrected"
        self.__imageSub = rospy.Subscriber(self.__imageTopic, Image, self.imageCallback)
        self.__baseMaskSub = rospy.Subscriber("/object_detection_blob_node/object_detection_blob_node/base_mask", Image, self.baseMaskCallback)
        self.__batteryMaskSub = rospy.Subscriber("/object_detection_blob_node/object_detection_blob_node/battery_mask", Image, self.batteryMaskCallback)
        self.__cupMaskSub = rospy.Subscriber("/object_detection_blob_node/object_detection_blob_node/cup_mask", Image, self.cupMaskCallback)
        self.__cvBridge = CvBridge()
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which should be in the "resource" folder of this node
        ui_file = os.path.join(rospkg.RosPack().get_path('object_detection_blob'), 'src', 'rqt_calibration_gui', 'resource', 'overview.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('CalibrationUI')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        
        self.__colorImageScene = ClickableGraphicsScene()
        self.__baseImageScene = ClickableGraphicsScene()
        self.__batteryImageScene = ClickableGraphicsScene()
        self.__cupImageScene = ClickableGraphicsScene()
        self.__colorImageScene.clicked.connect(self.readImageColour)
        self.__baseImageScene.clicked.connect(self.readImageColour)
        self.__batteryImageScene.clicked.connect(self.readImageColour)
        self.__cupImageScene.clicked.connect(self.readImageColour)

        self._widget.setBaseButton.clicked.connect(self.setBaseCallback)
        self._widget.setBatteryButton.clicked.connect(self.setBatteryCallback)
        self._widget.setCupButton.clicked.connect(self.setCupCallback)
        self._widget.subscribeButton.clicked.connect(self.subscribeToImage)
        self._widget.setMinButton.clicked.connect(self.setMinColour)
        self._widget.setMaxButton.clicked.connect(self.setMaxColour)
        # Connect signal so we can refresh widgets from the main thread        
        self.setImageSignal.connect(self.updateImage)
        self.setBaseMaskSignal.connect(self.updateBaseMask)
        self.setBatteryMaskSignal.connect(self.updateBatteryMask)
        self.setCupMaskSignal.connect(self.updateCupMask)
        # Add widget to the user interface
        context.add_widget(self._widget)
        rospy.loginfo("initialized")
    
    def readImageColour(self, pos):
        if self.__lastHSVimage is not None:
            self.__pickedColour = self.__lastHSVimage[pos[1], pos[0]] # x, y is swapped in opencv
            self._widget.colourLabel.setText("hue {0} sat {1} val {2}".format(self.__pickedColour[0], self.__pickedColour[1], self.__pickedColour[2]))
            rospy.loginfo("picked color %s", self.__pickedColour)
    
    def setMinColour(self):
        if self.__pickedColour is not None:
            self._widget.hueMinEdit.setText(str(self.__pickedColour[0]))
            self._widget.satMinEdit.setText(str(self.__pickedColour[1]))
            self._widget.valMinEdit.setText(str(self.__pickedColour[2]))
    
    def setMaxColour(self):
        if self.__pickedColour is not None:
            self._widget.hueMaxEdit.setText(str(self.__pickedColour[0]))
            self._widget.satMaxEdit.setText(str(self.__pickedColour[1]))
            self._widget.valMaxEdit.setText(str(self.__pickedColour[2])) 
        
    def updateImage(self, img):
        try:
            img.encoding = "bgr8" # no, it's not but cv_bridge can't handle hsv
            image = self.__cvBridge.imgmsg_to_cv2(img) # Convert ROS' sensor_msgs/Image to cv2 image
            self.__lastHSVimage = image.copy()
            image = cv2.cvtColor(image, cv2.COLOR_HSV2RGB)
            height, width = image.shape[:2]
            frame = QImage(image.data, width, height, QImage.Format_RGB888)
            self.__colorImageScene.clear()
            self.__colorImageScene.addPixmap(QPixmap.fromImage(frame))
            self.__colorImageScene.update()
            self._widget.lightCorrectedGraphicsView.setScene(self.__colorImageScene)
            self._widget.lightCorrectedGraphicsView.ensureVisible(self.__colorImageScene.sceneRect());
#.........这里部分代码省略.........
开发者ID:DAInamite,项目名称:uav_object_localisation,代码行数:103,代码来源:blob_calibration_gui.py

示例10: Dot

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class Dot(Plugin):

    def __init__(self, context):
        super(Dot, self).__init__(context)

        self._dotcode_sub = None

        # Give QObjects reasonable names
        self.setObjectName('Dot')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns

        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'rqt_dot.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names

        self._widget.setObjectName('DotPluginUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))

        # Add widget to the user interface
        context.add_widget(self._widget)
        palette = QPalette ()
        palette.setColor(QPalette.Background, Qt.white)
        self._widget.setPalette(palette)

        self._widget.subscribe_button.setCheckable(True)
        self._widget.subscribe_button.clicked[bool].connect(self._handle_subscribe_clicked)

    def shutdown_plugin(self):
        # TODO unregister all publishers here
        pass

    def save_settings(self, plugin_settings, instance_settings):
        # TODO save intrinsic configuration, usually using:
        # instance_settings.set_value(k, v)
        pass

    def restore_settings(self, plugin_settings, instance_settings):
        # TODO restore intrinsic configuration, usually using:
        # v = instance_settings.value(k)
        pass

    #def trigger_configuration(self):
        # Comment in to signal that the plugin has a way to configure
        # This will enable a setting button (gear icon) in each dock widget title bar
        # Usually used to open a modal configuration dialog

    def _handle_subscribe_clicked(self, checked):
        if checked:
            topic_name = self._widget.topic_name.text()
            if len(topic_name) > 0:
                self._dotcode_sub = rospy.Subscriber(
                        topic_name,
                        std_msgs.msg.String,
                        self._dotcode_msg_cb)
            else:
                return False
        else:
            if self._dotcode_sub:
                self._dotcode_sub.unregister()
                self._dotcode_sub = None

    def _dotcode_msg_cb(self, msg):
        self._widget.xdot_widget.set_dotcode(msg.data)
开发者ID:jbohren,项目名称:rqt_dot,代码行数:87,代码来源:dot.py

示例11: ChooseControllerPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class ChooseControllerPlugin(Plugin):

    # for controller state
    ctr_st = pyqtSignal(numpy.ndarray)

    # ---------------------------------------------- #
    # ---------------------------------------------- #
    # Necessary constants

    # size of vectors: INTEGER
    Size_Vector = 100


    def __init__(self, context,namespace = None):

        # it is either "" or the input given at creation of plugin
        self.namespace = self._parse_args(context.argv())


        super(ChooseControllerPlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('ChooseControllerPlugin')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns
        
        
        
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ChooseController.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('ChooseControllerUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        # ---------------------------------------------- #
        # ---------------------------------------------- #

        # BUTTON TO SET DESIRED CONTROLLER
        self._widget.SetControllerButton.clicked.connect(self.SetController)

        # BUTTON TO SET DESIRED TRAJECTORY
        self._widget.Reset_Int_XY.clicked.connect(self.RESET_xy_PID)

        # BUTTON TO SET DESIRED TRAJECTORY
        self._widget.Reset_Int_Z.clicked.connect(self.RESET_z_PID)

        # ------------------------------------------------------------------#
        # ------------------------------------------------------------------#
        # get some values from launch file if theyre available
        wn  = 1
        xsi = numpy.sqrt(2)/2
        kv   = rospy.get_param("kv",2.0*xsi*wn)
        kp   = rospy.get_param("kp",wn*wn)

        Throttle_neutral = rospy.get_param("Throttle_neutral_ctr",1484.0)


        # ------------------------------------------------------------------#
        # ------------------------------------------------------------------#

        # Default values for buttons: PD Controller
        self._widget.PgainXY.setValue(kp)
        self._widget.DgainXY.setValue(kv)
        self._widget.PgainZ.setValue(kp)
        self._widget.DgainZ.setValue(kv)
        self._widget.ThrottleNeutral.setValue(Throttle_neutral)

        # Default values for buttons: PID Controller
        self._widget.PgainXY_PID.setValue(kp)
        self._widget.DgainXY_PID.setValue(kv)
        self._widget.IgainXY_PID.setValue(0.0)
        self._widget.PgainZ_PID.setValue(kp)
        self._widget.DgainZ_PID.setValue(kv)
        self._widget.DgainXY_PID.setValue(kv)
        self._widget.IgainZ_PID.setValue(0.0)
        self._widget.ThrottleNeutral_PID.setValue(Throttle_neutral)


#.........这里部分代码省略.........
开发者ID:gitter-badger,项目名称:sml_under_development,代码行数:103,代码来源:ChooseController.py

示例12: ChooseJsonablePlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class ChooseJsonablePlugin(Plugin):

    def __init__(self, context,namespace = None, name_tab = "", dictionary_of_options = {}, service_name = "", ServiceClass = None):

        # it is either "" or the input given at creation of plugin
        self.namespace = self._parse_args(context.argv())

        # DO NOT COPY DICTIONARY
        self.dictionary_of_options = dictionary_of_options

        self.name_tab     = name_tab
        self.service_name = service_name
        self.ServiceClass = ServiceClass

        super(ChooseJsonablePlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('ChooseJsonablePlugin')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns
        
               
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'choose_jsonable.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('Choose'+self.name_tab+'Ui')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)


        # ---------------------------------------------- #

        # create list of available trajectory classes based on dictionary 
        self.__print_list()

        # if item in list is clicked twice selected, print corresponding message
        self._widget.ListJsonableWidget.itemDoubleClicked.connect(self.__jsonable_item_clicked)

        # if item in list is clicked once, print corresponding message
        self._widget.ListJsonableWidget.itemClicked.connect(self.__print_jsonable_description)
        
        # button to request service for setting new jsonable object
        self._widget.SetJsonableButton.clicked.connect(self.__service_jsonable_object)


        # button for resetting list of available jsonable objects
        self._widget.ResetListJsonable.clicked.connect(self.__reset_jsonable_widget)

        self.__reset_jsonable_widget()

    # PUBLIC FUNCTION:
    def change_dictionary_of_options(self,dictionary_of_options):
        self.dictionary_of_options = dictionary_of_options
        self.__reset_jsonable_widget()

    def __reset_jsonable_widget(self):
        """ Clear widget and print it again """
        
        # clear items from widget
        self._widget.ListJsonableWidget.clear()

        # create list of available controller classes based on **imported dictionary**
        for key in self.dictionary_of_options.keys():
            # print all elements in dictionary
            self._widget.ListJsonableWidget.addItem(key)

        self.__head_class_set       = False
        self.__head_class_completed = False
        self.dic_to_print           = {}

    def __print_list(self):
        # clearwindow
        self._widget.ListJsonableWidget.clear()
        # create list of available classes based on dictionary 
        for key in self.dictionary_of_options.keys():
            self._widget.ListJsonableWidget.addItem(key)

    def __print_jsonable_description(self):

#.........这里部分代码省略.........
开发者ID:giorgiocorra,项目名称:coverage_giorgio,代码行数:103,代码来源:choose_jsonable.py

示例13: positionPlotPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]

#.........这里部分代码省略.........
        super(positionPlotPlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('positionPlotPlugin')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns
        
        
        
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'positionPlot.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('positionPlotUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        # ---------------------------------------------- #
        # ---------------------------------------------- #

        # window for positions
        plotwidget = pg.PlotWidget()
        plotwidget.getPlotItem().addLegend()
        plotwidget.setYRange(-2.5,2.5)      


        # window for velocities
        velplotwidget = pg.PlotWidget()
        velplotwidget.getPlotItem().addLegend()
        velplotwidget.setYRange(-2.5,2.5)   

        # window for velocities
        Anglesplotwidget = pg.PlotWidget()
        Anglesplotwidget.getPlotItem().addLegend()
        Anglesplotwidget.setYRange(-30,30)        

        # window for channels
        channelplotwidget = pg.PlotWidget()
        channelplotwidget.getPlotItem().addLegend()
        channelplotwidget.setYRange(1000,2000)


        # ---------------------------------------------- #
        # ---------------------------------------------- #        
        
        layout        = QtGui.QGridLayout()
开发者ID:KTH-AEROWORKS,项目名称:quad-suspended-load,代码行数:70,代码来源:positionPlot.py

示例14: ChooseMissionPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class ChooseMissionPlugin(Plugin):

    def __init__(self, context,namespace = None):

        # "global variables"
        self.dic_sequence_services = {}
        self.dic_sequence_services['last_trigger_time']            = 0.0
        self.dic_sequence_services['checked_sequence_of_missions'] = True
        self.dic_sequence_services['list_sequence_services']       = []

        # it is either "" or the input given at creation of plugin
        self.namespace = self._parse_args(context.argv())
        self.context   = context

        super(ChooseMissionPlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('ChooseMissionPlugin')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns
        
               
        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'choose_mission.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('ChooseMissionUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)

        # ---------------------------------------------- #
        # ---------------------------------------------- #

        self._widget.ResetIrisNeutralValue.clicked.connect(self.reset_iris_neutral_value)
        self._widget.SetIrisNeutralValue.clicked.connect(self.set_iris_neutral_value)


        self._widget.SetSequenceMissions.clicked.connect(self.send_list_of_services)
        # ---------------------------------------------- #
        
        # button to request service for setting new controller, with new parameters
        self._widget.SetControllerButton.clicked.connect(self.__get_new_controller_parameters)

        # if item in list is selected, print corresponding message
        self._widget.ListControllersWidget.itemDoubleClicked.connect(self.__controller_item_clicked)
        self._widget.ListControllersWidget.itemClicked.connect(self.__print_controller_item_clicked)

        self.__reset_controllers_widget()

        # button for resetting list of available controllers
        self._widget.ResetControllersList.clicked.connect(self.__reset_controllers_widget)


        self.choose_reference  = ChooseJsonablePlugin(context,\
            self.namespace,\
            name_tab = "Reference",
            dictionary_of_options = {},\
            service_name = 'ServiceChangeReference',\
            ServiceClass = SrvCreateJsonableObjectByStr)
        self.choose_reference.dic_sequence_services = self.dic_sequence_services


        self.choose_yaw_reference  = ChooseJsonablePlugin(context,\
            self.namespace,\
            name_tab = "YawReference",
            dictionary_of_options = {},\
            service_name = 'ServiceChangeYawReference',\
            ServiceClass = SrvCreateJsonableObjectByStr)        
        self.choose_yaw_reference.dic_sequence_services = self.dic_sequence_services


        self.choose_yaw_controller  = ChooseJsonablePlugin(context,\
            self.namespace,\
            name_tab = "YawController",
            dictionary_of_options = {},\
            service_name = 'ServiceChangeYawController',\
            ServiceClass = SrvCreateJsonableObjectByStr)
        self.choose_yaw_controller.dic_sequence_services = self.dic_sequence_services


#.........这里部分代码省略.........
开发者ID:KTH-AEROWORKS,项目名称:sml_under_development,代码行数:103,代码来源:choose_mission.py

示例15: MyPlugin

# 需要导入模块: from python_qt_binding.QtGui import QWidget [as 别名]
# 或者: from python_qt_binding.QtGui.QWidget import setWindowTitle [as 别名]
class MyPlugin(Plugin):
    def __init__(self, context):
        super(MyPlugin, self).__init__(context)
        # Give QObjects reasonable names
        self.setObjectName('MyPlugin')

        # Process standalone plugin command-line arguments
        from argparse import ArgumentParser
        parser = ArgumentParser()
        # Add argument(s) to the parser.
        parser.add_argument("-q", "--quiet", action="store_true",
                      dest="quiet",
                      help="Put plugin in silent mode")
        args, unknowns = parser.parse_known_args(context.argv())
        if not args.quiet:
            print 'arguments: ', args
            print 'unknowns: ', unknowns

        # Create QWidget
        self._widget = QWidget()
        # Get path to UI file which is a sibling of this file
        # in this example the .ui and .py file are in the same folder
        ui_file = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'MyPlugin.ui')
        # Extend the widget with all attributes and children from UI file
        loadUi(ui_file, self._widget)
        # Give QObjects reasonable names
        self._widget.setObjectName('MyPluginUi')
        # Show _widget.windowTitle on left-top of each plugin (when 
        # it's set in _widget). This is useful when you open multiple 
        # plugins at once. Also if you open multiple instances of your 
        # plugin at once, these lines add number to make it easy to 
        # tell from pane to pane.
        if context.serial_number() > 1:
            self._widget.setWindowTitle(self._widget.windowTitle() + (' (%d)' % context.serial_number()))
        # Add widget to the user interface
        context.add_widget(self._widget)
        
        # UI interaction
        self._widget.loadProgramButton.clicked.connect(self._loadProgram)
        self._widget.loadPointsButton.clicked.connect(self._loadPoints)
        self._widget.sendButton.clicked.connect(self._sendInstruction)
        self._widget.chooseProgramButton.clicked.connect(self._chooseProgram)
        self._widget.choosePointsButton.clicked.connect(self._choosePoints)
        self._widget.runButton.clicked.connect(self._runProgram)
        self.pub = rospy.Publisher('execute_instruction', String, queue_size=10)
        

    def publish_file(self, fname):
        try:
            with open(fname) as f:
                for line in f:
                    self.pub.publish(line.strip('\n'))
        except IOError:
            QMessageBox.warning(self._widget, "Error opening file", "Error opening file: %s"%fname)
            sys.stderr.write("Error opening file: %s \n"%fname)
        

    def _loadProgram(self):
        fname = self._widget.programPathTextEdit.toPlainText()
        if fname == "":
            sys.stderr.write("No file specified\n")
            QMessageBox.warning(self._widget, "Error loading program", "Please specify a file")
            return
            
        if not fname.endswith(".MB4"):
            sys.stderr.write("Please choose .MB4 file\n")
            QMessageBox.warning(self._widget, "Error loading program", "Wrong extension: Please choose .mb4 file")
            return

        self.pub.publish('---LOAD PROGRAM BEGIN---')
        self.publish_file(fname)
        self.pub.publish('---LOAD PROGRAM END---')


    def _loadPoints(self):
        fname = self._widget.pointsPathTextEdit.toPlainText()
        if fname == "":
            sys.stderr.write("No file specified\n")
            QMessageBox.warning(self._widget, "Error loading points", "Please specify a file")
            return
            
        if not fname.endswith(".POS"):
            sys.stderr.write("Please choose .POS file\n")
            QMessageBox.warning(self._widget, "Error loading points", "Wrong extension: Please choose .pos file")
            return

        self.pub.publish('---LOAD POINTS BEGIN---')
        self.publish_file(fname)
        self.pub.publish('---LOAD POINTS END---')
        
        
    def _runProgram(self):
        self.pub.publish('---RUN PROGRAM---')

    def _sendInstruction(self):
        self.pub.publish('---SINGLE INSTRUCTION---')
        self.pub.publish(self._widget.textEdit.toPlainText())
        

    def _chooseProgram(self):
#.........这里部分代码省略.........
开发者ID:biellls,项目名称:rqt_arm_control_py,代码行数:103,代码来源:my_module.py


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