Results 1 to 3 of 3

Thread: setting valeu through registry

  1. #1
    Join Date
    Sep 2007
    Posts
    1
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Windows

    Default setting valeu through registry

    HI ALL
    Im'm new to Qt. Ive stored some values in registry.compiled that and ran it. its running fine. but while changing these values from registry its not updating in exe files. i need u peoples help. IIm pasting the code in below.

    void LoadVersionStrings ()

    {
    //Get the FixedFileInfo block
    QSettings settings("MySOFT","STARRUNNER");
    settings.setValue("Product Version"," Product Version 7.5.1.1");
    settings.value("interval").toString();
    settings.setValue("File Version","File Version 7.5.1.1");
    QString str1;
    QString str2;
    QVariant QVariantObj1;
    QVariant QVariantObj2;
    QSettingsNew = settings.value("DB Systel", true);
    QVariantObj1=settings.value("Product Version",1024);
    QVariantObj2=settings.value("File Version",1024);
    str1=(QVariantObj1).toString () ;
    str2=(QVariantObj2).toString () ;
    QMessageBox::information(this,"Product Version",str1,0);
    QMessageBox::information(this,"File Version",str2,0);
    bool test;
    //test=contains ( const QString & HKEY_CURRENT_USER/SoftWare/DB Systel );
    test=contains ( const QString "HKEY_CURRENT_USER/SoftWare/DB Systel" );
    //QWArning()<<test;
    }

    while changing the value from 7.5.1.1 to 7.5 in registry its not affecting exe file. that is next time im running that exe im getting same output i.e. 7.5.1.1.
    Thank you all.

  2. #2
    Join Date
    Jun 2007
    Location
    India/Bangalore
    Posts
    156
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: setting valeu through registry

    If you changed the value in registry you should read back again from registry then only it will affect ur exe.
    Thanks,
    Rajesh.S

  3. The following user says thank you to rajeshs for this useful post:

    sudhansu.kanungo (1st October 2007)

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: setting valeu through registry

    Quote Originally Posted by sudhansu.kanungo View Post
    settings.setValue("Product Version"," Product Version 7.5.1.1");
    settings.value("interval").toString(); //<---------------------------------------------- this line does nothing
    settings.setValue("File Version","File Version 7.5.1.1");
    ....
    QVariantObj1=settings.value("Product Version",1024);
    QVariantObj2=settings.value("File Version",1024);
    ...
    while changing the value from 7.5.1.1 to 7.5 in registry its not affecting exe file. that is next time im running that exe im getting same output i.e. 7.5.1.1.
    Always read what you wrote. First you change both versions to 7.5.1.1 and then you read them. This way you will always get 7.5.1.1, no matter what's in registry.

  5. The following user says thank you to jacek for this useful post:

    sudhansu.kanungo (1st October 2007)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.