Skip to content

Commit 129286e

Browse files
author
wonder
committedApr 13, 2009
Renaming of Beata* classes to QgsAttributeTable* classes done.
Happy easter ;-) git-svn-id: http://svn.osgeo.org/qgis/trunk@10553 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 9d8d1e8 commit 129286e

9 files changed

+135
-138
lines changed
 

‎src/app/attributetable/qgsattributetabledialog.cpp

Lines changed: 34 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/***************************************************************************
2-
BeataDialog.cpp
3-
BEtter Attribute TAble
2+
QgsAttributeTableDialog.cpp
43
-------------------
54
date : Feb 2009
65
copyright : Vita Cizek
@@ -17,9 +16,9 @@
1716

1817
#include <QtGui>
1918

20-
#include "BeataDialog.h"
21-
#include "BeataModel.h"
22-
#include "BeataView.h"
19+
#include "qgsattributetabledialog.h"
20+
#include "qgsattributetablemodel.h"
21+
#include "qgsattributetableview.h"
2322

2423
#include <qgsapplication.h>
2524
#include <qgsvectordataprovider.h>
@@ -32,10 +31,10 @@
3231
#include "qgslogger.h"
3332

3433

35-
class QBeataTableDock : public QDockWidget
34+
class QgsAttributeTableTableDock : public QDockWidget
3635
{
3736
public:
38-
QBeataTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
37+
QgsAttributeTableTableDock( const QString & title, QWidget * parent = 0, Qt::WindowFlags flags = 0 )
3938
: QDockWidget( title, parent, flags )
4039
{
4140
setObjectName( "AttributeTable" ); // set object name so the position can be saved
@@ -48,7 +47,7 @@ class QBeataTableDock : public QDockWidget
4847
};
4948

5049

51-
BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
50+
QgsAttributeTableDialog::QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowFlags flags )
5251
: QDialog( parent, flags ), mDock( NULL )
5352
{
5453
mLayer = theLayer;
@@ -61,8 +60,8 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
6160
restoreGeometry( settings.value( "/Windows/BetterAttributeTable/geometry" ).toByteArray() );
6261

6362
mView->setLayer( mLayer );
64-
mFilterModel = ( BeataFilterModel * ) mView->model();
65-
mModel = ( BeataModel * )(( BeataFilterModel * )mView->model() )->sourceModel();
63+
mFilterModel = ( QgsAttributeTableFilterModel * ) mView->model();
64+
mModel = ( QgsAttributeTableModel * )(( QgsAttributeTableFilterModel * )mView->model() )->sourceModel();
6665

6766
mQuery = query;
6867
mColumnBox = columnBox;
@@ -72,7 +71,7 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
7271
bool myDockFlag = mySettings.value( "/qgis/dockAttributeTable", false ).toBool();
7372
if ( myDockFlag )
7473
{
75-
mDock = new QBeataTableDock( tr( "Attribute table - %1" ).arg( mLayer->name() ), QgisApp::instance() );
74+
mDock = new QgsAttributeTableTableDock( tr( "Attribute table - %1" ).arg( mLayer->name() ), QgisApp::instance() );
7675
mDock->setAllowedAreas( Qt::BottomDockWidgetArea | Qt::TopDockWidgetArea );
7776
mDock->setWidget( this );
7877
QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
@@ -111,11 +110,11 @@ BeataDialog::BeataDialog( QgsVectorLayer *theLayer, QWidget *parent, Qt::WindowF
111110
updateSelectionFromLayer();
112111
}
113112

114-
BeataDialog::~BeataDialog()
113+
QgsAttributeTableDialog::~QgsAttributeTableDialog()
115114
{
116115
}
117116

118-
void BeataDialog::closeEvent( QCloseEvent* event )
117+
void QgsAttributeTableDialog::closeEvent( QCloseEvent* event )
119118
{
120119
QDialog::closeEvent( event );
121120

@@ -127,7 +126,7 @@ void BeataDialog::closeEvent( QCloseEvent* event )
127126
}
128127

129128

130-
QIcon BeataDialog::getThemeIcon( const QString theName )
129+
QIcon QgsAttributeTableDialog::getThemeIcon( const QString theName )
131130
{
132131
// copied from QgisApp::getThemeIcon. To be removed when merged to SVN
133132

@@ -149,12 +148,12 @@ QIcon BeataDialog::getThemeIcon( const QString theName )
149148
}
150149
}
151150

152-
void BeataDialog::showAdvanced()
151+
void QgsAttributeTableDialog::showAdvanced()
153152
{
154153
mMenuActions->exec( QCursor::pos() );
155154
}
156155

157-
void BeataDialog::on_mSelectedToTopButton_clicked()
156+
void QgsAttributeTableDialog::on_mSelectedToTopButton_clicked()
158157
{
159158
int freeIndex = 0;
160159

@@ -194,35 +193,35 @@ void BeataDialog::on_mSelectedToTopButton_clicked()
194193
updateSelection();
195194
}
196195

197-
void BeataDialog::on_mCopySelectedRowsButton_clicked()
196+
void QgsAttributeTableDialog::on_mCopySelectedRowsButton_clicked()
198197
{
199198
QgisApp::instance()->editCopy( mLayer );
200199
}
201200

202-
void BeataDialog::on_mZoomMapToSelectedRowsButton_clicked()
201+
void QgsAttributeTableDialog::on_mZoomMapToSelectedRowsButton_clicked()
203202
{
204203
QgisApp::instance()->zoomToSelected();
205204
}
206205

207-
void BeataDialog::on_mInvertSelectionButton_clicked()
206+
void QgsAttributeTableDialog::on_mInvertSelectionButton_clicked()
208207
{
209208
mLayer->invertSelection();
210209
}
211210

212-
void BeataDialog::on_mRemoveSelectionButton_clicked()
211+
void QgsAttributeTableDialog::on_mRemoveSelectionButton_clicked()
213212
{
214213
mLayer->removeSelection();
215214
}
216215

217-
void BeataDialog::on_cbxShowSelectedOnly_toggled( bool theFlag )
216+
void QgsAttributeTableDialog::on_cbxShowSelectedOnly_toggled( bool theFlag )
218217
{
219218
mFilterModel->mHideUnselected = theFlag;
220219
mFilterModel->invalidate();
221220
//TODO: weird
222221
//mModel->changeLayout();
223222
}
224223

225-
void BeataDialog::columnBoxInit()
224+
void QgsAttributeTableDialog::columnBoxInit()
226225
{
227226
QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
228227
QgsFieldMap::Iterator it = fieldMap.begin();
@@ -231,7 +230,7 @@ void BeataDialog::columnBoxInit()
231230
mColumnBox->addItem( it.value().name() );
232231
}
233232

234-
int BeataDialog::columnBoxColumnId()
233+
int QgsAttributeTableDialog::columnBoxColumnId()
235234
{
236235
QgsFieldMap fieldMap = mLayer->dataProvider()->fields();
237236
QgsFieldMap::Iterator it = fieldMap.begin();
@@ -243,7 +242,7 @@ int BeataDialog::columnBoxColumnId()
243242
return 0;
244243
}
245244

246-
void BeataDialog::updateSelection()
245+
void QgsAttributeTableDialog::updateSelection()
247246
{
248247
QModelIndex index;
249248
mView->setSelectionMode( QAbstractItemView::MultiSelection );
@@ -272,7 +271,7 @@ void BeataDialog::updateSelection()
272271
*/
273272
}
274273

