Example #1
0
void QgsTextEditWrapper::setValue( const QVariant &val )
{
  if ( mLineEdit )
  {
    //restore placeholder text, which may have been removed by showIndeterminateState()
    mLineEdit->setPlaceholderText( mPlaceholderText );
  }
  setWidgetValue( val );
}
Example #2
0
BlackWidget::BlackWidget(QWidget *parent, int itemIndex)
    : QWidget(parent),
    _itemIndex(itemIndex)
{
    initWidget();
    readAndSetStyleSheet();

    setWidgetValue(_itemIndex);

}
void QgsTextEditWrapper::showIndeterminateState()
{
  //note - this is deliberately a zero length string, not a null string!
  if ( mTextEdit )
    mTextEdit->blockSignals( true );
  if ( mPlainTextEdit )
    mPlainTextEdit->blockSignals( true );
  if ( mLineEdit )
    mLineEdit->blockSignals( true );

  setWidgetValue( QString( "" ) );

  if ( mTextEdit )
    mTextEdit->blockSignals( false );
  if ( mPlainTextEdit )
    mPlainTextEdit->blockSignals( false );
  if ( mLineEdit )
    mLineEdit->blockSignals( false );
}
Example #4
0
void QgsTextEditWrapper::showIndeterminateState()
{
  //note - this is deliberately a zero length string, not a null string!
  if ( mTextEdit )
    mTextEdit->blockSignals( true );
  if ( mPlainTextEdit )
    mPlainTextEdit->blockSignals( true );
  if ( mLineEdit )
  {
    mLineEdit->blockSignals( true );
    // for interdeminate state we need to clear the placeholder text - we want an empty line edit, not
    // one showing the default value (e.g., "NULL")
    mLineEdit->setPlaceholderText( QString() );
  }

  setWidgetValue( QLatin1String( "" ) );

  if ( mTextEdit )
    mTextEdit->blockSignals( false );
  if ( mPlainTextEdit )
    mPlainTextEdit->blockSignals( false );
  if ( mLineEdit )
    mLineEdit->blockSignals( false );
}
void QgsTextEditWrapper::setValue( const QVariant& val )
{
  setWidgetValue( val );
}