Skip to content
Permalink
Browse files

Ensure all classes derived from QObject include the Q_OBJECT macro

  • Loading branch information
nyalldawson committed Dec 7, 2015
1 parent 6127851 commit 08ab4d4b70907523cf67c9afa7aa6ded7184c757
Showing with 1,190 additions and 851 deletions.
  1. +1 −0 src/analysis/network/CMakeLists.txt
  2. +2 −0 src/analysis/network/qgslinevectorlayerdirector.h
  3. +10 −0 src/app/CMakeLists.txt
  4. +4 −1 src/app/composer/qgscomposerlegenditemdialog.h
  5. +3 −1 src/app/composer/qgscomposerlegendlayersdialog.h
  6. +41 −44 src/app/composer/qgscomposerlegendwidget.cpp
  7. +16 −0 src/app/composer/qgscomposerlegendwidget.h
  8. +27 −29 src/app/nodetool/qgsnodeeditor.cpp
  9. +14 −0 src/app/nodetool/qgsnodeeditor.h
  10. +17 −16 src/app/qgsattributetabledialog.cpp
  11. +13 −2 src/app/qgsattributetabledialog.h
  12. +193 −213 src/app/qgsbrowserdockwidget.cpp
  13. +65 −0 src/app/qgsbrowserdockwidget.h
  14. +17 −17 src/app/qgsfieldsproperties.cpp
  15. +54 −46 src/app/qgsfieldsproperties.h
  16. +2 −0 src/app/qgslabelpreview.h
  17. +2 −0 src/app/qgsmaptoolannotation.h
  18. +2 −0 src/app/qgsmaptoolcircularstringcurvepoint.h
  19. +2 −0 src/app/qgsmaptoolformannotation.h
  20. +2 −0 src/app/qgsmaptoolhtmlannotation.h
  21. +2 −0 src/app/qgsmaptoollabel.h
  22. +2 −0 src/app/qgsmaptoolsvgannotation.h
  23. +2 −0 src/app/qgsmaptooltextannotation.h
  24. +17 −18 src/app/qgssnappingdialog.cpp
  25. +13 −2 src/app/qgssnappingdialog.h
  26. +4 −0 src/core/CMakeLists.txt
  27. +2 −0 src/core/composer/qgscomposerarrow.h
  28. +2 −0 src/core/composer/qgscomposerlegend.h
  29. +2 −0 src/core/composer/qgscomposertexttable.h
  30. +2 −0 src/core/composer/qgspaperitem.h
  31. +6 −0 src/core/layertree/qgslayertreemodellegendnode.h
  32. +2 −0 src/core/qgsdbfilterproxymodel.h
  33. +6 −0 src/core/qgseditformconfig.h
  34. +2 −0 src/core/qgsmaprendererjob.h
  35. +1 −0 src/core/qgsowsconnection.h
  36. +2 −0 src/gui/CMakeLists.txt
  37. +143 −146 src/gui/layertree/qgscustomlayerorderwidget.cpp
  38. +41 −0 src/gui/layertree/qgscustomlayerorderwidget.h
  39. +2 −0 src/gui/qgsdatadefinedbutton.h
  40. +2 −0 src/gui/qgsexpressionbuilderdialog.h
  41. +36 −0 src/gui/qgsexpressionbuilderwidget.cpp
  42. +6 −33 src/gui/qgsexpressionbuilderwidget.h
  43. +2 −0 src/gui/qgsfiledropedit.h
  44. +4 −2 src/gui/qgsidentifymenu.cpp
  45. +13 −7 src/gui/qgsidentifymenu.h
  46. +35 −38 src/gui/qgsmapoverviewcanvas.cpp
  47. +23 −0 src/gui/qgsmapoverviewcanvas.h
  48. +4 −27 src/gui/qgsvariableeditorwidget.cpp
  49. +26 −3 src/gui/qgsvariableeditorwidget.h
  50. +2 −0 src/gui/symbology-ng/qgscategorizedsymbolrendererv2widget.h
  51. +17 −27 src/gui/symbology-ng/qgscptcitycolorrampv2dialog.cpp
  52. +21 −0 src/gui/symbology-ng/qgscptcitycolorrampv2dialog.h
  53. +2 −0 src/gui/symbology-ng/qgsgraduatedsymbolrendererv2widget.h
  54. +0 −15 src/gui/symbology-ng/qgssizescalewidget.cpp
  55. +23 −0 src/gui/symbology-ng/qgssizescalewidget.h
  56. +115 −124 src/gui/symbology-ng/qgssymbollayerv2widget.cpp
  57. +35 −0 src/gui/symbology-ng/qgssymbollayerv2widget.h
  58. +35 −40 src/gui/symbology-ng/qgssymbollevelsv2dialog.cpp
  59. +24 −0 src/gui/symbology-ng/qgssymbollevelsv2dialog.h
  60. +2 −0 src/plugins/evis/CMakeLists.txt
  61. +1 −0 src/plugins/evis/idtool/eviseventidtool.h
  62. +3 −0 src/plugins/georeferencer/CMakeLists.txt
  63. +2 −0 src/plugins/georeferencer/qgsgeorefvalidators.h
  64. +2 −0 src/plugins/georeferencer/qgsresidualplotitem.h
  65. +2 −0 src/plugins/georeferencer/qgsvalidateddoublespinbox.h
  66. +1 −0 src/plugins/interpolation/CMakeLists.txt
  67. +2 −0 src/plugins/interpolation/qgsinterpolatordialog.h
  68. +2 −0 src/plugins/qgsapplydialog.h
  69. +1 −0 src/providers/gdal/CMakeLists.txt
  70. +2 −0 src/providers/gdal/qgsgdaldataitems.h
  71. +2 −0 src/providers/wfs/qgswfsdataitems.h
  72. +1 −0 src/server/CMakeLists.txt
  73. +2 −0 src/server/qgsserverstreamingdevice.h
