Python PyQt5.QtCore.QSettings() Examples

The following are 30 code examples for showing how to use PyQt5.QtCore.QSettings(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module PyQt5.QtCore , or try the search function .

Example 1
Project: ANGRYsearch   Author: DoTheEvo   File: angrysearch.py    License: GNU General Public License v2.0 6 votes vote down vote up
def __init__(self, parent=None):
        super().__init__()
        self.settings = Qc.QSettings(CONFIG_PATH, Qc.QSettings.IniFormat)
        self.setting_params = {
            'angrysearch_lite': True,
            'fts': True,
            'typing_delay': False,
            'darktheme': False,
            'fm_path_doubleclick_selects': False,
            'icon_theme': 'adwaita',
            'file_manager': 'xdg-open',
            'row_height': 0,
            'number_of_results': 500,
            'directories_excluded': [],
            'conditional_mounts_for_autoupdate': [],
            'notifications': True,
            'regex_mode': False,
            'close_on_execute': False
        }

        # FOR REGEX MODE, WHEN REGEX QUERY CAN BE RUN SO ONLY ONE ACCESS DB
        self.regex_query_ready = True

        self.read_settings()
        self.init_gui() 
Example 2
Project: qhangups   Author: xmikos   File: __main__.py    License: GNU General Public License v3.0 6 votes vote down vote up
def set_language(self):
        """Change language"""
        settings = QtCore.QSettings()

        language = settings.value("language")
        if not language:
            language = QtCore.QLocale.system().name().split("_")[0]

        lang_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "languages")
        lang_file = "qhangups_{}.qm".format(language)

        qt_lang_path = QtCore.QLibraryInfo.location(QtCore.QLibraryInfo.TranslationsPath)
        qt_lang_file = "qt_{}.qm".format(language)

        if os.path.isfile(os.path.join(lang_path, lang_file)):
            translator.load(lang_file, lang_path)
            qt_translator.load(qt_lang_file, qt_lang_path)
        else:
            translator.load("")
            qt_translator.load("") 
Example 3
Project: qhangups   Author: xmikos   File: conversationwidget.py    License: GNU General Public License v3.0 6 votes vote down vote up
def set_active(self):
        """Activate conversation tab"""
        settings = QtCore.QSettings()

        # Set the client as active
        if settings.value("send_client_active", True, type=bool):
            future = asyncio.async(self.client.set_active())
            future.add_done_callback(lambda future: future.result())

        # Mark the newest event as read
        if settings.value("send_read_state", True, type=bool):
            future = asyncio.async(self.conv.update_read_timestamp())
            future.add_done_callback(lambda future: future.result())

        self.num_unread_local = 0
        self.set_title()
        self.messageTextEdit.setFocus() 
Example 4
Project: pychemqt   Author: jjgomera   File: mainWindow.py    License: GNU General Public License v3.0 6 votes vote down vote up
def closeEvent(self, event=None):
        if self.okToContinue():
            for tab in range(self.centralwidget.count()):
                centralwidget = self.centralwidget.widget(tab)
                scene = centralwidget.subWindowList()[0].widget().scene()
                scene.clearSelection()
            settings = QtCore.QSettings()
            if self.filename:
                filename = QtCore.QVariant(self.filename)
            else:
                filename = QtCore.QVariant()
            settings.setValue("LastFile", filename)
            if self.recentFiles:
                recentFiles = QtCore.QVariant(self.recentFiles)
            else:
                recentFiles = QtCore.QVariant()
            settings.setValue("RecentFiles", recentFiles)
            settings.setValue("Geometry", QtCore.QVariant(self.saveGeometry()))
            settings.setValue("MainWindow/State",
                              QtCore.QVariant(self.saveState()))
            self.close()
        else:
            event.ignore() 
Example 5
Project: eddy   Author: danielepantaleone   File: workspace.py    License: GNU General Public License v3.0 6 votes vote down vote up
def accept(self):
        """
        Create Eddy workspace (if necessary).
        """
        path = self.workspaceField.value()

        try:
            mkdir(path)
        except Exception as e:
            msgbox = QtWidgets.QMessageBox(self)
            msgbox.setDetailedText(format_exception(e))
            msgbox.setIconPixmap(QtGui.QIcon(':/icons/48/ic_error_outline_black').pixmap(48))
            msgbox.setStandardButtons(QtWidgets.QMessageBox.Close)
            msgbox.setText('{0} could not create the specified workspace: {1}!'.format(APPNAME, path))
            msgbox.setWindowIcon(QtGui.QIcon(':/icons/128/ic_eddy'))
            msgbox.setWindowTitle('Workspace setup failed!')
            msgbox.exec_()
            super().reject()
        else:
            settings = QtCore.QSettings(ORGANIZATION, APPNAME)
            settings.setValue('workspace/home', path)
            settings.sync()
            super().accept() 
