summaryrefslogtreecommitdiff
path: root/libopie2/qt3/opieui/ocombobox.cpp
authorar <ar>2005-01-21 20:19:00 (UTC)
committer ar <ar>2005-01-21 20:19:00 (UTC)
commit55eccecc08f839878e5743d6e6be25af386b5a3f (patch) (side-by-side diff)
treefd663ded2a2c097ce53bac6c021ca652ef5b5508 /libopie2/qt3/opieui/ocombobox.cpp
parentcd51d382be50bc021739395309e23760f1619759 (diff)
downloadopie-55eccecc08f839878e5743d6e6be25af386b5a3f.zip
opie-55eccecc08f839878e5743d6e6be25af386b5a3f.tar.gz
opie-55eccecc08f839878e5743d6e6be25af386b5a3f.tar.bz2
- make opie compilable against qte 2.3.10 snapshot
change QT_VERSION > 290 into QT_VERSION <= 0x030000
Diffstat (limited to 'libopie2/qt3/opieui/ocombobox.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/qt3/opieui/ocombobox.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/qt3/opieui/ocombobox.cpp b/libopie2/qt3/opieui/ocombobox.cpp
index bd330e0..130112c 100644
--- a/libopie2/qt3/opieui/ocombobox.cpp
+++ b/libopie2/qt3/opieui/ocombobox.cpp
@@ -273,144 +273,144 @@ void OComboBox::setEditURL( const OURL& url )
QComboBox::setEditText( url.prettyURL() );
}
void OComboBox::insertURL( const OURL& url, int index )
{
QComboBox::insertItem( url.prettyURL(), index );
}
void OComboBox::insertURL( const QPixmap& pixmap, const OURL& url, int index )
{
QComboBox::insertItem( pixmap, url.prettyURL(), index );
}
void OComboBox::changeURL( const OURL& url, int index )
{
QComboBox::changeItem( url.prettyURL(), index );
}
void OComboBox::changeURL( const QPixmap& pixmap, const OURL& url, int index )
{
QComboBox::changeItem( pixmap, url.prettyURL(), index );
}
*/
void OComboBox::setCompletedItems( const QStringList& items )
{
if ( d->olineEdit )
d->olineEdit->setCompletedItems( items );
}
OCompletionBox * OComboBox::completionBox( bool create )
{
if ( d->olineEdit )
return d->olineEdit->completionBox( create );
return 0;
}
// QWidget::create() turns off mouse-Tracking which would break auto-hiding
void OComboBox::create( WId id, bool initializeWindow, bool destroyOldWindow )
{
QComboBox::create( id, initializeWindow, destroyOldWindow );
//OCursor::setAutoHideCursor( lineEdit(), true, true );
}
void OComboBox::setLineEdit( OLineEdit *edit )
{
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
QComboBox::setLineEdit( edit );
if ( !edit->inherits( "OLineEdit" ) )
d->olineEdit = 0;
else
d->olineEdit = static_cast<OLineEdit*>( edit );
setDelegate( d->olineEdit );
// forward some signals. We only emit returnPressed() ourselves.
if ( d->olineEdit ) {
connect( d->olineEdit, SIGNAL( completion(const QString&)),
SIGNAL( completion(const QString&)) );
connect( d->olineEdit, SIGNAL( substringCompletion(const QString&)),
SIGNAL( substringCompletion(const QString&)) );
connect( d->olineEdit,
SIGNAL( textRotation(OCompletionBase::KeyBindingType)),
SIGNAL( textRotation(OCompletionBase::KeyBindingType)) );
connect( d->olineEdit,
SIGNAL( completionModeChanged(OGlobalSettings::Completion)),
SIGNAL( completionModeChanged(OGlobalSettings::Completion)));
connect( d->olineEdit,
SIGNAL( aboutToShowContextMenu(QPopupMenu*)),
SIGNAL( aboutToShowContextMenu(QPopupMenu*)) );
}
#else
#warning OComboBox is not fully functional with Qt2
#endif
}
// Temporary functions until QT3 appears. - Seth Chaiklin 20 may 2001
void OComboBox::deleteWordForward()
{
lineEdit()->cursorWordForward(TRUE);
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if ( lineEdit()->hasSelectedText() )
#else
if ( lineEdit()->hasMarkedText() )
#endif
{
lineEdit()->del();
}
}
void OComboBox::deleteWordBack()
{
lineEdit()->cursorWordBackward(TRUE);
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if ( lineEdit()->hasSelectedText() )
#else
if ( lineEdit()->hasMarkedText() )
#endif
{
lineEdit()->del();
}
}
void OComboBox::setCurrentItem( const QString& item, bool insert, int index )
{
int sel = -1;
for (int i = 0; i < count(); ++i)
if (text(i) == item)
{
sel = i;
break;
}
if (sel == -1 && insert)
{
insertItem(item, index);
if (index >= 0)
sel = index;
else
sel = count() - 1;
}
setCurrentItem(sel);
}
void OComboBox::setCurrentItem(int index)
{
QComboBox::setCurrentItem(index);
}
/*======================================================================================
* OHistoryCombo
*======================================================================================*/
// we are always read-write
OHistoryCombo::OHistoryCombo( QWidget *parent, const char *name )
: OComboBox( true, parent, name )
{
init( true ); // using completion
}
// we are always read-write
OHistoryCombo::OHistoryCombo( bool useCompletion,