def __init__(self, settings, parent=None):
        """
        +-----------------------------------------------------------------------+
        | +--- hbox ----------------------------------------------------------+ |
        | | +-- list widget--------------+  +- vbox ------------------------+ | |
        | | |                            |  | +- QTextEdit ---------------+ | | |
        | | |  - key                     |  | |                           | | | |
        | | |  - key                     |  | |  value                    | | | |
        | | |  - key                     |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | +---------------------------+ | | |
        | | |                            |  |                               | | |
        | | |                            |  | +- QPushButton -------------+ | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |  save                     | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | +---------------------------+ | | |
        | | +----------------------------+  +-------------------------------+ | |
        | +-------------------------------------------------------------------+ |
        +-----------------------------------------------------------------------+
        """
        super(IdaSettingsView, self).__init__(parent=parent)
        self._settings = settings
        self._current_key = None
        self._current_scope = None

        hbox = QtWidgets.QHBoxLayout(self)
        self._key_list = QtWidgets.QListWidget()
        for scope, keys in (("idb", self._settings.idb.iterkeys()),
                            ("directory", self._settings.directory.iterkeys()),
                            ("user", self._settings.user.iterkeys()),
                            ("system", self._settings.system.iterkeys())):
            for key in keys:
                self._key_list.addItem("({scope:s}) {key:s}".format(scope=scope, key=key))

        hbox.addWidget(self._key_list)

        vbox = QtWidgets.QVBoxLayout(self)
        self._value_view = QtWidgets.QTextEdit(self)
        self._save_button = QtWidgets.QPushButton("save")
        vbox.addWidget(self._value_view)
        vbox.addWidget(self._save_button)

        hbox.addLayout(vbox)
 
        self._key_list.currentItemChanged.connect(self._handle_key_changed)
        self._save_button.clicked.connect(self._handle_save_value)

        self.setLayout(hbox)
def __init__ ( self , settings , parent = None ) : super ( IdaSettingsView , self ) . __init__ ( parent = parent ) self . _settings = settings self . _current_key = None self . _current_scope = None hbox = QtWidgets . QHBoxLayout ( self ) self . _key_list = QtWidgets . QListWidget ( ) for scope , keys in ( ( "idb" , self . _settings . idb . iterkeys ( ) ) , ( "directory" , self . _settings . directory . iterkeys ( ) ) , ( "user" , self . _settings . user . iterkeys ( ) ) , ( "system" , self . _settings . system . iterkeys ( ) ) ) : for key in keys : self . _key_list . addItem ( "({scope:s}) {key:s}" . format ( scope = scope , key = key ) ) hbox . addWidget ( self . _key_list ) vbox = QtWidgets . QVBoxLayout ( self ) self . _value_view = QtWidgets . QTextEdit ( self ) self . _save_button = QtWidgets . QPushButton ( "save" ) vbox . addWidget ( self . _value_view ) vbox . addWidget ( self . _save_button ) hbox . addLayout ( vbox ) self . _key_list . currentItemChanged . connect ( self . _handle_key_changed ) self . _save_button . clicked . connect ( self . _handle_save_value ) self . setLayout ( hbox )
+-----------------------------------------------------------------------+
        | +--- hbox ----------------------------------------------------------+ |
        | | +-- list widget--------------+  +- vbox ------------------------+ | |
        | | |                            |  | +- QTextEdit ---------------+ | | |
        | | |  - key                     |  | |                           | | | |
        | | |  - key                     |  | |  value                    | | | |
        | | |  - key                     |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | +---------------------------+ | | |
        | | |                            |  |                               | | |
        | | |                            |  | +- QPushButton -------------+ | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | |  save                     | | | |
        | | |                            |  | |                           | | | |
        | | |                            |  | +---------------------------+ | | |
        | | +----------------------------+  +-------------------------------+ | |
        | +-------------------------------------------------------------------+ |
        +-----------------------------------------------------------------------+