Example 6
Project: eddy   Author: danielepantaleone   File: session.py    License: GNU General Public License v3.0 6 votes vote down vote up
def doCheckForUpdate(self):
        """
        Execute the update check routine.
        """
        channel = Channel.Beta
        # SHOW PROGRESS BAR
        progressBar = self.widget('progress_bar')
        progressBar.setToolTip('Checking for updates...')
        progressBar.setVisible(True)
        # RUN THE UPDATE CHECK WORKER IN A THREAD
        try:
            settings = QtCore.QSettings(ORGANIZATION, APPNAME)
            channel = Channel.valueOf(settings.value('update/channel', channel, str))
        except TypeError:
            pass
        finally:
            worker = UpdateCheckWorker(channel, VERSION)
            connect(worker.sgnNoUpdateAvailable, self.onNoUpdateAvailable)
            connect(worker.sgnNoUpdateDataAvailable, self.onNoUpdateDataAvailable)
            connect(worker.sgnUpdateAvailable, self.onUpdateAvailable)
            self.startThread('updateCheck', worker) 
Example 7
Project: eddy   Author: danielepantaleone   File: __init__.py    License: GNU General Public License v3.0 6 votes vote down vote up
def setUp(self):
        """
        Initialize test case environment.
        """
        # ACQUIRE LOCK AND FLUSH STREAMS
        testcase_lock.acquire()
        sys.stderr.flush()
        sys.stdout.flush()
        # MAKE SURE TO USE CORRECT SETTINGS
        settings = QtCore.QSettings(ORGANIZATION, APPNAME)
        settings.setValue('workspace/home', WORKSPACE)
        settings.setValue('update/check_on_startup', False)
        settings.sync()
        # MAKE SURE THE WORKSPACE DIRECTORY EXISTS
        mkdir(expandPath(WORKSPACE))
        # MAKE SURE TO HAVE A CLEAN TEST ENVIRONMENT
        rmdir('@tests/.tests/')
        mkdir('@tests/.tests/')
        # INITIALIZED VARIABLES
        self.eddy = None
        self.project = None
        self.session = None 
Example 8
Project: qgis-versioning   Author: Oslandia   File: plugin.py    License: GNU General Public License v2.0 6 votes vote down vote up
def get_conn_from_settings(self, dbname):
        """Retruns a connection info and data from a dbname saved in QgsSettings"""
        qs = QSettings()
        conn_dict = {}
        qs.beginGroup(CONN + '/' + dbname)
        pg_conn_info = None
        if qs.value('service') :
            conn_dict['service'] = qs.value('service')
            pg_conn_info = "service={}".format(conn_dict['service'])
        else:
            conn_dict['database'] = qs.value('database', dbname)
            conn_dict['username'] = qs.value('username', "postgres")
            print("username={}".format(conn_dict['username']))
            conn_dict['host'] = qs.value('host', "127.0.0.1")
            conn_dict['port'] = qs.value('port', "5432")
            conn_dict['password'] = qs.value('password', '')
            pg_conn_info = "dbname='{}' user='{}' host='{}' port='{}' password='{}'".format(
                conn_dict['database'], conn_dict['username'], conn_dict['host'],
                conn_dict['port'], conn_dict['password'])
            
        return (pg_conn_info, conn_dict) 
Example 9
Project: qgis-versioning   Author: Oslandia   File: plugin.py    License: GNU General Public License v2.0 6 votes vote down vote up
def selectDatabase(self):
        dlg = QDialog()
        dlg.setWindowTitle('Choose the database')
        layout = QVBoxLayout(dlg)
        button_box = QDialogButtonBox(dlg)
        button_box.setStandardButtons(
            QDialogButtonBox.Cancel | QDialogButtonBox.Ok)
        button_box.accepted.connect(dlg.accept)
        button_box.rejected.connect(dlg.reject)

        connectionBox = QComboBox(dlg)
        qs = QSettings()
        qs.beginGroup(CONN)
        connections = qs.childGroups()
        connectionBox.addItems(connections)
        qs.endGroup()

        layout.addWidget(connectionBox)
        layout.addWidget(button_box)
        if not dlg.exec_():
            return None

        return connectionBox.currentText() 
