diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-08 12:31:36 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-11-08 12:31:36 -0600 |
commit | d796c9dd933ab96ec83b9a634feedd5d32e1ba3f (patch) | |
tree | 6e3dcca4f77e20ec8966c666aac7c35bd4704053 /tools/designer/examples/multiclip/multiclip.ui.h | |
download | tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.tar.gz tqt3-d796c9dd933ab96ec83b9a634feedd5d32e1ba3f.zip |
Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731
Diffstat (limited to 'tools/designer/examples/multiclip/multiclip.ui.h')
-rw-r--r-- | tools/designer/examples/multiclip/multiclip.ui.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/tools/designer/examples/multiclip/multiclip.ui.h b/tools/designer/examples/multiclip/multiclip.ui.h new file mode 100644 index 000000000..a2b0b0cf7 --- /dev/null +++ b/tools/designer/examples/multiclip/multiclip.ui.h @@ -0,0 +1,70 @@ +void MulticlipForm::addClipping() +{ + TQString text = currentLineEdit->text(); + if ( ! text.isEmpty() ) { + lengthLCDNumber->display( (int)text.length() ); + int i = 0; + for ( ; i < (int)clippingsListBox->count(); i++ ) { + if ( clippingsListBox->text( i ) == text ) { + i = -1; // Do not add duplicates + break; + } + } + if ( i != -1 ) + clippingsListBox->insertItem( text, 0 ); + } +} + +void MulticlipForm::dataChanged() +{ + TQString text; + text = cb->text(); + clippingChanged( text ); + if ( autoCheckBox->isChecked() ) + addClipping(); +} + +void MulticlipForm::deleteClipping() +{ + clippingChanged( "" ); + clippingsListBox->removeItem( clippingsListBox->currentItem() ); +} + +void MulticlipForm::init() +{ + lengthLCDNumber->setBackgroundColor( darkBlue ); + currentLineEdit->setFocus(); + + cb = qApp->clipboard(); + connect( cb, SIGNAL( dataChanged() ), SLOT( dataChanged() ) ); + if ( cb->supportsSelection() ) + connect( cb, SIGNAL( selectionChanged() ), SLOT( selectionChanged() ) ); + + dataChanged(); +} + +void MulticlipForm::selectionChanged() +{ + cb->setSelectionMode( TRUE ); + dataChanged(); + cb->setSelectionMode( FALSE ); +} + +void MulticlipForm::copyPrevious() +{ + if ( clippingsListBox->currentItem() != -1 ) { + cb->setText( clippingsListBox->currentText() ); + if ( cb->supportsSelection() ) { + cb->setSelectionMode( TRUE ); + cb->setText( clippingsListBox->currentText() ); + cb->setSelectionMode( FALSE ); + } + } +} + +void MulticlipForm::clippingChanged( const TQString & clipping ) +{ + currentLineEdit->setText( clipping ); + lengthLCDNumber->display( (int)clipping.length() ); +} + |