Results 1 to 17 of 17

Thread: How to read registry entries

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to read registry entries

    So are you 100% sure that the registry path is correct? Does this assert?
    Qt Code:
    1. QSettings settings("HKEY_CURRENT_USER", QSettings::NativeFormat);
    2. Q_ASSERT_X(settings.childGroups().contains("Software"), "Software", "Software doesn't exist");
    3. settings.beginGroup("Software");
    4.  
    5. Q_ASSERT_X(settings.childGroups().contains("Burn"), "Burn", "Burn doesn't exist");
    6. settings.beginGroup("Burn");
    7.  
    8. Q_ASSERT_X(!settings.allKeys().isEmpty(), "Keys", "Software/Burn is empty");
    9. qDebug() << settings.allKeys();
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. #2
    Join Date
    Jun 2008
    Posts
    22

    Default Re: How to read registry entries

    If I include this snippet, I don't get any output.
    Infact, qDebug does not work for me I guess.

    Just don't know how to get this working...
    Last edited by Abc; 21st August 2008 at 14:25.

  3. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: How to read registry entries

    You could have said that earlier when I asked for the output of childKeys() and childGroups(). In case you're using an IDE of some kind, check its output console. In case you're not, enable console by adding
    Qt Code:
    1. CONFIG += debug console
    To copy to clipboard, switch view to plain text mode 
    to the .pro file, re-run qmake, make clean and recompile the application. Now you should see some output in the console window.
    J-P Nurmi

  4. #4
    Join Date
    Jun 2008
    Posts
    22

    Default Re: How to read registry entries

    If I include this in the .pro file, the application does not build.

    I am writing Qt code in notepad++ and using Qt 4.4.0 Command Prompt to build my application.

    I did this... added the given line to .pro file, did a make clean and then qmake followed by a make.
    The error message reads like...
    C:\MinGW\bin\..\lib\gcc\ming32\3.4.5\..\..\..\..\m ingw32\bin\ld.exe: cannot find -lQtGuid4
    collect2: ld returned 1 exit status
    mingw32-make[1]: *** [debug\myApplication.exe] Error 1
    mingw32-make[1]: Leaving directory '<path to the directory>'
    mingw32-make: *** [debug] Error 2

  5. #5
    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: How to read registry entries

    You don't have Qt libraries built in debug mode. There should be a "Build Qt in debug mode" or similar link in start menu.

Similar Threads

  1. External Lib read from QBuffer on Calback problem
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 2nd June 2008, 19:43
  2. How to read CD with read?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 29th June 2007, 08:20
  3. QIODevice read()
    By ShaChris23 in forum Newbie
    Replies: 1
    Last Post: 3rd May 2007, 00:29

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.