275-
void BeataDialog::updateRowSelection( int index )
274+
void QgsAttributeTableDialog::updateRowSelection( int index )
276275
{
277276
// map index to filter model
278277
//index = mFilterModel->mapFromSource(mModel->index(index, 0)).row();
@@ -326,7 +325,7 @@ void BeataDialog::updateRowSelection( int index )
326325
}
327326

328327
// fast row deselection needed
329-
void BeataDialog::updateRowSelection( int first, int last, bool startNewSelection )
328+
void QgsAttributeTableDialog::updateRowSelection( int first, int last, bool startNewSelection )
330329
{
331330
disconnect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateSelectionFromLayer() ) );
332331

@@ -398,14 +397,14 @@ void BeataDialog::updateRowSelection( int first, int last, bool startNewSelectio
398397
connect( mLayer, SIGNAL( selectionChanged() ), this, SLOT( updateSelectionFromLayer() ) );
399398
}
400399

401-
void BeataDialog::updateSelectionFromLayer()
400+
void QgsAttributeTableDialog::updateSelectionFromLayer()
402401
{
403402
QgsDebugMsg( "updateFromLayer" );
404403
mSelectedFeatures = mLayer->selectedFeaturesIds();
405404
updateSelection();
406405
}
407406

408-
void BeataDialog::doSearch( QString searchString )
407+
void QgsAttributeTableDialog::doSearch( QString searchString )
409408
{
410409
// parse search string and build parsed tree
411410
QgsSearchString search;
@@ -462,7 +461,7 @@ void BeataDialog::doSearch( QString searchString )
462461
QMessageBox::information( this, tr( "Search results" ), str );
463462
}
464463

465-
void BeataDialog::search()
464+
void QgsAttributeTableDialog::search()
466465
{
467466

468467
QString str = mColumnBox->currentText();
@@ -483,7 +482,7 @@ void BeataDialog::search()
483482
doSearch( str );
484483
}
485484

