Results 1 to 1 of 1

Thread: Can't read Win7 registry value via QSettings

  1. #1
    Join Date
    Sep 2008
    Thanked 5 Times in 4 Posts
    Qt products
    Qt4 Qt/Embedded

    Default Can't read Win7 registry value via QSettings

    Hello mates

    The code below works fine on Win XP,but it shows 0 on Win7 and Win8
    Qt Code:
    1. QSettings rnidRegistryEntry("HKEY_LOCAL_MACHINE\\SOFTWARE\\Telenor Connect\\rnid", QSettings::NativeFormat);
    2. int rnid = rnidRegistryEntry.value("Rnid").toInt();//say there is 130 here
    3. QMessageBox::about(this, 0, QString::number(rnid));//XP-shows 130, Win7 - 0
    To copy to clipboard, switch view to plain text mode 

    From what I've found out it is due to these more modern systems are more restrictive when it comes to access the registry.So my question is how to get a value from registry on the newer Windows using QSettings?

    Ah,I forgot - Qt 5.3.2,Visual Studio 2013,Qt Add-In 1.2.3
    Last edited by MasterBLB; 24th October 2014 at 07:27.

Similar Threads

  1. Replies: 6
    Last Post: 17th December 2012, 11:53
  2. QSettings and Windows registry - removing a key
    By lxman in forum Qt Programming
    Replies: 1
    Last Post: 29th July 2011, 20:43
  3. Replies: 1
    Last Post: 24th June 2011, 11:11
  4. Replies: 1
    Last Post: 19th September 2008, 15:43
  5. [QSettings] Why limiting to plain file or registry ?
    By lauranger in forum Qt Programming
    Replies: 8
    Last Post: 13th September 2006, 14:25

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.