Well, you could use
bool QFile::exists ( const QString & fileName )
To copy to clipboard, switch view to plain text mode
to see if your file exists
or
you could use
QSettings to read a value from the registry which you have written
QSettings ( Format format, Scope scope, const QString & organization, const QString & application = QString(), QObject * parent = 0 )
To copy to clipboard, switch view to plain text mode
i.e.
QSettings settings(QSettings::SystemScope, "Your name", "Program name");
To copy to clipboard, switch view to plain text mode
and then
to see if your value has been set
blnMyBoolean= settings.value("program_has_been_run_once", 0).toBool();
if (blnBoolean == false)
{
//the program has not been run
//do your stuff
//and set the entry to true
settings.setValue("program_has_been_run_once", true);
}
blnMyBoolean= settings.value("program_has_been_run_once", 0).toBool();
if (blnBoolean == false)
{
//the program has not been run
//do your stuff
//and set the entry to true
settings.setValue("program_has_been_run_once", true);
}
To copy to clipboard, switch view to plain text mode
maybe that helps - I use the registry for all those sort of things. If you're not using windows QSettings will still work fine. It'll write to preference or ini files.
K
Bookmarks