486-
void BeataDialog::on_mAdvancedSearchButton_clicked()
485+
void QgsAttributeTableDialog::on_mAdvancedSearchButton_clicked()
487486
{
488487
QgsSearchQueryBuilder dlg( mLayer, this );
489488
dlg.setSearchString( mQuery->displayText() );
@@ -492,12 +491,12 @@ void BeataDialog::on_mAdvancedSearchButton_clicked()
492491
doSearch( dlg.searchString() );
493492
}
494493

495-
void BeataDialog::on_mToggleEditingButton_toggled()
494+
void QgsAttributeTableDialog::on_mToggleEditingButton_toggled()
496495
{
497496
emit editingToggled( mLayer );
498497
}
499498

500-
void BeataDialog::editingToggled()
499+
void QgsAttributeTableDialog::editingToggled()
501500
{
502501
mToggleEditingButton->setChecked( mLayer->isEditable() );
503502

@@ -509,19 +508,19 @@ void BeataDialog::editingToggled()
509508
}
510509

511510
// not used now
512-
void BeataDialog::startEditing()
511+
void QgsAttributeTableDialog::startEditing()
513512
{
514513
mLayer->startEditing();
515514
}
516515

517516
// not used now
518-
void BeataDialog::submit()
517+
void QgsAttributeTableDialog::submit()
519518
{
520519
mLayer->commitChanges();
521520
}
522521

