title: How to hide action button when QLineEdit is disabled?
body: <p>I have a class which is inherited from QLineEdit, and I set an icon as an action button for this.</p>
  <pre><code>MyEdit::MyEdit( QWidget *p_parent ) : QLineEdit( p_parent )
  {
    m_buttonAction = addAction( QIcon( &quot;search.png&quot; ), QLineEdit::TrailingPosition );
    QAbstractButton *button = qobject_cast&lt;QAbstractButton *&gt;( m_buttonAction-&gt;associatedWidgets().last() );
    m_buttonAction-&gt;setVisible( false );
    connect( m_buttonAction, &amp;QAction::triggered, this, &amp;MyEdit::openCompleter );
  
    m_completer = new QCompleter( this );
    m_sourceModel = new CompleterSourceModel( m_completer );
    m_view = new CompleterView();
    m_view-&gt;setStyle( &amp;m_style );
    m_delegate = new CompleterDelegate( m_view );
    m_completer-&gt;setPopup( m_view );
    m_completer-&gt;setModel( m_sourceModel );
    m_view-&gt;setItemDelegate( m_delegate );
    setCompleter( m_completer );
  }
  
  void MyEdit::setDataForCompleter( const CompleterData &amp;p_data )
  {
    m_sourceModel-&gt;setCompleterData( p_data );
    m_buttonAction-&gt;setVisible( p_data.data().size() &gt; 0 ); 
  }
  </code></pre>
  <p>When I import data for completer, the icon is always shown. Now I need to hide this icon in case <code>MyEdit</code> is disabled or as ReadOnly.
  I am thinking about override <code>setDisabled</code> and <code>setReadOnly</code> for my class, and in there <code>setVisible</code> for the icon. But these functions are not virtual, so can not be overridden.
  I am thinking also about a signal like <code>stateChanged</code> of my class, so I can do it in a slot. But I can not find any signal like that for <code>QLineEdit</code>. Do you have any idea how to do it?</p>