Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Polish
  4. QSettings - sprawdzania gałęzi rejestru
Forum Updated to NodeBB v4.3 + New Features

QSettings - sprawdzania gałęzi rejestru

Scheduled Pinned Locked Moved Polish
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    maniek1310
    wrote on last edited by
    #1

    Witam, za pomocą biblioteki QSettings, napisałem dwie funkcje, sprawdzające oraz usuwające klucze rejestru. Tylko teraz mam problem, bo nie wiem jak zmodyfikować te funkcje aby można było usuwać oraz sprawdzać czy istnieje dana gałąż. Przykład :

    Mamy gałąź HKEY_CLASSES_ROOT\Directory\background\shell\Opróźnij kosz i teraz chciałbym sprawdzić czy gałąź "Opróźnij kosz" istnieje czy nie, jeżeli istnieje to żeby ta gałąź została usunięta.

    Funkcje :
    @int Config_os::sprawdz_klucz(QString gdzie, QString key, QString val, QString type)
    {
    QSettings reg(gdzie, QSettings::NativeFormat);
    QString war;

    if(type == "int")
    {
        war = QString::number(reg.value(key).toInt());
    }else if(type == "double")
    {
        war = QString::number(reg.value(key).toDouble());
    }else if(type == "string")
    {
        war = QString(reg.value(key).toString());
    }
    
    if(war == val)
    {
        return 2;
    }else{
        return 4;
    }
    
    return 0;
    

    }

    int Config_os::usun_klucz(QString gdzie, QString key)
    {
    QSettings reg(gdzie, QSettings::NativeFormat);
    QString war;

    reg.remove(key);
    
    if(reg.status() == QSettings::NoError)
        return 2;
    else
        return 4;
    

    }@

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved