bool returned on loadObjects()
git-svn-id: http://find-object.googlecode.com/svn/trunk/find_object@41 620bd6b2-0a58-f614-fd9a-1bd335dccda9
This commit is contained in:
parent
b1b769ec78
commit
26cf597da3
@ -89,10 +89,11 @@ void MainWindow::closeEvent(QCloseEvent * event)
|
|||||||
QMainWindow::closeEvent(event);
|
QMainWindow::closeEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::loadObjects(const QString & fileName)
|
bool MainWindow::loadObjects(const QString & fileName)
|
||||||
{
|
{
|
||||||
QFile file(fileName);
|
QFile file(fileName);
|
||||||
file.open(QIODevice::ReadOnly);
|
if(file.open(QIODevice::ReadOnly))
|
||||||
|
{
|
||||||
QDataStream in(&file);
|
QDataStream in(&file);
|
||||||
while(!in.atEnd())
|
while(!in.atEnd())
|
||||||
{
|
{
|
||||||
@ -118,6 +119,9 @@ void MainWindow::loadObjects(const QString & fileName)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::saveObjects(const QString & fileName)
|
void MainWindow::saveObjects(const QString & fileName)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ public:
|
|||||||
MainWindow(Camera * camera = 0, QWidget * parent = 0);
|
MainWindow(Camera * camera = 0, QWidget * parent = 0);
|
||||||
virtual ~MainWindow();
|
virtual ~MainWindow();
|
||||||
|
|
||||||
void loadObjects(const QString & fileName);
|
bool loadObjects(const QString & fileName);
|
||||||
void saveObjects(const QString & fileName);
|
void saveObjects(const QString & fileName);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user