iswaryasenthilkumar
27th April 2015, 14:36
i have doubt in QDir,
i declared directory with one path (exampl path1)and am checking if the directory exist,,after thsi execution am using same directory name with changing path to another and also checking exist,like wise am checking multiple path,, am not getting good result while checking this
Example
QDir dir(path1);
if(!path1.exist) // this alone executing correctly
{
dir.cd("somefolde");
//doing some action
qdebug("path not exist");
}
dir.cd(path2)
{
if(!path2.exist) //this not executing it showimg wrong output
{
dir.cd("somefolde");
//doing some action
qdebug("path not exist");
}
dir.cd(path3)
{
if(path2.exist) //this not executing it showimg wrong output
{
doing some action//
}
i know am doing mistake,,can any one clear my doubt please:confused:
Thanks in advance:o
i declared directory with one path (exampl path1)and am checking if the directory exist,,after thsi execution am using same directory name with changing path to another and also checking exist,like wise am checking multiple path,, am not getting good result while checking this
Example
QDir dir(path1);
if(!path1.exist) // this alone executing correctly
{
dir.cd("somefolde");
//doing some action
qdebug("path not exist");
}
dir.cd(path2)
{
if(!path2.exist) //this not executing it showimg wrong output
{
dir.cd("somefolde");
//doing some action
qdebug("path not exist");
}
dir.cd(path3)
{
if(path2.exist) //this not executing it showimg wrong output
{
doing some action//
}
i know am doing mistake,,can any one clear my doubt please:confused:
Thanks in advance:o