Shifts all action shortcuts for the given widget to us the
    WidgetWithChildrenShortcut context, effectively localizing it to this
    widget.
    
    :param      widget | <QWidget>
432389
def localizeShortcuts(widget):
    
    import_qt(globals())
    
    for action in widget.findChildren(QtGui.QAction):
        action.setShortcutContext(QtCore.Qt.WidgetWithChildrenShortcut)
274651
def set_shortcut(self, name, shortcut):
        

        name = self.__normalize_name(name)
        action = self.get_action(name)
        if not action:
            return

        action.setShortcut(QKeySequence(shortcut))
        return True
297872
def init_widget(self):
        
        super(AndroidSwipeRefreshLayout, self).init_widget()
        d = self.declaration
        w = self.widget
        if not d.enabled:
            self.set_enabled(d.enabled)
        if d.indicator_background_color:
            self.set_indicator_background_color(d.indicator_background_color)
        if d.indicator_color:
            self.set_indicator_color(d.indicator_color)
        if d.trigger_distance:
            self.set_trigger_distance(d.trigger_distance)
        w.onRefresh.connect(self.on_refresh)
        w.setOnRefreshListener(w.getId())
962541
def addWidget(self, widget, align=Qt.AlignLeft, before=None):
        
        # self.uiToolbarLAYOUT points to a deleted C/C++ object in PySide...
        layout = self.findChild(QHBoxLayout, 'uiToolbarLAYOUT')
        
        if before is not None:
            index = None
            for i in range(layout.count()):
                if layout.itemAt(i).widget() == before:
                    index = i
                    break
            
            if index is not None:
                layout.insertWidget(index, widget)
            else:
                layout.addWidget(widget)
            
        if align == Qt.AlignLeft:
            layout.insertWidget(0, widget)
        else:
            layout.addWidget(widget)
1012904
public void setWidgets (Iterable<Actor> actors) {
		clearChildren();
		widgetBounds.clear();
		scissors.clear();
		handleBounds.clear();
		splits.clear();

		for (Actor actor : actors) {
			super.addActor(actor);
			widgetBounds.add(new Rectangle());
			scissors.add(new Rectangle());
		}
		float currentSplit = 0;
		float splitAdvance = 1f / getChildren().size;
		for (int i = 0; i < getChildren().size - 1; i++) {
			handleBounds.add(new Rectangle());
			currentSplit += splitAdvance;
			splits.add(currentSplit);
		}
		invalidate();
	}
269771
def update_shortcut_settings(self):
        
        self.shortcut_list_store.clear()
        shortcuts = self.gui_config_model.get_current_config_value("SHORTCUTS", use_preliminary=True, default={})
        actions = sorted(shortcuts.keys())
        for action in actions:
            keys = shortcuts[action]
            self.shortcut_list_store.append((str(action), str(keys)))
714173
def create_widget(self):
        
        d = self.declaration
        self.widget = RelativeLayout(self.get_context(), None, d.style)
359301
@Override
    protected void defineWidgets() {

        initModule();
        setKeyPrefix(KEY_PREFIX);

        addWidget(new CmsWidgetDialogParameter(m_dependency, "name", PAGES[0], new CmsSelectWidget(getModules())));
        addWidget(new CmsWidgetDialogParameter(m_dependency, "version.version", PAGES[0], new CmsInputWidget()));

    }
646063
def is_shortcut_in_use(self, shortcut):
        

        for path, actionName, action in foundations.walkers.dictionaries_walker(self.__categories):
            if action.shortcut() == QKeySequence(shortcut):
                return True
        return False
1131633
def findUiActions( widget ):
    
    import_qt(globals())
    
    output = []
    for action in widget.findChildren(QtGui.QAction):
        name = nativestring(action.objectName()).lower()
        if ( name.startswith('ui') and name.endswith('act') ):
            output.append(action)
    return output
474724
def init_widget(self):
        
        super(AndroidViewAnimator, self).init_widget()
        d = self.declaration
        if d.animate_first_view:
            self.set_animate_first_view(d.animate_first_view)
        if d.displayed_child:
            self.set_displayed_child(d.displayed_child)
1048507
def set_corner_widgets(self, corner_widgets):
        
        assert isinstance(corner_widgets, dict)
        assert all(key in (Qt.TopLeftCorner, Qt.TopRightCorner)
                   for key in corner_widgets)
        self.corner_widgets.update(corner_widgets)
        for corner, widgets in list(self.corner_widgets.items()):
            cwidget = QWidget()
            cwidget.hide()
            prev_widget = self.cornerWidget(corner)
            if prev_widget:
                prev_widget.close()
            self.setCornerWidget(cwidget, corner)
            clayout = QHBoxLayout()
            clayout.setContentsMargins(0, 0, 0, 0)
            for widget in widgets:
                if isinstance(widget, int):
                    clayout.addSpacing(widget)
                else:
                    clayout.addWidget(widget)
            cwidget.setLayout(clayout)
            cwidget.show()
565253
def create_widget(self):
        
        d = self.declaration
        self.widget = TextClock(self.get_context(), None, d.style)
163127
def _close_widget(widget):
        
        if widget is None:
            return
        try:
            widget.document().setParent(None)
            widget.syntax_highlighter.setParent(None)
        except AttributeError:
            pass  # not a QPlainTextEdit subclass
        # handled cloned widgets
        clones = []
        if hasattr(widget, 'original') and widget.original:
            # cloned widget needs to be removed from the original
            widget.original.clones.remove(widget)
            try:
                widget.setDocument(None)
            except AttributeError:
                # not a QTextEdit/QPlainTextEdit
                pass
        elif hasattr(widget, 'clones'):
            clones = widget.clones
        try:
            # only clear current editor if it does not have any other clones
            widget.close(clear=len(clones) == 0)
        except (AttributeError, TypeError):
            # not a CodeEdit
            widget.close()
        return clones
1215101
@UiChild(limit = 1, tagname = "widget")
  public void setChildWidget(final TakesValue<T> pwidget) {
    widget = (Widget) pwidget;
    contents.add(widget);
    setEditor(new ExtendedValueBoxEditor<>(pwidget, this));
  }
1078072
def add_context_action(self, action):
        
        self.main_tab_widget.context_actions.append(action)
        for child_splitter in self.child_splitters:
            child_splitter.add_context_action(action)
1027936
@Override
	public void setWidget( Widget w )
	{
		// Validate
		if( w == widget )
			return;

		// Detach new child.
		if( w != null )
			w.removeFromParent();

		// Remove old child.
		if( widget != null )
			remove( widget );

		// Logical attach.
		widget = w;

		if( w != null )
		{
			// Physical attach.
			DOM.appendChild( containerElement, widget.getElement() );

			adopt( w );
		}
	}