zoukankan      html  css  js  c++  java
  • QSetting的用法

    settings = Qsettings(“MySoft”,”QtPad”)
    Mainwindow = QmainWindow()
    settings.setValue(“pos”,QVariant(Mainwindow.pos())
    settings.setValue(“size”,QVariant(Mainwindow.size())


    Qsetting.fileName() 返回写入注册表地址,或者INI文件路径

    settings = QSettings("./QtPad.ini", QSettings.IniFormat)
    settings.setValue("pos", QVariant(self.pos()))
    settings.setValue("size", QVariant(self.size()))
    就会在当前文件夹下产生一个QtPad.ini文件,打开后文件内容为:
    [General]
    pos=@Point(200 200)
    size=@Size(400 400)


    QSettings settings(filename, QSettings::IniFormat); ///创建一个对象

    settings.beginGroup(group);
    QVariant value = settings.value(name, defaultValue);
    settings.endGroup();

  • 相关阅读:
    HackerRank
    HackerRank
    HackerRank
    LeetCode "Bitwise AND of Numbers Range"
    HackerRank
    HackerRank
    LeetCode "Binary Tree Right Side View"
    HihoCoder
    HihoCoder
    HackerRank
  • 原文地址:https://www.cnblogs.com/countryboy666/p/11831715.html
Copyright © 2011-2022 走看看