Skip to content
Permalink
Browse files

Added Q_OBJECT

  • Loading branch information
wonder-sk committed May 14, 2020
1 parent 5d59048 commit 91152ee4b9ddfb239e081aa0f7ffd9192048d209
@@ -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 )
@@ -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
@@ -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 )
@@ -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.
You can’t perform that action at this time.