Skip to content

Commit

Permalink
automatic indentation update (r10065-r10429)
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@10430 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Mar 27, 2009
1 parent 8688c0e commit 60b6bd6
Show file tree
Hide file tree
Showing 95 changed files with 3,803 additions and 3,738 deletions.
120 changes: 60 additions & 60 deletions src/app/attributetable/BeataDialog.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
BeataDialog.h
BeataDialog.h
BEtter Attribute TAble
-------------------
date : Feb 2009
Expand Down Expand Up @@ -43,65 +43,65 @@ class BeataView;

class BeataDialog : public QDialog, private Ui::BeataDialogGui
{
Q_OBJECT

public:
BeataDialog(QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window);
~BeataDialog();

public slots:
void editingToggled();
private slots:
void submit();
void revert();
void search();
void on_mAdvancedSearchButton_clicked();
void updateSelection();
void updateSelectionFromLayer();
void updateRowSelection(int index);
void updateRowSelection(int first, int last, bool startNewSelection);

void on_cbxShowSelectedOnly_toggled( bool theFlag );
void on_mCopySelectedRowsButton_clicked();
void on_mToggleEditingButton_toggled();
void on_mInvertSelectionButton_clicked();
void on_mRemoveSelectionButton_clicked();
void on_mZoomMapToSelectedRowsButton_clicked();
void on_mSelectedToTopButton_clicked();
void showAdvanced();
void startEditing();

signals:
void editingToggled( QgsMapLayer * );
protected:
void closeEvent( QCloseEvent* event );
private:
void columnBoxInit();
int columnBoxColumnId();
void doSearch(QString searchString);

QIcon getThemeIcon( const QString theName );
QLineEdit *mQuery;
QComboBox *mColumnBox;
QComboBox *mShowBox;
QMenu* mMenuActions;
QAction* mActionToggleEditing;

BeataModel *mModel;
BeataFilterModel *mFilterModel;
QgsVectorLayer *mLayer;
QgsFeatureIds mSelectedFeatures;

QItemSelectionModel* mSelectionModel;
int mLastClickedHeaderIndex;
QDockWidget *mDock;
Q_OBJECT

public:
BeataDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
~BeataDialog();

public slots:
void editingToggled();

private slots:
void submit();
void revert();
void search();
void on_mAdvancedSearchButton_clicked();
void updateSelection();
void updateSelectionFromLayer();
void updateRowSelection( int index );
void updateRowSelection( int first, int last, bool startNewSelection );

void on_cbxShowSelectedOnly_toggled( bool theFlag );
void on_mCopySelectedRowsButton_clicked();

void on_mToggleEditingButton_toggled();
void on_mInvertSelectionButton_clicked();
void on_mRemoveSelectionButton_clicked();
void on_mZoomMapToSelectedRowsButton_clicked();
void on_mSelectedToTopButton_clicked();
void showAdvanced();
void startEditing();

signals:
void editingToggled( QgsMapLayer * );

protected:
void closeEvent( QCloseEvent* event );

private:
void columnBoxInit();
int columnBoxColumnId();
void doSearch( QString searchString );

QIcon getThemeIcon( const QString theName );

QLineEdit *mQuery;
QComboBox *mColumnBox;
QComboBox *mShowBox;

QMenu* mMenuActions;
QAction* mActionToggleEditing;

BeataModel *mModel;
BeataFilterModel *mFilterModel;
QgsVectorLayer *mLayer;
QgsFeatureIds mSelectedFeatures;

QItemSelectionModel* mSelectionModel;
int mLastClickedHeaderIndex;

QDockWidget *mDock;
};

