Skip to content

Commit

Permalink
Added Q_OBJECT
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed May 14, 2020
1 parent 5d59048 commit 91152ee
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 53 deletions.
27 changes: 0 additions & 27 deletions src/gui/vectortile/qgsvectortilebasiclabelingwidget.cpp
Expand Up @@ -25,33 +25,6 @@
///@cond PRIVATE


class QgsVectorTileBasicLabelingListModel : public QAbstractListModel
{
public:
QgsVectorTileBasicLabelingListModel( QgsVectorTileBasicLabeling *r, QObject *parent = nullptr );

int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool setData( const QModelIndex &index, const QVariant &value, int role ) override;

bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ) override;

void insertStyle( int row, const QgsVectorTileBasicLabelingStyle &style );

// drag'n'drop support
Qt::DropActions supportedDropActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData( const QModelIndexList &indexes ) const override;
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override;

private:
QgsVectorTileBasicLabeling *mLabeling = nullptr;
};


QgsVectorTileBasicLabelingListModel::QgsVectorTileBasicLabelingListModel( QgsVectorTileBasicLabeling *l, QObject *parent )
: QAbstractListModel( parent )
, mLabeling( l )
Expand Down
30 changes: 30 additions & 0 deletions src/gui/vectortile/qgsvectortilebasiclabelingwidget.h
Expand Up @@ -93,6 +93,36 @@ class QgsLabelingPanelWidget : public QgsPanelWidget
QgsLabelingGui *mLabelingGui = nullptr;
};


class QgsVectorTileBasicLabelingStyle;

class QgsVectorTileBasicLabelingListModel : public QAbstractListModel
{
Q_OBJECT
public:
QgsVectorTileBasicLabelingListModel( QgsVectorTileBasicLabeling *r, QObject *parent = nullptr );

int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool setData( const QModelIndex &index, const QVariant &value, int role ) override;

bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ) override;

void insertStyle( int row, const QgsVectorTileBasicLabelingStyle &style );

// drag'n'drop support
Qt::DropActions supportedDropActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData( const QModelIndexList &indexes ) const override;
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override;

private:
QgsVectorTileBasicLabeling *mLabeling = nullptr;
};

///@endcond

#endif // QGSVECTORTILEBASICLABELINGWIDGET_H
26 changes: 0 additions & 26 deletions src/gui/vectortile/qgsvectortilebasicrendererwidget.cpp
Expand Up @@ -29,32 +29,6 @@

///@cond PRIVATE

class QgsVectorTileBasicRendererListModel : public QAbstractListModel
{
public:
QgsVectorTileBasicRendererListModel( QgsVectorTileBasicRenderer *r, QObject *parent = nullptr );

int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool setData( const QModelIndex &index, const QVariant &value, int role ) override;

bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ) override;

void insertStyle( int row, const QgsVectorTileBasicRendererStyle &style );

// drag'n'drop support
Qt::DropActions supportedDropActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData( const QModelIndexList &indexes ) const override;
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override;

private:
QgsVectorTileBasicRenderer *mRenderer = nullptr;
};


QgsVectorTileBasicRendererListModel::QgsVectorTileBasicRendererListModel( QgsVectorTileBasicRenderer *r, QObject *parent )
: QAbstractListModel( parent )
Expand Down
30 changes: 30 additions & 0 deletions src/gui/vectortile/qgsvectortilebasicrendererwidget.h
Expand Up @@ -66,6 +66,36 @@ class GUI_EXPORT QgsVectorTileBasicRendererWidget : public QgsMapLayerConfigWidg
QgsMessageBar *mMessageBar = nullptr;
};


class QgsVectorTileBasicRendererStyle;

class QgsVectorTileBasicRendererListModel : public QAbstractListModel
{
Q_OBJECT
public:
QgsVectorTileBasicRendererListModel( QgsVectorTileBasicRenderer *r, QObject *parent = nullptr );

int rowCount( const QModelIndex &parent = QModelIndex() ) const override;
int columnCount( const QModelIndex &parent = QModelIndex() ) const override;
QVariant data( const QModelIndex &index, int role = Qt::DisplayRole ) const override;
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
Qt::ItemFlags flags( const QModelIndex &index ) const override;
bool setData( const QModelIndex &index, const QVariant &value, int role ) override;

bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() ) override;

void insertStyle( int row, const QgsVectorTileBasicRendererStyle &style );

// drag'n'drop support
Qt::DropActions supportedDropActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData( const QModelIndexList &indexes ) const override;
bool dropMimeData( const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent ) override;

private:
QgsVectorTileBasicRenderer *mRenderer = nullptr;
};

///@endcond

#endif // QGSVECTORTILEBASICRENDERERWIDGET_H

0 comments on commit 91152ee

Please sign in to comment.