Example 10
Project: PFramer   Author: dragondjf   File: toggle_column_mixin.py    License: GNU General Public License v3.0 6 votes vote down vote up
def read_view_settings(self, key, settings=None, reset=False):
        """ Reads the persistent program settings
        
            :param reset: If True, the program resets to its default settings
            :returns: True if the header state was restored, otherwise returns False
        """ 
        logger.debug("Reading view settings for: {}".format(key))
        header_restored = False
        if not reset:
            if settings is None:
                settings = QtCore.QSettings()
            horizontal_header = self._horizontal_header()
            header_restored = horizontal_header.restoreState(settings.value(key))
            
            # update actions
            for col, action in enumerate(horizontal_header.actions()):
                is_checked = not horizontal_header.isSectionHidden(col)
                action.setChecked(is_checked)
                
        return header_restored 
Example 11
Project: artisan   Author: artisan-roaster-scope   File: phases.py    License: GNU General Public License v3.0 6 votes vote down vote up
def updatephases(self):
        self.aw.qmc.phases[0] = self.startdry.value()
        self.aw.qmc.phases[1] = self.enddry.value()
        self.aw.qmc.phases[2] = self.endmid.value()
        self.aw.qmc.phases[3] = self.endfinish.value()

        if self.pushbuttonflag.isChecked():
            self.aw.qmc.phasesbuttonflag = True
        else:
            self.aw.qmc.phasesbuttonflag = False
        self.aw.qmc.redraw(recomputeAllDeltas=False)
        self.savePhasesSettings()
        #save window position (only; not size!)
        settings = QSettings()
        settings.setValue("PhasesPosition",self.frameGeometry().topLeft())
        self.accept() 
Example 12
Project: artisan   Author: artisan-roaster-scope   File: phases.py    License: GNU General Public License v3.0 6 votes vote down vote up
def cancel(self):
        self.aw.qmc.phases = list(self.phases)
        self.aw.qmc.phasesbuttonflag = bool(self.org_phasesbuttonflag)
        self.aw.qmc.phasesfromBackgroundflag = bool(self.org_fromBackgroundflag)
        self.aw.qmc.watermarksflag = bool(self.org_watermarksflag)
        self.aw.qmc.phasesLCDflag = bool(self.org_phasesLCDflag)
        self.aw.qmc.autoDRYflag = bool(self.org_autoDRYflag)
        self.aw.qmc.autoFCsFlag = bool(self.org_autoFCsFlag)
        self.aw.qmc.phasesLCDmode_l = list(self.org_phasesLCDmode_l)
        self.aw.qmc.phasesLCDmode_all = list(self.org_phasesLCDmode_all)
        self.aw.qmc.redraw(recomputeAllDeltas=False)
        self.savePhasesSettings()
        #save window position (only; not size!)
        settings = QSettings()
        settings.setValue("PhasesPosition",self.frameGeometry().topLeft())
        self.reject() 
Example 13
Project: artisan   Author: artisan-roaster-scope   File: roast_properties.py    License: GNU General Public License v3.0 6 votes vote down vote up
def closeEvent(self, _):
        self.disconnecting = True
        if self.ble is not None:
            try:
                self.ble.batteryChanged.disconnect()
                self.ble.weightChanged.disconnect()
                self.ble.deviceDisconnected.disconnect()
            except:
                pass
            try:
                self.ble.disconnectDevice()
            except:
                pass
        settings = QSettings()
        #save window geometry
        settings.setValue("RoastGeometry",self.saveGeometry())

    # triggered via the cancel button 
