Skip to content

Commit

Permalink
Removed superfluous Q_DECLARE_METATYPE usages (#4001)
Browse files Browse the repository at this point in the history
This macro is not needed in a bunch of cases, in particular, the meta
type is automatically declared for Q_GADGET types and pointers to types
derived from QObject.
  • Loading branch information
bjorn authored Jul 10, 2024
1 parent 3576ebd commit de8384f
Show file tree
Hide file tree
Showing 31 changed files with 0 additions and 67 deletions.
3 changes: 0 additions & 3 deletions src/libtiled/properties.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,3 @@ TILEDSHARED_EXPORT QString typeName(const QVariant &value);
TILEDSHARED_EXPORT void initializeMetatypes();

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::FilePath)
Q_DECLARE_METATYPE(Tiled::ObjectRef)
2 changes: 0 additions & 2 deletions src/libtiled/tilelayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -664,5 +664,3 @@ inline void TileLayer::setCells(int x, int y, const TileLayer *tileLayer)
using SharedTileLayer = QSharedPointer<TileLayer>;

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::Cell)
3 changes: 0 additions & 3 deletions src/libtiled/world.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,3 @@ class TILEDSHARED_EXPORT World : public Object
};

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::WorldPattern)
Q_DECLARE_METATYPE(Tiled::WorldMapEntry)
2 changes: 0 additions & 2 deletions src/libtiledquick/mapref.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,3 @@ class TILEDQUICK_SHARED_EXPORT MapRef
};

} // namespace TiledQuick

Q_DECLARE_METATYPE(TiledQuick::MapRef)
2 changes: 0 additions & 2 deletions src/tiled/abstracttool.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,5 +324,3 @@ inline ToolManager *AbstractTool::toolManager() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::AbstractTool*)
2 changes: 0 additions & 2 deletions src/tiled/colorbutton.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,3 @@ class ColorButton : public QToolButton
};

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ColorButton*);
2 changes: 0 additions & 2 deletions src/tiled/editableasset.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,3 @@ inline Document *EditableAsset::document() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableAsset*)
2 changes: 0 additions & 2 deletions src/tiled/editablelayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,3 @@ inline EditableLayer *EditableLayer::find(Layer *layer)
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableLayer*)
2 changes: 0 additions & 2 deletions src/tiled/editablemap.h
Original file line number Diff line number Diff line change
Expand Up @@ -384,5 +384,3 @@ inline MapDocument *EditableMap::mapDocument() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableMap*)
2 changes: 0 additions & 2 deletions src/tiled/editablemapobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,5 +295,3 @@ inline void EditableMapObject::setHeight(qreal height)
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::Font)
2 changes: 0 additions & 2 deletions src/tiled/editableproject.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,3 @@ inline Project *EditableProject::project() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableProject*)
2 changes: 0 additions & 2 deletions src/tiled/editabletile.h
Original file line number Diff line number Diff line change
Expand Up @@ -166,5 +166,3 @@ inline EditableTile *EditableTile::find(Tile *tile)
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableTile*)
2 changes: 0 additions & 2 deletions src/tiled/editabletilelayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,3 @@ inline TileLayer *EditableTileLayer::tileLayer() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableTileLayer*)
2 changes: 0 additions & 2 deletions src/tiled/editabletileset.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,5 +331,3 @@ inline void EditableTileset::setTileSize(int width, int height)
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableTileset*)
2 changes: 0 additions & 2 deletions src/tiled/editablewangset.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,3 @@ inline EditableWangSet *EditableWangSet::find(WangSet *wangSet)
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableWangSet*)
2 changes: 0 additions & 2 deletions src/tiled/editableworld.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ inline World *EditableWorld::world() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::EditableWorld*)
2 changes: 0 additions & 2 deletions src/tiled/fileedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,3 @@ inline bool FileEdit::isDirectory() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::FileEdit*)
2 changes: 0 additions & 2 deletions src/tiled/mapview.h
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,3 @@ inline QPointF MapView::viewCenter() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::MapView*)
2 changes: 0 additions & 2 deletions src/tiled/regionvaluetype.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,5 +132,3 @@ inline const QRegion &RegionValueType::region() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::RegionValueType)
3 changes: 0 additions & 3 deletions src/tiled/scriptdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,3 @@ class ScriptDialog : public QDialog
void registerDialog(QJSEngine *jsEngine);

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptDialog*);
Q_DECLARE_METATYPE(Tiled::ScriptImageWidget*)
2 changes: 0 additions & 2 deletions src/tiled/scriptedaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,3 @@ inline QString ScriptedAction::iconFileName() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptedAction*)
2 changes: 0 additions & 2 deletions src/tiled/scriptedtool.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,3 @@ inline QString ScriptedTool::iconFileName() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptedTool*)
3 changes: 0 additions & 3 deletions src/tiled/scriptfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,4 @@ void registerFile(QJSEngine *jsEngine)

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptBinaryFile*)
Q_DECLARE_METATYPE(Tiled::ScriptTextFile*)

#include "scriptfile.moc"
3 changes: 0 additions & 3 deletions src/tiled/scriptfileformatwrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,3 @@ class ScriptMapFormatWrapper : public ScriptFileFormatWrapper
};

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptTilesetFormatWrapper*)
Q_DECLARE_METATYPE(Tiled::ScriptMapFormatWrapper*)
2 changes: 0 additions & 2 deletions src/tiled/scriptimage.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,3 @@ class ScriptImage : public QObject
};

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::ScriptImage*)
2 changes: 0 additions & 2 deletions src/tiled/tilecollisiondock.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,5 +169,3 @@ inline bool TileCollisionDock::hasSelectedObjects() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::TileCollisionDock*)
2 changes: 0 additions & 2 deletions src/tiled/tilelayeredit.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,3 @@ inline EditableTileLayer *TileLayerEdit::target() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::TileLayerEdit*)
2 changes: 0 additions & 2 deletions src/tiled/tilelayerwangedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,3 @@ inline void TileLayerWangEdit::setEdge(int x, int y, WangIndex::Value edge, int
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::TileLayerWangEdit*)
2 changes: 0 additions & 2 deletions src/tiled/tileseteditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,5 +209,3 @@ inline TileCollisionDock *TilesetEditor::collisionEditor() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::TilesetEditor*)
2 changes: 0 additions & 2 deletions src/tiled/tilesetview.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,3 @@ inline bool TilesetView::markAnimatedTiles() const
}

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::TilesetView *)
2 changes: 0 additions & 2 deletions src/tiled/wangsetview.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,3 @@ class WangSetView : public QTreeView
};

} // namespace Tiled

Q_DECLARE_METATYPE(Tiled::WangSetView *)

0 comments on commit de8384f

Please sign in to comment.