Add parentWidget() to Project to avoid name-shadowing the parent member
This commit is contained in:
parent
9a9143500f
commit
d9340d3b73
2 changed files with 4 additions and 4 deletions
|
@ -31,6 +31,8 @@ public:
|
||||||
Project(const Project &) = delete;
|
Project(const Project &) = delete;
|
||||||
Project & operator = (const Project &) = delete;
|
Project & operator = (const Project &) = delete;
|
||||||
|
|
||||||
|
inline QWidget *parentWidget() const { return static_cast<QWidget *>(parent()); }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QString root;
|
QString root;
|
||||||
QStringList groupNames;
|
QStringList groupNames;
|
||||||
|
@ -219,8 +221,6 @@ private:
|
||||||
static int default_map_size;
|
static int default_map_size;
|
||||||
static int max_object_events;
|
static int max_object_events;
|
||||||
|
|
||||||
QWidget *parent;
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void reloadProject();
|
void reloadProject();
|
||||||
void uncheckMonitorFilesAction();
|
void uncheckMonitorFilesAction();
|
||||||
|
|
|
@ -36,7 +36,7 @@ int Project::max_map_data_size = 10240; // 0x2800
|
||||||
int Project::default_map_size = 20;
|
int Project::default_map_size = 20;
|
||||||
int Project::max_object_events = 64;
|
int Project::max_object_events = 64;
|
||||||
|
|
||||||
Project::Project(QWidget *parent) : parent(parent)
|
Project::Project(QWidget *parent) : QObject(parent)
|
||||||
{
|
{
|
||||||
initSignals();
|
initSignals();
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ void Project::initSignals() {
|
||||||
static bool showing = false;
|
static bool showing = false;
|
||||||
if (showing) return;
|
if (showing) return;
|
||||||
|
|
||||||
QMessageBox notice(this->parent);
|
QMessageBox notice(this->parentWidget());
|
||||||
notice.setText("File Changed");
|
notice.setText("File Changed");
|
||||||
notice.setInformativeText(QString("The file %1 has changed on disk. Would you like to reload the project?")
|
notice.setInformativeText(QString("The file %1 has changed on disk. Would you like to reload the project?")
|
||||||
.arg(changed.remove(this->root + "/")));
|
.arg(changed.remove(this->root + "/")));
|
||||||
|
|
Loading…
Reference in a new issue