@@ -15,6 +15,7 @@ INCLUDE_DIRECTORIES(BEFORE raster)

SET(QGIS_NETWORK_ANALYSIS_MOC_HDRS
qgsgraphdirector.h
qgslinevectorlayerdirector.h
)

QT4_WRAP_CPP(QGIS_NETWORK_ANALYSIS_MOC_SRCS ${QGIS_NETWORK_ANALYSIS_MOC_HDRS})
@@ -33,6 +33,8 @@ class QgsVectorLayer;
*/
class ANALYSIS_EXPORT QgsLineVectorLayerDirector : public QgsGraphDirector
{
Q_OBJECT

public:
/**
* @param myLayer source vector layer
@@ -210,6 +210,7 @@ SET (QGIS_APP_MOC_HDRS
qgslabeldialog.h
qgslabelengineconfigdialog.h
qgslabelinggui.h
qgslabelpreview.h
qgslabelingwidget.h
qgslabelpropertydialog.h
qgsloadstylefromdbdialog.h
@@ -223,6 +224,7 @@ SET (QGIS_APP_MOC_HDRS
qgswelcomepage.h

qgsmaptooladdfeature.h
qgsmaptoolannotation.h
qgsmaptoolcircularstringradius.h
qgsmaptooladdpart.h
qgsmaptooladdring.h
@@ -231,12 +233,15 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptooldeletepart.h
qgsmaptooldeletering.h
qgsmaptoolfeatureaction.h
qgsmaptoolformannotation.h
qgsmaptoolhtmlannotation.h
qgsmaptoolpinlabels.h
qgsmaptoolshowhidelabels.h
qgsmaptoolidentifyaction.h
qgsmaptoolmeasureangle.h
qgsmaptoolmovefeature.h
qgsmaptoolmovelabel.h
qgsmaptoollabel.h
qgsmaptooloffsetcurve.h
qgsmaptoolreshape.h
qgsmaptoolrotatefeature.h
@@ -250,7 +255,10 @@ SET (QGIS_APP_MOC_HDRS
qgsmaptoolsimplify.h
qgsmaptoolsplitfeatures.h
qgsmaptoolsplitparts.h
qgsmaptoolsvgannotation.h
qgsmaptooltextannotation.h
qgsmaptooladdcircularstring.h
qgsmaptoolcircularstringcurvepoint.h

nodetool/qgsmaptoolnodetool.h
nodetool/qgsselectedfeature.h
@@ -285,6 +293,8 @@ SET (QGIS_APP_MOC_HDRS
composer/qgscomposeritemwidget.h
composer/qgscomposerlabelwidget.h
composer/qgscomposerlegendwidget.h
composer/qgscomposerlegenditemdialog.h
composer/qgscomposerlegendlayersdialog.h
composer/qgscomposermanager.h
composer/qgscomposermapwidget.h
composer/qgscomposerpicturewidget.h
@@ -18,15 +18,18 @@
#ifndef QGSCOMPOSERLEGENDITEMDIALOG_H
#define QGSCOMPOSERLEGENDITEMDIALOG_H

#include <QDialog>
#include "ui_qgscomposerlegenditemdialogbase.h"

class QStandardItem;

/** \ingroup MapComposer
* A dialog to enter properties of composer legend items (currently only item text)
* */
class QgsComposerLegendItemDialog: private Ui::QgsComposerLegendItemDialogBase, public QDialog
class QgsComposerLegendItemDialog: public QDialog, private Ui::QgsComposerLegendItemDialogBase
{
Q_OBJECT

public:
QgsComposerLegendItemDialog( const QStandardItem* item, QWidget* parent = 0 );
~QgsComposerLegendItemDialog();
@@ -21,8 +21,10 @@
/** \ingroup MapComposer
* A dialog to add new layers to the legend.
* */
class QgsComposerLegendLayersDialog: private Ui::QgsComposerLegendLayersDialogBase, public QDialog
class QgsComposerLegendLayersDialog: public QDialog, private Ui::QgsComposerLegendLayersDialogBase
{
Q_OBJECT

public:
QgsComposerLegendLayersDialog( QList<QgsMapLayer*> layers, QWidget* parent = 0 );
~QgsComposerLegendLayersDialog();
@@ -43,50 +43,6 @@
#include <QInputDialog>



class QgsComposerLegendMenuProvider : public QObject, public QgsLayerTreeViewMenuProvider
{
public:
QgsComposerLegendMenuProvider( QgsLayerTreeView* view, QgsComposerLegendWidget* w ) : mView( view ), mWidget( w ) {}

virtual QMenu* createContextMenu() override
{
if ( !mView->currentNode() )
return 0;

if ( mWidget->legend()->autoUpdateModel() )
return 0; // no editing allowed

QMenu* menu = new QMenu();

if ( QgsLayerTree::isLayer( mView->currentNode() ) )
{
menu->addAction( tr( "Reset to defaults" ), mWidget, SLOT( resetLayerNodeToDefaults() ) );
menu->addSeparator();
}

QgsComposerLegendStyle::Style currentStyle = QgsLegendRenderer::nodeLegendStyle( mView->currentNode(), mView->layerTreeModel() );

QList<QgsComposerLegendStyle::Style> lst;
lst << QgsComposerLegendStyle::Hidden << QgsComposerLegendStyle::Group << QgsComposerLegendStyle::Subgroup;
Q_FOREACH ( QgsComposerLegendStyle::Style style, lst )
{
QAction* action = menu->addAction( QgsComposerLegendStyle::styleLabel( style ), mWidget, SLOT( setCurrentNodeStyleFromAction() ) );
action->setCheckable( true );
action->setChecked( currentStyle == style );
action->setData(( int ) style );
}

return menu;
}

protected:
QgsLayerTreeView* mView;
QgsComposerLegendWidget* mWidget;
};



QgsComposerLegendWidget::QgsComposerLegendWidget( QgsComposerLegend* legend )
: QgsComposerItemBaseWidget( 0, legend )
, mLegend( legend )
@@ -1096,3 +1052,44 @@ void QgsComposerLegendWidget::updateFilterLegendByAtlasButton()
const QgsAtlasComposition& atlas = mLegend->composition()->atlasComposition();
mFilterLegendByAtlasCheckBox->setEnabled( atlas.enabled() && atlas.coverageLayer() && atlas.coverageLayer()->geometryType() == QGis::Polygon );
}


//
// QgsComposerLegendMenuProvider
//

QgsComposerLegendMenuProvider::QgsComposerLegendMenuProvider( QgsLayerTreeView* view, QgsComposerLegendWidget* w )
: mView( view )
, mWidget( w )
{}

QMenu*QgsComposerLegendMenuProvider::createContextMenu()
{
if ( !mView->currentNode() )
return 0;

if ( mWidget->legend()->autoUpdateModel() )
return 0; // no editing allowed

QMenu* menu = new QMenu();

if ( QgsLayerTree::isLayer( mView->currentNode() ) )
{
menu->addAction( tr( "Reset to defaults" ), mWidget, SLOT( resetLayerNodeToDefaults() ) );
menu->addSeparator();
}

QgsComposerLegendStyle::Style currentStyle = QgsLegendRenderer::nodeLegendStyle( mView->currentNode(), mView->layerTreeModel() );

QList<QgsComposerLegendStyle::Style> lst;
lst << QgsComposerLegendStyle::Hidden << QgsComposerLegendStyle::Group << QgsComposerLegendStyle::Subgroup;
Q_FOREACH ( QgsComposerLegendStyle::Style style, lst )
{
QAction* action = menu->addAction( QgsComposerLegendStyle::styleLabel( style ), mWidget, SLOT( setCurrentNodeStyleFromAction() ) );
action->setCheckable( true );
action->setChecked( currentStyle == style );
action->setData(( int ) style );
}

return menu;
}
@@ -111,5 +111,21 @@ class QgsComposerLegendWidget: public QgsComposerItemBaseWidget, private Ui::Qgs
QgsComposerLegend* mLegend;
};


class QgsComposerLegendMenuProvider : public QObject, public QgsLayerTreeViewMenuProvider
{
Q_OBJECT

public:
QgsComposerLegendMenuProvider( QgsLayerTreeView* view, QgsComposerLegendWidget* w );

virtual QMenu* createContextMenu() override;

protected:
QgsLayerTreeView* mView;
QgsComposerLegendWidget* mWidget;
};


#endif

@@ -33,35 +33,6 @@
static const int MinRadiusRole = Qt::UserRole + 1;


class CoordinateItemDelegate : public QStyledItemDelegate
{
public:
QString displayText( const QVariant & value, const QLocale & locale ) const override
{
return locale.toString( value.toDouble(), 'f', 4 );
}

protected:
QWidget* createEditor( QWidget * parent, const QStyleOptionViewItem & /*option*/, const QModelIndex & index ) const override
{
QLineEdit* lineEdit = new QLineEdit( parent );
QDoubleValidator* validator = new QDoubleValidator();
if ( !index.data( MinRadiusRole ).isNull() )
validator->setBottom( index.data( MinRadiusRole ).toDouble() );
lineEdit->setValidator( validator );
return lineEdit;
}
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override
{
QLineEdit* lineEdit = qobject_cast<QLineEdit*>( editor );
if ( lineEdit->hasAcceptableInput() )
{
QStyledItemDelegate::setModelData( editor, model, index );
}
}
};


QgsNodeEditorModel::QgsNodeEditorModel( QgsVectorLayer* layer, QgsSelectedFeature* selectedFeature, QgsMapCanvas* canvas, QObject* parent )
: QAbstractTableModel( parent )
, mLayer( layer )
@@ -410,3 +381,30 @@ void QgsNodeEditor::zoomToNode( int idx )
}


