Skip to content
Permalink
Browse files

Merge pull request #5746 from elpaso/backport-pr-5707

[ui][bugfix] lineedit add margin for X icon
  • Loading branch information
elpaso committed Nov 28, 2017
2 parents 9204905 + 106b8b6 commit 2499a20a826abb66a260167f9c9a8e127bbb2875
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/gui/qgsfilterlineedit.cpp
@@ -35,11 +35,15 @@ QgsFilterLineEdit::QgsFilterLineEdit( QWidget* parent, const QString& nullValue
setMouseTracking( true );

QIcon clearIcon = QgsApplication::getThemeIcon( "/mIconClearText.svg" );
mClearIconSize = QSize( 16, 16 );
int size = fontMetrics().height();
mClearIconSize = QSize( size, size );
mClearIconPixmap = clearIcon.pixmap( mClearIconSize );
QIcon hoverIcon = QgsApplication::getThemeIcon( "/mIconClearTextHover.svg" );
mClearHoverPixmap = hoverIcon.pixmap( mClearIconSize );

// Make some space for the clear icon
QMargins margins( textMargins( ) );
margins.setRight( size );
setTextMargins( margins );
connect( this, SIGNAL( textChanged( const QString& ) ), this,
SLOT( onTextChanged( const QString& ) ) );
}

0 comments on commit 2499a20

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