523522
// not used now
524-
void BeataDialog::revert()
523+
void QgsAttributeTableDialog::revert()
525524
{
526525
mLayer->rollBack();
527526
mModel->revert();

‎src/app/attributetable/qgsattributetabledialog.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/***************************************************************************
2-
BeataDialog.h
3-
BEtter Attribute TAble
2+
QgsAttributeTableDialog.h - dialog for attribute table
43
-------------------
54
date : Feb 2009
65
copyright : Vita Cizek
@@ -15,15 +14,15 @@
1514
* *
1615
***************************************************************************/
1716

18-
#ifndef BEATADIALOG_H_
19-
#define BEATADIALOG_H_
17+
#ifndef QGSATTRIBUTETABLEDIALOG_H_
18+
#define QGSATTRIBUTETABLEDIALOG_H_
2019

2120
#include <QDialog>
2221
#include <QModelIndex>
2322
#include <QItemSelectionModel>
2423
#include <QMutex>
2524

26-
#include "ui_BeataGui.h"
25+
#include "ui_qgsattributetabledialog.h"
2726

2827
class QgsMapLayer;
2928
class QgsVectorLayer;
@@ -37,17 +36,17 @@ class QComboBox;
3736
class QMenu;
3837
class QDockWidget;
3938

40-
class BeataModel;
41-
class BeataFilterModel;
42-
class BeataView;
39+
class QgsAttributeTableModel;
40+
class QgsAttributeTableFilterModel;
41+
class QgsAttributeTableView;
4342

44-
class BeataDialog : public QDialog, private Ui::BeataDialogGui
43+
class QgsAttributeTableDialog : public QDialog, private Ui::QgsAttributeTableDialog
4544
{
4645
Q_OBJECT
4746

4847
public:
49-
BeataDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
50-
~BeataDialog();
48+
QgsAttributeTableDialog( QgsVectorLayer *theLayer, QWidget *parent = 0, Qt::WindowFlags flags = Qt::Window );
49+
~QgsAttributeTableDialog();
5150

5251
public slots:
5352
void editingToggled();
@@ -93,8 +92,8 @@ class BeataDialog : public QDialog, private Ui::BeataDialogGui
9392
QMenu* mMenuActions;
9493
QAction* mActionToggleEditing;
9594

96-
BeataModel *mModel;
97-
BeataFilterModel *mFilterModel;
95+
QgsAttributeTableModel *mModel;
96+
QgsAttributeTableFilterModel *mFilterModel;
9897
QgsVectorLayer *mLayer;
9998
QgsFeatureIds mSelectedFeatures;
10099

‎src/app/attributetable/qgsattributetablemodel.cpp

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
BeataModel.cpp
2+
QgsAttributeTableModel.cpp
33
--------------------------------------
44
Date : Feb 2009
55
Copyright : (C) 2009 Vita Cizek
@@ -13,8 +13,8 @@
1313
* *
1414
***************************************************************************/
1515

16-
#include "BeataModel.h"
17-
#include "BeataView.h"
16+
#include "qgsattributetablemodel.h"
17+
//#include "qgsattributetableview.h"
1818

1919
#include "qgsvectordataprovider.h"
2020
#include "qgsfield.h"
@@ -44,44 +44,44 @@ bool idColumnPair::operator<( const idColumnPair &b ) const
4444
// Filter Model //
4545
//////////////////
4646

47-
void BeataFilterModel::sort( int column, Qt::SortOrder order )
47+
void QgsAttributeTableFilterModel::sort( int column, Qt::SortOrder order )
4848
{
49-
(( BeataModel * )sourceModel() )->sort( column, order );
49+
(( QgsAttributeTableModel * )sourceModel() )->sort( column, order );
5050
}
5151

52-
BeataFilterModel::BeataFilterModel( QgsVectorLayer* theLayer )
52+
QgsAttributeTableFilterModel::QgsAttributeTableFilterModel( QgsVectorLayer* theLayer )
5353
{
5454
mLayer = theLayer;
5555
mHideUnselected = false;
5656
setDynamicSortFilter( true );
5757
}
5858

59-
bool BeataFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
59+
bool QgsAttributeTableFilterModel::filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const
6060
{
6161
if ( mHideUnselected )
6262
// unreadable? yes, i agree :-)
63-
return mLayer->selectedFeaturesIds().contains((( BeataModel * )sourceModel() )->rowToId( sourceRow ) );
63+
return mLayer->selectedFeaturesIds().contains((( QgsAttributeTableModel * )sourceModel() )->rowToId( sourceRow ) );
6464

6565
return true;
6666
}
6767

6868
/*
69-
QModelIndex BeataFilterModel::mapFromSource ( const QModelIndex& sourceIndex ) const
69+
QModelIndex QgsAttributeTableFilterModel::mapFromSource ( const QModelIndex& sourceIndex ) const
7070
{
7171
return sourceIndex;
7272
}
7373
74-
QModelIndex BeataFilterModel::mapToSource ( const QModelIndex& filterIndex ) const
74+
QModelIndex QgsAttributeTableFilterModel::mapToSource ( const QModelIndex& filterIndex ) const
7575
{
7676
return filterIndex;
7777
}
7878
*/
7979

80-
////////////////
81-
// BeataModel //
82-
////////////////
80+
////////////////////////////
81+
// QgsAttributeTableModel //
82+
////////////////////////////
8383

84-
BeataModel::BeataModel( QgsVectorLayer *theLayer, QObject *parent )
84+
QgsAttributeTableModel::QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent )
8585
: QAbstractTableModel( parent )
8686
{
8787
mLastRowId = -1;
@@ -101,7 +101,7 @@ BeataModel::BeataModel( QgsVectorLayer *theLayer, QObject *parent )
101101
loadLayer();
102102
}
103103

104-
void BeataModel::featureDeleted( int fid )
104+
void QgsAttributeTableModel::featureDeleted( int fid )
105105
{
106106
QgsDebugMsg( "entered." );
107107

@@ -147,7 +147,7 @@ void BeataModel::featureDeleted( int fid )
147147

148148
}
149149

150-
void BeataModel::featureAdded( int fid )
150+
void QgsAttributeTableModel::featureAdded( int fid )
151151
{
152152
QgsDebugMsg( "BM feature added" );
153153
++mFeatureCount;
@@ -157,7 +157,7 @@ void BeataModel::featureAdded( int fid )
157157
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
158158
}
159159

160-
void BeataModel::attributeAdded( int idx )
160+
void QgsAttributeTableModel::attributeAdded( int idx )
161161
{
162162
QgsDebugMsg( "BM attribute added" );
163163
loadLayer();
@@ -166,7 +166,7 @@ void BeataModel::attributeAdded( int idx )
166166
emit modelChanged();
167167
}
168168

169-
void BeataModel::attributeDeleted( int idx )
169+
void QgsAttributeTableModel::attributeDeleted( int idx )
170170
{
171171
QgsDebugMsg( "BM attribute deleted" );
172172
loadLayer();
@@ -175,7 +175,7 @@ void BeataModel::attributeDeleted( int idx )
175175
emit modelChanged();
176176
}
177177

178-
void BeataModel::layerDeleted()
178+
void QgsAttributeTableModel::layerDeleted()
179179
{
180180
QgsDebugMsg( "entered." );
181181
mIdRowMap.clear();
@@ -185,13 +185,13 @@ void BeataModel::layerDeleted()
185185
}
186186

187187
//TODO: check whether caching in data()/setData() doesn't cache old value
188-
void BeataModel::attributeValueChanged( int fid, int idx, const QVariant &value )
188+
void QgsAttributeTableModel::attributeValueChanged( int fid, int idx, const QVariant &value )
189189
{
190190
QgsDebugMsg( "entered." );
191191
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
192192
}
193193

194-
void BeataModel::layerModified( bool onlyGeometry )
194+
void QgsAttributeTableModel::layerModified( bool onlyGeometry )
195195
{
196196
if ( onlyGeometry )
197197
return;
@@ -200,7 +200,7 @@ void BeataModel::layerModified( bool onlyGeometry )
200200
emit modelChanged();
201201
}
202202

203-
void BeataModel::loadLayer()
203+
void QgsAttributeTableModel::loadLayer()
204204
{
205205
QgsDebugMsg( "entered." );
206206

@@ -261,7 +261,7 @@ void BeataModel::loadLayer()
261261
#endif
262262
}
263263

264-
void BeataModel::swapRows( int a, int b )
264+
void QgsAttributeTableModel::swapRows( int a, int b )
265265
{
266266
if ( a == b )
267267
return;
@@ -284,7 +284,7 @@ void BeataModel::swapRows( int a, int b )
284284
//emit layoutChanged();
285285
}
286286

287-
int BeataModel::idToRow( const int id ) const
287+
int QgsAttributeTableModel::idToRow( const int id ) const
288288
{
289289
if ( !mIdRowMap.contains( id ) )
290290
{
@@ -295,7 +295,7 @@ int BeataModel::idToRow( const int id ) const
295295
return mIdRowMap[id];
296296
}
297297

298-
int BeataModel::rowToId( const int id ) const
298+
int QgsAttributeTableModel::rowToId( const int id ) const
299299
{
300300
if ( !mRowIdMap.contains( id ) )
301301
{
@@ -306,17 +306,17 @@ int BeataModel::rowToId( const int id ) const
306306
return mRowIdMap[id];
307307
}
308308

309-
int BeataModel::rowCount( const QModelIndex &parent ) const
309+
int QgsAttributeTableModel::rowCount( const QModelIndex &parent ) const
310310
{
311311
return mFeatureCount;
312312
}
313313

314-
int BeataModel::columnCount( const QModelIndex &parent ) const
314+
int QgsAttributeTableModel::columnCount( const QModelIndex &parent ) const
315315
{
316316
return mFieldCount;
317317
}
318318

319-
QVariant BeataModel::headerData( int section, Qt::Orientation orientation, int role ) const
319+
QVariant QgsAttributeTableModel::headerData( int section, Qt::Orientation orientation, int role ) const
320320
{
321321
if ( role == Qt::DisplayRole )
322322
{
@@ -333,7 +333,7 @@ QVariant BeataModel::headerData( int section, Qt::Orientation orientation, int r
333333
else return QVariant();
334334
}
335335

336-
void BeataModel::sort( int column, Qt::SortOrder order )
336+
void QgsAttributeTableModel::sort( int column, Qt::SortOrder order )
337337
{
338338
QgsAttributeMap row;
339339
idColumnPair pair;
@@ -380,7 +380,7 @@ void BeataModel::sort( int column, Qt::SortOrder order )
380380
emit modelChanged();
381381
}
382382

383-
QVariant BeataModel::data( const QModelIndex &index, int role ) const
383+
QVariant QgsAttributeTableModel::data( const QModelIndex &index, int role ) const
384384
{
385385
if ( !index.isValid() || ( role != Qt::TextAlignmentRole && role != Qt::DisplayRole && role != Qt::EditRole ) )
386386
return QVariant();
@@ -433,7 +433,7 @@ QVariant BeataModel::data( const QModelIndex &index, int role ) const
433433
return val.toString();
434434
}
435435

436-
bool BeataModel::setData( const QModelIndex &index, const QVariant &value, int role )
436+
bool QgsAttributeTableModel::setData( const QModelIndex &index, const QVariant &value, int role )
437437
{
438438
if ( !index.isValid() || role != Qt::EditRole )
439439
return false;
@@ -458,7 +458,7 @@ bool BeataModel::setData( const QModelIndex &index, const QVariant &value, int r
458458
return true;
459459
}
460460

461-
Qt::ItemFlags BeataModel::flags( const QModelIndex &index ) const
461+
Qt::ItemFlags QgsAttributeTableModel::flags( const QModelIndex &index ) const
462462
{
463463
if ( !index.isValid() )
464464
return Qt::ItemIsEnabled;
@@ -471,22 +471,22 @@ Qt::ItemFlags BeataModel::flags( const QModelIndex &index ) const
471471
return flags;
472472
}
473473

474-
void BeataModel::reload( const QModelIndex &index1, const QModelIndex &index2 )
474+
void QgsAttributeTableModel::reload( const QModelIndex &index1, const QModelIndex &index2 )
475475
{
476476
emit dataChanged( index1, index2 );
477477
}
478478

479-
void BeataModel::resetModel()
479+
void QgsAttributeTableModel::resetModel()
480480
{
481481
reset();
482482
}
483483

484-
void BeataModel::changeLayout()
484+
void QgsAttributeTableModel::changeLayout()
485485
{
486486
emit layoutChanged();
487487
}
488488

489-
void BeataModel::incomingChangeLayout()
489+
void QgsAttributeTableModel::incomingChangeLayout()
490490
{
491491
emit layoutAboutToBeChanged();
492492
}
@@ -495,24 +495,24 @@ void BeataModel::incomingChangeLayout()
495495
// In-Memory model //
496496
/////////////////////
497497

498-
void BeataMemModel::loadLayer()
498+
void QgsAttributeTableMemModel::loadLayer()
499499
{
500-
BeataModel::loadLayer();
500+
QgsAttributeTableModel::loadLayer();
501501
mLayer->select( mLayer->pendingAllAttributesList(), QgsRectangle(), false );
502502

503503
QgsFeature f;
504504
while ( mLayer->nextFeature( f ) )
505505
mFeatureMap.insert( f.id(), f );
506506
}
507507

508-
BeataMemModel::BeataMemModel
508+
QgsAttributeTableMemModel::QgsAttributeTableMemModel
509509
( QgsVectorLayer *theLayer )
510-
: BeataModel( theLayer )
510+
: QgsAttributeTableModel( theLayer )
511511
{
512512
loadLayer();
513513
}
514514

515-
QVariant BeataMemModel::data( const QModelIndex &index, int role ) const
515+
QVariant QgsAttributeTableMemModel::data( const QModelIndex &index, int role ) const
516516
{
517517
if ( !index.isValid() || ( role != Qt::TextAlignmentRole && role != Qt::DisplayRole && role != Qt::EditRole ) )
518518
return QVariant();
@@ -567,7 +567,7 @@ QVariant BeataMemModel::data( const QModelIndex &index, int role ) const
567567
return val.toString();
568568
}
569569

570-
bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, int role )
570+
bool QgsAttributeTableMemModel::setData( const QModelIndex &index, const QVariant &value, int role )
571571
{
572572
if ( !index.isValid() || role != Qt::EditRole )
573573
return false;
@@ -598,46 +598,46 @@ bool BeataMemModel::setData( const QModelIndex &index, const QVariant &value, in
598598
return true;
599599
}
600600

601-
void BeataMemModel::featureDeleted( int fid )
601+
void QgsAttributeTableMemModel::featureDeleted( int fid )
602602
{
603603
QgsDebugMsg( "entered." );
604604
mFeatureMap.remove( fid );
605-
BeataModel::featureDeleted( fid );
605+
QgsAttributeTableModel::featureDeleted( fid );
606606
}
607607

608-
void BeataMemModel::featureAdded( int fid )
608+
void QgsAttributeTableMemModel::featureAdded( int fid )
609609
{
610610
QgsDebugMsg( "entered." );
611611
QgsFeature f;
612612
mLayer->featureAtId( fid, f, false, true );
613613
mFeatureMap.insert( fid, f );
614-
BeataModel::featureAdded( fid );
614+
QgsAttributeTableModel::featureAdded( fid );
615615
}
616616

617617
#if 0
618-
void BeataMemModel::attributeAdded( int idx )
618+
void QgsAttributeTableMemModel::attributeAdded( int idx )
619619
{
620620
QgsDebugMsg( "entered." );
621621
loadLayer();
622622
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
623623
}
624624

625-
void BeataMemModel::attributeDeleted( int idx )
625+
void QgsAttributeTableMemModel::attributeDeleted( int idx )
626626
{
627627
QgsDebugMsg( "entered." );
628628
loadLayer();
629629
reload( index( 0, 0 ), index( rowCount(), columnCount() ) );
630630
}
631631
#endif
632632

633-
void BeataMemModel::layerDeleted()
633+
void QgsAttributeTableMemModel::layerDeleted()
634634
{
635635
QgsDebugMsg( "entered." );
636636
mFeatureMap.clear();
637-
BeataModel::layerDeleted();
637+
QgsAttributeTableModel::layerDeleted();
638638
}
639639

640-
void BeataMemModel::attributeValueChanged( int fid, int idx, const QVariant &value )
640+
void QgsAttributeTableMemModel::attributeValueChanged( int fid, int idx, const QVariant &value )
641641
{
642642
QgsDebugMsg( "entered." );
643643
mFeatureMap[fid].changeAttribute( idx, value );

‎src/app/attributetable/qgsattributetablemodel.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/***************************************************************************
2-
BeataModel.h
3-
BEtter Attribute TAble
2+
QgsAttributeTableModel.h - Models for attribute table
43
-------------------
54
date : Feb 2009
65
copyright : Vita Cizek
@@ -15,8 +14,8 @@
1514
* *
1615
***************************************************************************/
1716

18-
#ifndef BEATAMODEL_H
19-
#define BEATAMODEL_H
17+
#ifndef QGSATTRIBUTETABKEMODEL_H
18+
#define QGSATTRIBUTETABKEMODEL_H
2019

2120
#include <QAbstractTableModel>
2221
#include <QSortFilterProxyModel>
@@ -37,10 +36,10 @@ class idColumnPair
3736
bool operator<( const idColumnPair &b ) const;
3837
};
3938

40-
class BeataFilterModel: public QSortFilterProxyModel
39+
class QgsAttributeTableFilterModel: public QSortFilterProxyModel
4140
{
4241
public:
43-
BeataFilterModel( QgsVectorLayer* theLayer );
42+
QgsAttributeTableFilterModel( QgsVectorLayer* theLayer );
4443
//QModelIndex mapToSource ( const QModelIndex & filterIndex ) const;
4544
//QModelIndex mapFromSource ( const QModelIndex & sourceIndex ) const;
4645
bool mHideUnselected;
@@ -52,12 +51,12 @@ class BeataFilterModel: public QSortFilterProxyModel
5251
};
5352

5453

55-
class BeataModel: public QAbstractTableModel
54+
class QgsAttributeTableModel: public QAbstractTableModel
5655
{
5756
Q_OBJECT
5857

5958
public:
60-
BeataModel( QgsVectorLayer *theLayer, QObject *parent = 0 );
59+
QgsAttributeTableModel( QgsVectorLayer *theLayer, QObject *parent = 0 );
6160

6261
int rowCount( const QModelIndex &parent = QModelIndex() ) const;
6362
int columnCount( const QModelIndex &parent = QModelIndex() ) const;
@@ -112,12 +111,12 @@ class BeataModel: public QAbstractTableModel
112111

113112
};
114113

115-
class BeataMemModel: public BeataModel
114+
class QgsAttributeTableMemModel: public QgsAttributeTableModel
116115
{
117116
Q_OBJECT
118117

119118
public:
120-
BeataMemModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);
119+
QgsAttributeTableMemModel( QgsVectorLayer *theLayer );//, QObject *parent = 0);
121120

122121
protected slots:
123122
virtual void featureDeleted( int fid );

‎src/app/attributetable/qgsattributetableview.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
BeataView.cpp
2+
QgsAttributeTableView.cpp
33
--------------------------------------
44
Date : Feb 2009
55
Copyright : (C) 2009 Vita Cizek
@@ -21,18 +21,18 @@
2121
#include <QPainter>
2222
#include <QKeyEvent>
2323

24-
#include "BeataView.h"
25-
#include "BeataModel.h"
24+
#include "qgsattributetableview.h"
25+
#include "qgsattributetablemodel.h"
2626

2727
#include "qgslogger.h"
2828
#include "qgsvectorlayer.h"
2929
#include "qgsvectordataprovider.h"
3030

3131

32-
class BeataDelegate : public QItemDelegate
32+
class QgsAttributeTableDelegate : public QItemDelegate
3333
{
3434
public:
35-
BeataDelegate( QObject* parent = NULL ) : QItemDelegate( parent ) {}
35+
QgsAttributeTableDelegate( QObject* parent = NULL ) : QItemDelegate( parent ) {}
3636

3737
QWidget * createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const
3838
{
@@ -41,7 +41,7 @@ class BeataDelegate : public QItemDelegate
4141
QLineEdit *le = dynamic_cast<QLineEdit*>( editor );
4242
if ( !le ) return editor;
4343

44-
const BeataModel* m = dynamic_cast<const BeataModel*>( index.model() );
44+
const QgsAttributeTableModel* m = dynamic_cast<const QgsAttributeTableModel*>( index.model() );
4545
if ( !m ) return editor;
4646

4747
int col = index.column();
@@ -77,7 +77,7 @@ class BeataDelegate : public QItemDelegate
7777

7878
};
7979

80-
BeataView::BeataView( QWidget* parent )
80+
QgsAttributeTableView::QgsAttributeTableView( QWidget* parent )
8181
: QTableView( parent )
8282
{
8383
QSettings settings;
@@ -86,7 +86,7 @@ BeataView::BeataView( QWidget* parent )
8686
verticalHeader()->setDefaultSectionSize( 20 );
8787
horizontalHeader()->setHighlightSections( false );
8888

89-
setItemDelegate( new BeataDelegate( this ) );
89+
setItemDelegate( new QgsAttributeTableDelegate( this ) );
9090

9191
setSelectionBehavior( QAbstractItemView::SelectRows );
9292
setSelectionMode( QAbstractItemView::NoSelection );
@@ -96,32 +96,32 @@ BeataView::BeataView( QWidget* parent )
9696
ctrlPressed = false;
9797
}
9898

99-
void BeataView::setLayer( QgsVectorLayer* layer )
99+
void QgsAttributeTableView::setLayer( QgsVectorLayer* layer )
100100
{
101-
BeataModel *bModel;
101+
QgsAttributeTableModel *bModel;
102102

103103
if ( layer->dataProvider()->capabilities() & QgsVectorDataProvider::RandomSelectGeometryAtId )
104-
bModel = new BeataModel( layer );
104+
bModel = new QgsAttributeTableModel( layer );
105105
else
106-
bModel = new BeataMemModel( layer );
106+
bModel = new QgsAttributeTableMemModel( layer );
107107

108-
BeataFilterModel* bfModel = new BeataFilterModel( layer );
108+
QgsAttributeTableFilterModel* bfModel = new QgsAttributeTableFilterModel( layer );
109109
bfModel->setSourceModel( bModel );
110110

111111
setModel( bfModel );
112112
}
113113

114-
BeataView::~BeataView()
114+
QgsAttributeTableView::~QgsAttributeTableView()
115115
{
116116
}
117117

118-
void BeataView::closeEvent( QCloseEvent *event )
118+
void QgsAttributeTableView::closeEvent( QCloseEvent *event )
119119
{
120120
QSettings settings;
121121
settings.setValue( "/BetterAttributeTable/geometry", QVariant( saveGeometry() ) );
122122
}
123123

124-
void BeataView::keyPressEvent( QKeyEvent *event )
124+
void QgsAttributeTableView::keyPressEvent( QKeyEvent *event )
125125
{
126126
// shift pressed
127127
if ( event->key() == Qt::Key_Shift )// && event->modifiers() & Qt::ShiftModifier)
@@ -132,7 +132,7 @@ void BeataView::keyPressEvent( QKeyEvent *event )
132132
QTableView::keyPressEvent( event );
133133
}
134134

135-
void BeataView::keyReleaseEvent( QKeyEvent *event )
135+
void QgsAttributeTableView::keyReleaseEvent( QKeyEvent *event )
136136
{
137137
// workaround for some Qt bug
138138
if ( event->key() == Qt::Key_Shift || event->key() == -1 )

‎src/app/attributetable/qgsattributetableview.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/***************************************************************************
2-
BeataView.h
2+
QgsAttributeTableView.h
33
--------------------------------------
44
Date : Feb 2009
55
Copyright : (C) 2009 Vita Cizek
@@ -13,22 +13,22 @@
1313
* *
1414
***************************************************************************/
1515

16-
#ifndef BEATAVIEW_H_
17-
#define BEATAVIEW_H_
16+
#ifndef QGSATTRIBUTETABLEVIEW_H_
17+
#define QGSATTRIBUTETABLEVIEW_H_
1818

1919
#include <QTableView>
2020

2121
class QgsVectorLayer;
2222

2323

24-
class BeataView: public QTableView
24+
class QgsAttributeTableView: public QTableView
2525
{
2626
//private slots:
2727
//void setRows(int rows);
2828

2929
public:
30-
BeataView( QWidget* parent = NULL );
31-
virtual ~BeataView();
30+
QgsAttributeTableView( QWidget* parent = NULL );
31+
virtual ~QgsAttributeTableView();
3232

3333
void setLayer( QgsVectorLayer* layer );
3434

‎src/app/legend/qgslegend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#include "qgsrasterlayerproperties.h"
3939
#include "qgsvectorlayerproperties.h"
4040

41-
#include "BeataDialog.h"
41+
#include "qgsattributetabledialog.h"
4242

4343
#include <cfloat>
4444
#include <iostream>
@@ -1860,7 +1860,7 @@ void QgsLegend::legendLayerAttributeTable()
18601860

18611861
if ( vlayer )
18621862
{
1863-
BeataDialog *mDialog = new BeataDialog( vlayer );
1863+
QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( vlayer );
18641864
mDialog->show();
18651865
// the dialog will be deleted by itself on close
18661866
}

‎src/app/legend/qgslegendlayerfile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "qgsgenericprojectionselector.h"
3333

3434
// attribute table
35-
#include "BeataDialog.h"
35+
#include "qgsattributetabledialog.h"
3636

3737

3838
#include "qgsencodingfiledialog.h"
@@ -218,7 +218,7 @@ void QgsLegendLayerFile::saveAsShapefile()
218218
void QgsLegendLayerFile::table()
219219
{
220220
QgsVectorLayer * myLayer = dynamic_cast<QgsVectorLayer *>( mLyr.layer() );
221-
BeataDialog *mDialog = new BeataDialog( myLayer );
221+
QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( myLayer );
222222
mDialog->show();
223223
// the dialog will be deleted by itself on close
224224
}

‎src/app/qgisapp.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
#include "qgsvectordataprovider.h"
133133
#include "qgsvectorlayer.h"
134134
#include "ogr/qgsopenvectorlayerdialog.h"
135-
#include "BeataDialog.h"
135+
#include "qgsattributetabledialog.h"
136136
//
137137
// Gdal/Ogr includes
138138
//
@@ -3886,7 +3886,7 @@ void QgisApp::attributeTable()
38863886
}
38873887

38883888
QgsVectorLayer * myLayer = dynamic_cast<QgsVectorLayer *>( mMapLegend->currentLayer() );
3889-
BeataDialog *mDialog = new BeataDialog( myLayer );
3889+
QgsAttributeTableDialog *mDialog = new QgsAttributeTableDialog( myLayer );
38903890
mDialog->show();
38913891
// the dialog will be deleted by itself on close
38923892
}

0 commit comments

Comments
 (0)
Please sign in to comment.