How to use the qtpyvcp.actions.bindWidget function in qtpyvcp

To help you get started, we’ve selected a few qtpyvcp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kcjengr / qtpyvcp / qtpyvcp / widgets / form_widgets / main_window.py View on Github external
}

        if action_name is not None:
            try:
                mod, action = action_name.split('.', 1)
                method = getattr(env.get(mod, self), action)
                if menu_action.isCheckable():
                    menu_action.triggered.connect(method)
                else:
                    menu_action.triggered.connect(lambda checked: method(*args, **kwargs))
                return
            except:
                pass

            try:
                actions.bindWidget(menu_action, action_name)
                return
            except actions.InvalidAction:
                LOG.exception('Error binding menu action %s', action_name)

        msg = "The <b>{}</b> action specified for the " \
              "<b>{}</b> menu item could not be triggered. " \
              "Check the YAML config file for errors." \
              .format(action_name or '', title.replace('&amp;', ''))
        menu_action.triggered.connect(lambda: QMessageBox.critical(self, "Menu Action Error!", msg))
github kcjengr / qtpyvcp / qtpyvcp / widgets / button_widgets / action_button.py View on Github external
def actionName(self, action_name):
        self._action_name = action_name
        try:
            bindWidget(self, action_name)
        except InvalidAction:
            pass
github kcjengr / qtpyvcp / qtpyvcp / widgets / input_widgets / action_slider.py View on Github external
def actionName(self, action_name):
        """Sets the name of the action the slider should trigger.

        Args:
            action_name (str) : A fully qualified action name.
        """
        self._action_name = action_name
        bindWidget(self, action_name)
github kcjengr / qtpyvcp / qtpyvcp / widgets / input_widgets / action_combobox.py View on Github external
def actionName(self, action_name):
        """Sets the name of the action the button should trigger and
            binds the widget to that action.

        Args:
            action_name (str) : A fully qualified action name.
        """
        self._action_name = action_name
        bindWidget(self, action_name)
github kcjengr / qtpyvcp / qtpyvcp / widgets / button_widgets / action_checkbox.py View on Github external
def actionName(self, action_name):
        self._action_name = action_name
        bindWidget(self, action_name)