Example 14
Project: artisan   Author: artisan-roaster-scope   File: dialogs.py    License: GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent = None, aw = None, title = "", content = ""):
        super(HelpDlg,self).__init__(parent, aw)
        self.setWindowTitle(title) 
        self.setModal(False)
        
        settings = QSettings()
        if settings.contains("HelpGeometry"):
            self.restoreGeometry(settings.value("HelpGeometry"))

        phelp = QTextEdit()
        phelp.setHtml(content)
        phelp.setReadOnly(True)

        # connect the ArtisanDialog standard OK/Cancel buttons
        self.dialogbuttons.removeButton(self.dialogbuttons.button(QDialogButtonBox.Cancel))
        self.dialogbuttons.accepted.connect(self.close)

        buttonLayout = QHBoxLayout()
        buttonLayout.addStretch()
        buttonLayout.addWidget(self.dialogbuttons)
        hLayout = QVBoxLayout()
        hLayout.addWidget(phelp)
        hLayout.addLayout(buttonLayout)
        self.setLayout(hLayout)
        self.dialogbuttons.button(QDialogButtonBox.Ok).setFocus() 
Example 15
Project: ANGRYsearch   Author: DoTheEvo   File: angrysearch.py    License: GNU General Public License v2.0 5 votes vote down vote up
def __init__(self, parent):
        super().__init__(parent)
        self.values = dict()
        self.last_signal = ''
        self.settings = Qc.QSettings(CONFIG_PATH, Qc.QSettings.IniFormat)
        self.init_ui() 
Example 16
Project: qutebrowser   Author: qutebrowser   File: test_configfiles.py    License: GNU General Public License v3.0 5 votes vote down vote up
def test_init(init_patch, config_tmpdir):
    configfiles.init()

    # Make sure qsettings land in a subdir
    if utils.is_linux:
        settings = QSettings()
        settings.setValue("hello", "world")
        settings.sync()
        assert (config_tmpdir / 'qsettings').exists()

    # Lots of other stuff is tested in test_configinit.py 
Example 17
Project: raster-vision-qgis   Author: azavea   File: raster_vision.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, iface):
        """Constructor.

        :param iface: An interface instance that will be passed to this class
            which provides the hook by which you can manipulate the QGIS
            application at run time.
        :type iface: QgsInterface
        """

        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value('locale/userLocale')[0:2]
        locale_path = os.path.join(
            self.plugin_dir,
            'i18n',
            'RasterVisionPlugin_{}.qm'.format(locale))

        if os.path.exists(locale_path):
            self.translator = QTranslator()
            self.translator.load(locale_path)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)

        # Create the dialog (after translation) and keep reference
        self.experiment_controller = ExperimentDialogController(self.iface)
        self.predict_controller = PredictDialogController(self.iface)
        self.profiles_controller = ProfilesDialogController()
        self.config_controller = ConfigDialogController()

        # Declare instance attributes
        self.actions = []
        self.menu = self.tr(u'&Raster Vision')
        # TODO: We are going to let the user set this up in a future iteration
        self.toolbar = self.iface.addToolBar(u'RasterVisionPlugin')
        self.toolbar.setObjectName(u'RasterVisionPlugin')

    # noinspection PyMethodMayBeStatic 
Example 18
Project: qhangups   Author: xmikos   File: __main__.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, refresh_token_path, parent=None):
        super().__init__(parent)
        self.set_language()

        self.refresh_token_path = refresh_token_path
        self.hangups_running = False
        self.client = None

        self.create_actions()
        self.create_menu()
        self.create_icon()
        self.update_status()

        # These are populated by on_connect when it's called.
        self.conv_list = None  # hangups.ConversationList
        self.user_list = None  # hangups.UserList
        self.notifier = None   # hangups.notify.Notifier

        # Widgets
        self.conversations_dialog = QHangupsConversationsList(controller=self)
        self.messages_dialog = QHangupsConversations(controller=self)

        # Setup system tray icon doubleclick timer
        self.icon_doubleclick_timer = QtCore.QTimer(self)
        self.icon_doubleclick_timer.setSingleShot(True)
        self.icon_doubleclick_timer.timeout.connect(self.icon_doubleclick_timeout)

        # Handle signals on Unix
        # (add_signal_handler is not implemented on Windows)
        try:
            loop = asyncio.get_event_loop()
            for signum in (signal.SIGINT, signal.SIGTERM):
                loop.add_signal_handler(signum, lambda: self.quit(force=True))
        except NotImplementedError:
            pass

        settings = QtCore.QSettings()

        if settings.value("autoconnect", False, type=bool):
            self.hangups_start() 