#endif
174 changes: 87 additions & 87 deletions src/app/attributetable/BeataModel.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/***************************************************************************
BeataModel.h
BeataModel.h
BEtter Attribute TAble
-------------------
date : Feb 2009
Expand Down Expand Up @@ -30,112 +30,112 @@

class idColumnPair
{
public:
int id;
QVariant columnItem;
public:
int id;
QVariant columnItem;

bool operator<(const idColumnPair &b) const;
bool operator<( const idColumnPair &b ) const;
};

class BeataFilterModel: public QSortFilterProxyModel
{
public:
BeataFilterModel(QgsVectorLayer* theLayer);
//QModelIndex mapToSource ( const QModelIndex & filterIndex ) const;
//QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
bool mHideUnselected;
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
private:
QgsVectorLayer* mLayer;
public:
BeataFilterModel( QgsVectorLayer* theLayer );
//QModelIndex mapToSource ( const QModelIndex & filterIndex ) const;
//QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
bool mHideUnselected;
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
protected:
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;
private:
QgsVectorLayer* mLayer;
};


class BeataModel: public QAbstractTableModel
{
Q_OBJECT

public:
BeataModel(QgsVectorLayer *theLayer, QObject *parent = 0);

int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;

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

void reload(const QModelIndex &index1, const QModelIndex &index2);
void resetModel();
void changeLayout();
void incomingChangeLayout();
int idToRow(const int id) const;
int rowToId(const int id) const;
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
void swapRows(int a, int b);
QgsVectorLayer* layer() const { return mLayer; }

signals:
void modelChanged();
void setNumRows(int oldNum, int newNum);

private slots:
virtual void attributeAdded (int idx);
virtual void attributeDeleted (int idx);
virtual void attributeValueChanged (int fid, int idx, const QVariant &value);
virtual void layerModified(bool onlyGeometry);

protected slots:
virtual void featureDeleted(int fid);
virtual void featureAdded(int fid);
virtual void layerDeleted ();

protected:
QgsVectorLayer *mLayer;
int mFeatureCount;
int mFieldCount;
mutable int mLastRowId;
mutable QgsFeature mFeat;

mutable QgsAttributeMap *mLastRow;
QgsAttributeList mAttributes;

QList<idColumnPair> mSortList;
QMap<int, int> mIdRowMap;
QMap<int, int> mRowIdMap;

void initIdMaps();
virtual void loadLayer();
Q_OBJECT

public:
BeataModel( QgsVectorLayer *theLayer, QObject *parent = 0 );

int rowCount( const QModelIndex &parent = QModelIndex() ) const;
int columnCount( const QModelIndex &parent = QModelIndex() ) const;

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

void reload( const QModelIndex &index1, const QModelIndex &index2 );
void resetModel();
void changeLayout();
void incomingChangeLayout();
int idToRow( const int id ) const;
int rowToId( const int id ) const;
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );
void swapRows( int a, int b );

QgsVectorLayer* layer() const { return mLayer; }

signals:
void modelChanged();
void setNumRows( int oldNum, int newNum );

private slots:
virtual void attributeAdded( int idx );
virtual void attributeDeleted( int idx );
virtual void attributeValueChanged( int fid, int idx, const QVariant &value );
virtual void layerModified( bool onlyGeometry );

protected slots:
virtual void featureDeleted( int fid );
virtual void featureAdded( int fid );
virtual void layerDeleted();

protected:
QgsVectorLayer *mLayer;
int mFeatureCount;
int mFieldCount;
mutable int mLastRowId;
mutable QgsFeature mFeat;

mutable QgsAttributeMap *mLastRow;
QgsAttributeList mAttributes;

QList<idColumnPair> mSortList;
QMap<int, int> mIdRowMap;
QMap<int, int> mRowIdMap;

void initIdMaps();
virtual void loadLayer();

};

class BeataMemModel: public BeataModel
{
Q_OBJECT
Q_OBJECT

public:
BeataMemModel(QgsVectorLayer *theLayer);//, QObject *parent = 0);
public:
BeataMemModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);

protected slots:
virtual void featureDeleted(int fid);
virtual void featureAdded(int fid);
virtual void layerDeleted ();
protected slots:
virtual void featureDeleted( int fid );
virtual void featureAdded( int fid );
virtual void layerDeleted();

private slots:
//virtual void attributeAdded (int idx);
//virtual void attributeDeleted (int idx);
virtual void attributeValueChanged (int fid, int idx, const QVariant &value);
//virtual void layerModified(bool onlyGeometry);
private slots:
//virtual void attributeAdded (int idx);
//virtual void attributeDeleted (int idx);
virtual void attributeValueChanged( int fid, int idx, const QVariant &value );
//virtual void layerModified(bool onlyGeometry);

private:
virtual QVariant data(const QModelIndex &index, int role) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role);
virtual void loadLayer();
private:
virtual QVariant data( const QModelIndex &index, int role ) const;
virtual bool setData( const QModelIndex &index, const QVariant &value, int role );
virtual void loadLayer();

QMap<int, QgsFeature> mFeatureMap;
QMap<int, QgsFeature> mFeatureMap;
};

#endif
Loading

0 comments on commit 60b6bd6

Please sign in to comment.