This class is the base class for any object that might be watched by the WatchDog. More...
#include <util/watchdog.h>
Signals | |
void | modified () |
Signal emitted to indicate a change in the object. | |
Public Member Functions | |
FileObject (const FileObject ©, QObject *parent=0) | |
Copy constructor. | |
FileObject (QString fn, QObject *parent=0) | |
Initialized constructor. | |
FileObject (std::string fn, QObject *parent=0) | |
Initialized constructor. | |
FileObject (QObject *parent=0) | |
Default constructor. | |
std::string | getFilename () |
Get the current filename of the object. | |
FileObject & | operator= (const FileObject &other) |
Assignment operator. | |
virtual void | reread ()=0 |
Method to be implemented in subblasses to reread the file. | |
void | setFilename (const char *fn) |
Change the file handled. | |
void | setFilename (QString fn) |
Change the file handled. | |
void | setFilename (std::string fn) |
Change the file handled. | |
void | update () |
Protected Attributes | |
std::string | filename |
This class is the base class for any object that might be watched by the WatchDog.
Anytime the FileObject::update() method is called, the FileObject::modified() signal is emuitted by the object.
Definition at line 30 of file watchdog.h.
util::FileObject::FileObject | ( | QObject * | parent = 0 |
) | [inline] |
Default constructor.
Just initialize the QObject.
Definition at line 40 of file watchdog.h.
00040 : QObject(parent) {}
util::FileObject::FileObject | ( | std::string | fn, | |
QObject * | parent = 0 | |||
) | [inline] |
Initialized constructor.
fn | Name of the file handled by this object |
Definition at line 46 of file watchdog.h.
00046 : QObject(parent), filename(fn) {}
Initialized constructor.
fn | Name of the file handled by this object |
Definition at line 52 of file watchdog.h.
00052 : QObject(parent), filename(fn.toStdString()) {}
util::FileObject::FileObject | ( | const FileObject & | copy, | |
QObject * | parent = 0 | |||
) | [inline] |
Copy constructor.
copy | Object to copy |
Definition at line 58 of file watchdog.h.
00058 : QObject(parent), filename(copy.filename) {}
std::string util::FileObject::getFilename | ( | ) | [inline] |
Get the current filename of the object.
Definition at line 91 of file watchdog.h.
Referenced by util::WatchDog::addObject(), util::WatchDog::changeFilename(), util::WatchDog::removeObject(), and util::KeyFramer::reread().
void util::FileObject::modified | ( | ) | [signal] |
Signal emitted to indicate a change in the object.
FileObject& util::FileObject::operator= | ( | const FileObject & | other | ) | [inline] |
Assignment operator.
other | Object to copy |
If the object to copy handle a different filename, then the FileObject::modified() signal is emitted.
Definition at line 67 of file watchdog.h.
virtual void util::FileObject::reread | ( | ) | [pure virtual] |
Method to be implemented in subblasses to reread the file.
Implemented in Model, util::Contour, util::Function, util::KeyFramer, util::Materials, and util::Palette.
void util::FileObject::setFilename | ( | const char * | fn | ) | [inline] |
Change the file handled.
If the call actually change the file handled, then FileObject::modified() is emitted.
Definition at line 115 of file watchdog.h.
References setFilename().
Referenced by setFilename().
00115 { setFilename(std::string(fn)); }
void util::FileObject::setFilename | ( | QString | fn | ) | [inline] |
Change the file handled.
If the call actually change the file handled, then FileObject::modified() is emitted.
Definition at line 107 of file watchdog.h.
References setFilename().
Referenced by setFilename().
00107 { setFilename(fn.toStdString()); }
void util::FileObject::setFilename | ( | std::string | fn | ) |
Change the file handled.
If the call actually change the file handled, then FileObject::modified() is emitted.
Definition at line 15 of file watchdog.cpp.
Referenced by util::WatchDog::changeFilename().