Skip to content
Permalink
Browse files

Don't leak memory in bookmarks delegate

  • Loading branch information
elpaso committed Dec 4, 2017
1 parent 57dc9de commit e4dabe57dfd08ab435ea6f0f76a1eecb0201c370
Showing with 9 additions and 1 deletion.
  1. +7 −1 src/app/qgsbookmarks.cpp
  2. +2 −0 src/app/qgsbookmarks.h
@@ -109,7 +109,7 @@ QgsBookmarks::QgsBookmarks( QWidget *parent )
mProxyModel->setSourceModel( mModel );

lstBookmarks->setModel( mProxyModel );
lstBookmarks->setItemDelegate( new QgsDoubleSpinBoxBookmarksDelegate );
lstBookmarks->setItemDelegate( new QgsDoubleSpinBoxBookmarksDelegate( this ) );

connect( mModel, &QgsMergedBookmarksTableModel::layoutChanged, mProxyModel, &QgsBookmarksProxyModel::_resetModel );

@@ -760,6 +760,12 @@ QVariant QgsBookmarksProxyModel::headerData( int section, Qt::Orientation orient
return sourceModel()->headerData( section, orientation, role );
}

QgsDoubleSpinBoxBookmarksDelegate::QgsDoubleSpinBoxBookmarksDelegate( QObject *parent )
: QStyledItemDelegate( parent )
{

}

QString QgsDoubleSpinBoxBookmarksDelegate::displayText( const QVariant &value, const QLocale &locale ) const
{
if ( value.userType() == QVariant::Double )
@@ -82,6 +82,8 @@ class QgsDoubleSpinBoxBookmarksDelegate : public QStyledItemDelegate

public:

explicit QgsDoubleSpinBoxBookmarksDelegate( QObject *parent = nullptr );

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

QWidget *createEditor( QWidget *parent,

0 comments on commit e4dabe5

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