-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* scriptimage.cpp | ||
* Copyright 2020, Thorbjørn Lindeijer <[email protected]> | ||
* scriptpropertytype.cpp | ||
* Copyright 2024, chris <[email protected]> | ||
* | ||
* This file is part of Tiled. | ||
* | ||
|
@@ -19,12 +19,10 @@ | |
*/ | ||
|
||
#include "scriptpropertytype.h" | ||
#include "project.h" | ||
#include "projectmanager.h" | ||
|
||
namespace Tiled { | ||
|
||
QString ScriptPropertyType::name() const | ||
const QString &ScriptPropertyType::name() const | ||
{ | ||
return mType->name; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
/* | ||
* scriptimage.h | ||
* Copyright 2020, Thorbjørn Lindeijer <[email protected]> | ||
* scriptpropertytype.h | ||
* Copyright 2024, chris <[email protected]> | ||
* | ||
* This file is part of Tiled. | ||
* | ||
|
@@ -20,7 +20,6 @@ | |
|
||
#pragma once | ||
|
||
#include "preferences.h" | ||
#include "propertytype.h" | ||
|
||
#include <QJSEngine> | ||
|
@@ -44,7 +43,7 @@ class ScriptPropertyType : public QObject | |
: mType(propertyType) | ||
{} | ||
|
||
QString name() const; | ||
const QString &name() const; | ||
bool isClass() const { return mType->isClass(); } | ||
bool isEnum() const { return mType->isEnum(); } | ||
QVariant defaultValue() { return mType->defaultValue(); } | ||
|
@@ -62,8 +61,8 @@ class ScriptEnumPropertyType : public ScriptPropertyType | |
|
||
public: | ||
ScriptEnumPropertyType(const EnumPropertyType *propertyType) | ||
: mEnumType(propertyType), | ||
ScriptPropertyType(propertyType) | ||
: ScriptPropertyType(propertyType) | ||
, mEnumType(propertyType) | ||
{} | ||
// copied from propertytype.h | ||
enum StorageType { | ||
|
@@ -89,8 +88,8 @@ class ScriptClassPropertyType : public ScriptPropertyType | |
|
||
public: | ||
ScriptClassPropertyType(const ClassPropertyType *propertyType) | ||
: mClassType(propertyType), | ||
ScriptPropertyType(propertyType) | ||
: ScriptPropertyType(propertyType) | ||
, mClassType(propertyType) | ||
{} | ||
|
||
// TODO: a way to avoid duplicating this again? | ||
|
@@ -121,7 +120,6 @@ class ScriptClassPropertyType : public ScriptPropertyType | |
//void setUsageFlags(int value) { mClassType->setUsageFlags(value); } | ||
|
||
private: | ||
|
||
const ClassPropertyType *mClassType; | ||
}; | ||
|
||
|
@@ -131,4 +129,3 @@ void registerPropertyTypes(QJSEngine *jsEngine); | |
} // namespace Tiled | ||
|
||
Q_DECLARE_METATYPE(Tiled::ScriptPropertyType*) | ||
|