PDA

View Full Version : Read the file into



offline
12th April 2010, 11:14
i want to read WEBOPEN in config.qt file. can you help me?


QString Urlweb;
static const ConfigFile *config = new ConfigFile("config.qt");
config->readInto(Urlweb,"WEBOPEN");
QWebView *view = new QWebView;

view->load(QUrl(Urlweb));
view->show();
view->setWindowState(Qt::WindowFullScreen);


config.qt file

WEBOPEN=http://www.google.com.tr

wysota
12th April 2010, 11:17
What is ConfigFile? What does readInto() do? Have you seen QSettings class?

offline
12th April 2010, 11:55
a class ConfigFile . reanInto a reading function. I can not access the file. How can I use QSettings Class?

nish
12th April 2010, 12:00
then you have to show the code for reanInTo() function

offline
12th April 2010, 12:17
template<class T>
bool ConfigFile::readInto( T& var, const string& key ) const
{
mapci p = myContents.find(key);
bool found = ( p != myContents.end() );
if( found ) var = string_as_T<T>( p->second );
return found;
}


template<class T>
bool ConfigFile::readInto( T& var, const string& key, const T& value ) const
{
mapci p = myContents.find(key);
bool found = ( p != myContents.end() );
if( found )
var = string_as_T<T>( p->second );
else
var = value;
return found;
}

wysota
12th April 2010, 12:45
What is it exactly that you want from us? I understand you have some class and you are doing something with it but what does Qt have to do with it and what exactly is the problem?

nish
12th April 2010, 12:53
common man, how i the whole world i would know what mapci or Config(to start with) means.. ? we are not gods.

offline
12th April 2010, 13:11
I found a bug. the problem is ConfigFile class. Thank you..