//
// CoordinateItemDelegate
//

QString CoordinateItemDelegate::displayText( const QVariant& value, const QLocale& locale ) const
{
return locale.toString( value.toDouble(), 'f', 4 );
}

QWidget*CoordinateItemDelegate::createEditor( QWidget* parent, const QStyleOptionViewItem&, const QModelIndex& index ) const
{
QLineEdit* lineEdit = new QLineEdit( parent );
QDoubleValidator* validator = new QDoubleValidator();
if ( !index.data( MinRadiusRole ).isNull() )
validator->setBottom( index.data( MinRadiusRole ).toDouble() );
lineEdit->setValidator( validator );
return lineEdit;
}

void CoordinateItemDelegate::setModelData( QWidget* editor, QAbstractItemModel* model, const QModelIndex& index ) const
{
QLineEdit* lineEdit = qobject_cast<QLineEdit*>( editor );
if ( lineEdit->hasAcceptableInput() )
{
QStyledItemDelegate::setModelData( editor, model, index );
}
}
@@ -22,6 +22,7 @@
#include <QDockWidget>
#include <QAbstractTableModel>
#include <QItemSelection>
#include <QStyledItemDelegate>

class QgsMapCanvas;
class QgsRubberBand;
@@ -94,4 +95,17 @@ class QgsNodeEditor : public QDockWidget
bool mUpdatingNodeSelection;
};