Example 19
Project: qhangups   Author: xmikos   File: settings.py    License: GNU General Public License v3.0 5 votes vote down vote up
def populate_ui(self):
        """Load settings and populate dialog"""
        settings = QtCore.QSettings()

        self.sendClientActiveCheckBox.setChecked(settings.value("send_client_active", True, type=bool))
        self.sendReadStateCheckBox.setChecked(settings.value("send_read_state", True, type=bool))
        self.enterSendMessageCheckBox.setChecked(settings.value("enter_send_message", False, type=bool))
        self.connectionEventsCheckBox.setChecked(settings.value("connection_events", True, type=bool))
        self.autoConnectCheckBox.setChecked(settings.value("autoconnect", False, type=bool))

        lang_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "languages")

        self.languageComboBox.clear()
        self.languageComboBox.addItem(QtCore.QLocale.languageToString(QtCore.QLocale("en").language()), "en")

        for f in glob.glob(os.path.join(lang_path, "*.qm")):
            file_locale = os.path.splitext(os.path.basename(f))[0].split("_")[-1]
            file_lang = QtCore.QLocale.languageToString(QtCore.QLocale(file_locale).language())
            self.languageComboBox.addItem(file_lang, file_locale)

        language = settings.value("language")
        if not language:
            language = QtCore.QLocale.system().name().split("_")[0]

        i = self.languageComboBox.findData(language)
        if i == -1:
            self.languageComboBox.setCurrentIndex(0)
        else:
            self.languageComboBox.setCurrentIndex(i) 
Example 20
Project: qhangups   Author: xmikos   File: settings.py    License: GNU General Public License v3.0 5 votes vote down vote up
def accept(self):
        """Save settings after clicking on OK button"""
        settings = QtCore.QSettings()
        settings.setValue("send_client_active", self.sendClientActiveCheckBox.isChecked())
        settings.setValue("send_read_state", self.sendReadStateCheckBox.isChecked())
        settings.setValue("enter_send_message", self.enterSendMessageCheckBox.isChecked())
        settings.setValue("language", self.languageComboBox.itemData(self.languageComboBox.currentIndex()))
        settings.setValue("connection_events", self.connectionEventsCheckBox.isChecked())
        settings.setValue("autoconnect", self.autoConnectCheckBox.isChecked())
        QtWidgets.QDialog.accept(self) 
Example 21
Project: qhangups   Author: xmikos   File: conversationslist.py    License: GNU General Public License v3.0 5 votes vote down vote up
def save_geometry(self):
        """Save window position and size"""
        settings = QtCore.QSettings()
        settings.setValue("conversationslist_geometry", self.saveGeometry()) 
Example 22
Project: qhangups   Author: xmikos   File: conversations.py    License: GNU General Public License v3.0 5 votes vote down vote up
def save_geometry(self):
        """Save window position and size"""
        settings = QtCore.QSettings()
        settings.setValue("conversations_geometry", self.saveGeometry()) 
Example 23
Project: qhangups   Author: xmikos   File: conversations.py    License: GNU General Public License v3.0 5 votes vote down vote up
def restore_geometry(self):
        """Restore window position and size from saved values"""
        settings = QtCore.QSettings()
        if settings.value("conversations_geometry"):
            self.restoreGeometry(settings.value("conversations_geometry")) 
Example 24
Project: qhangups   Author: xmikos   File: conversationwidget.py    License: GNU General Public License v3.0 5 votes vote down vote up
def get_num_unread(self, local_unread=False):
        """Get number of unread messages (server-side or local)"""
        settings = QtCore.QSettings()
        if not settings.value("send_read_state", True, type=bool) or local_unread:
            num_unread = self.num_unread_local
        else:
            num_unread = len([conv_event for conv_event in self.conv.unread_events if
                              isinstance(conv_event, hangups.ChatMessageEvent) and
                              not self.conv.get_user(conv_event.user_id).is_self])
        return num_unread 
