494 |
494 |
myWidget = pte;
|
495 |
495 |
}
|
496 |
496 |
|
|
497 |
QLineEdit* cble = 0;
|
497 |
498 |
if ( cb )
|
498 |
499 |
{
|
|
500 |
cble = cb->lineEdit();
|
499 |
501 |
myWidget = cb;
|
500 |
502 |
}
|
501 |
503 |
|
... | ... | |
516 |
518 |
relay = new QgsStringRelay( myWidget );
|
517 |
519 |
}
|
518 |
520 |
|
519 |
|
if ( cb && cb->isEditable() )
|
|
521 |
if ( cb && cb->isEditable() && cble )
|
520 |
522 |
{
|
521 |
|
synchronized = connect( relay, SIGNAL( textChanged( QString ) ), myWidget, SLOT( setEditText( QString ) ) );
|
522 |
|
synchronized &= connect( myWidget, SIGNAL( editTextChanged( QString ) ), relay, SLOT( changeText( QString ) ) );
|
|
523 |
synchronized = connect( relay, SIGNAL( textChanged( QString ) ), cb, SLOT( setEditText( QString ) ) );
|
|
524 |
synchronized &= connect( cble, SIGNAL( textChanged( QString ) ), relay, SLOT( storeText( QString ) ) );
|
|
525 |
synchronized &= connect( cble, SIGNAL( editingFinished() ), relay, SLOT( sendStoredText() ) );
|
523 |
526 |
}
|
524 |
527 |
else
|
525 |
528 |
{
|
526 |
529 |
synchronized = connect( relay, SIGNAL( textChanged( QString ) ), myWidget, SLOT( setText( QString ) ) );
|
527 |
|
synchronized &= connect( myWidget, SIGNAL( textChanged( QString ) ), relay, SLOT( changeText( QString ) ) );
|
|
530 |
synchronized &= connect( myWidget, SIGNAL( textChanged( QString ) ), relay, SLOT( storeText( QString ) ) );
|
|
531 |
synchronized &= connect( myWidget, SIGNAL( editingFinished() ), relay, SLOT( sendStoredText() ) );
|
528 |
532 |
}
|
529 |
533 |
|
530 |
534 |
if ( !cb || cb->isEditable() )
|
... | ... | |
888 |
892 |
default:
|
889 |
893 |
{
|
890 |
894 |
QLineEdit *le = qobject_cast<QLineEdit *>( editor );
|
|
895 |
QComboBox *cb = qobject_cast<QComboBox *>( editor );
|
891 |
896 |
QTextEdit *te = qobject_cast<QTextEdit *>( editor );
|
892 |
897 |
QPlainTextEdit *pte = qobject_cast<QPlainTextEdit *>( editor );
|
893 |
|
if ( !le && !te && !pte )
|
|
898 |
if ( !le && ! cb && !te && !pte )
|
894 |
899 |
return false;
|
895 |
900 |
|
896 |
901 |
QString text;
|
... | ... | |
910 |
915 |
|
911 |
916 |
if ( le )
|
912 |
917 |
le->setText( text );
|
|
918 |
if ( cb && cb->isEditable() )
|
|
919 |
cb->setEditText( text );
|
913 |
920 |
if ( te )
|
914 |
921 |
te->setHtml( text );
|
915 |
922 |
if ( pte )
|