class CoordinateItemDelegate : public QStyledItemDelegate
{
Q_OBJECT

public:
QString displayText( const QVariant & value, const QLocale & locale ) const override;

protected:
QWidget* createEditor( QWidget * parent, const QStyleOptionViewItem & /*option*/, const QModelIndex & index ) const override;
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override;
};

#endif // QGSNODEEDITOR_H
@@ -45,22 +45,6 @@
#include "qgsfield.h"
#include "qgseditorwidgetregistry.h"

class QgsAttributeTableDock : public QDockWidget
{
public:
QgsAttributeTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
: QDockWidget( title, parent, flags )
{
setObjectName( "AttributeTable" ); // set object name so the position can be saved
}

virtual void closeEvent( QCloseEvent * ev ) override
{
Q_UNUSED( ev );
deleteLater();
}
};

static QgsExpressionContext _getExpressionContext( const void* context )
{
QgsExpressionContext expContext;
@@ -857,3 +841,20 @@ void QgsAttributeTableDialog::setFilterExpression( const QString& filterString )
}
mMainView->setFilterMode( QgsAttributeTableFilterModel::ShowFilteredList );
}


//
// QgsAttributeTableDock
//

QgsAttributeTableDock::QgsAttributeTableDock( const QString& title, QWidget* parent, Qt::WindowFlags flags )
: QDockWidget( title, parent, flags )
{
setObjectName( "AttributeTable" ); // set object name so the position can be saved
}

void QgsAttributeTableDock::closeEvent( QCloseEvent* ev )
{
Q_UNUSED( ev );
deleteLater();
}
@@ -30,15 +30,14 @@
#include "qgsvectorlayer.h" //QgsFeatureIds
#include "qgsfieldmodel.h"
#include "qgssearchwidgetwrapper.h"
#include <QDockWidget>

class QDialogButtonBox;
class QPushButton;
class QLineEdit;
class QComboBox;
class QMenu;
class QDockWidget;
class QSignalMapper;

class QgsAttributeTableModel;
class QgsAttributeTableFilterModel;
class QgsRubberBand;
@@ -222,4 +221,16 @@ class APP_EXPORT QgsAttributeTableDialog : public QDialog, private Ui::QgsAttrib
QgsSearchWidgetWrapper* mCurrentSearchWidgetWrapper;
};


class QgsAttributeTableDock : public QDockWidget
{
Q_OBJECT

public:
QgsAttributeTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 );

virtual void closeEvent( QCloseEvent * ev ) override;
};


#endif

0 comments on commit 08ab4d4

Please sign in to comment.
You can’t perform that action at this time.