Example 25
Project: Lector   Author: BasioMeusPuga   File: settings.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent):
        self.parent = parent
        self.settings = QtCore.QSettings('Lector', 'Lector')

        default_profile1 = {
            'font': 'Noto Sans Fallback',
            'foreground': QtGui.QColor().fromRgb(0, 0, 0),
            'background': QtGui.QColor().fromRgb(216, 216, 216),
            'padding': 150,
            'font_size': 30,
            'line_spacing': 110,
            'text_alignment': 'justify'}

        default_profile2 = {
            'font': 'Roboto',
            'foreground': QtGui.QColor().fromRgb(194, 194, 194),
            'background': QtGui.QColor().fromRgb(22, 22, 22),
            'padding': 150,
            'font_size': 30,
            'line_spacing': 110,
            'text_alignment': 'justify'}

        default_profile3 = {
            'font': 'Clear Sans',
            'foreground': QtGui.QColor().fromRgb(101, 123, 131),
            'background': QtGui.QColor().fromRgb(0, 43, 54),
            'padding': 150,
            'font_size': 30,
            'line_spacing': 110,
            'text_alignment': 'justify'}

        self.default_profiles = [
            default_profile1, default_profile2, default_profile3]

        self.default_comic_profile = {
            'padding': 100,  # pixel padding on either size
            'background': QtGui.QColor().fromRgb(0, 0, 0),
            'zoom_mode': 'bestFit'} 
Example 26
Project: persepolis   Author: persepolisdm   File: error_window.py    License: GNU General Public License v3.0 5 votes vote down vote up
def resetPushButtonPressed(self, button):
        # create an object for PersepolisDB
        persepolis_db = PersepolisDB()

        # Reset data base
        persepolis_db.resetDataBase()

        # close connections
        persepolis_db.closeConnections()

        # Reset persepolis_setting
        persepolis_setting = QSettings('persepolis_download_manager', 'persepolis')
        persepolis_setting.clear()
        persepolis_setting.sync() 
Example 27
Project: dottorrent-gui   Author: kz26   File: gui.py    License: GNU General Public License v3.0 5 votes vote down vote up
def getSettings(self):
        portable_fn = PROGRAM_NAME + '.ini'
        portable_fn = os.path.join(_basedir, portable_fn)
        if os.path.exists(portable_fn):
            return QtCore.QSettings(
                portable_fn,
                QtCore.QSettings.IniFormat
            )
        return QtCore.QSettings(
            QtCore.QSettings.IniFormat,
            QtCore.QSettings.UserScope,
            PROGRAM_NAME,
            PROGRAM_NAME
        ) 
Example 28
Project: Hqgis   Author: riccardoklinger   File: hqgis.py    License: GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, iface):
        self.provider = HqgisProvider()
        # Save reference to the QGIS interface
        self.iface = iface
        # initialize plugin directory
        self.plugin_dir = os.path.dirname(__file__)
        # initialize locale
        locale = QSettings().value('locale/userLocale')[0:2]
        locale_path = os.path.join(
            self.plugin_dir,
            'i18n',
            'Hqgis_{}.qm'.format(locale))

        if os.path.exists(locale_path):
            self.translator = QTranslator()
            self.translator.load(locale_path)

            if qVersion() > '4.3.3':
                QCoreApplication.installTranslator(self.translator)

        # Create the dialog (after translation) and keep reference
        self.dlg = HqgisDialog()

        # Declare instance attributes
        self.actions = []
        self.menu = self.tr(u'&Hqgis')
        # TODO: We are going to let the user set this up in a future iteration
        self.toolbar = self.iface.addToolBar(u'Hqgis')
        self.toolbar.setObjectName(u'Hqgis')
        self.getMapCoordinates = GetMapCoordinates(self.iface)
        self.getMapCoordTool = None

    # noinspection PyMethodMayBeStatic 
Example 29
Project: DevilYuan   Author: moyuanz   File: DyBasicMainWindow.py    License: MIT License 5 votes vote down vote up
def _saveWindowSettings(self):
        """保存窗口设置"""
        settings = QtCore.QSettings('DevilYuan', 'DevilYuanQuant')
        settings.setValue(self.name + 'State', self.saveState())
        settings.setValue(self.name + 'Geometry', self.saveGeometry()) 
Example 30
Project: DevilYuan   Author: moyuanz   File: DyBasicMainWindow.py    License: MIT License 5 votes vote down vote up
def _loadWindowSettings(self):
        """载入窗口设置"""
        settings = QtCore.QSettings('DevilYuan', 'DevilYuanQuant')
        try:
            ret = self.restoreState(settings.value(self.name + 'State'))
            ret = self.restoreGeometry(settings.value(self.name + 'Geometry'))    
        except Exception as ex:
            pass