summaryrefslogtreecommitdiff
path: root/libopie2
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
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') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/olistview.cpp8
-rw-r--r--libopie2/opieui/opopupmenu.cpp4
-rw-r--r--libopie2/opieui/oselector.cpp2
-rw-r--r--libopie2/opieui/oselector.h4
-rw-r--r--libopie2/qt3/opiecore/osortablevaluelist.h2
-rw-r--r--libopie2/qt3/opieui/ocombobox.cpp6
-rw-r--r--libopie2/qt3/opieui/oeditlistbox.cpp6
-rw-r--r--libopie2/qt3/opieui/olineedit.cpp6
8 files changed, 19 insertions, 19 deletions
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp
index 67b4b83..4386e0e 100644
--- a/libopie2/opieui/olistview.cpp
+++ b/libopie2/opieui/olistview.cpp
@@ -60,50 +60,50 @@ OListView::~OListView()
{
}
void OListView::setFullWidth( bool fullWidth )
{
m_fullWidth = fullWidth;
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
header()->setStretchEnabled( fullWidth, columns()-1 );
#endif
}
bool OListView::fullWidth() const
{
return m_fullWidth;
}
int OListView::addColumn( const QString& label, int width )
{
int result = QListView::addColumn( label, width );
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if (m_fullWidth) {
header()->setStretchEnabled( false, columns()-2 );
header()->setStretchEnabled( true, columns()-1 );
}
#endif
return result;
}
int OListView::addColumn( const QIconSet& iconset, const QString& label, int width )
{
int result = QListView::addColumn( iconset, label, width );
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if (m_fullWidth) {
header()->setStretchEnabled( false, columns()-2 );
header()->setStretchEnabled( true, columns()-1 );
}
#endif
return result;
}
void OListView::removeColumn( int index )
{
QListView::removeColumn(index);
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if ( m_fullWidth && index == columns() )
{
header()->setStretchEnabled( true, columns()-1 );
}
#endif
}
diff --git a/libopie2/opieui/opopupmenu.cpp b/libopie2/opieui/opopupmenu.cpp
index 50c613f..5ce048e 100644
--- a/libopie2/opieui/opopupmenu.cpp
+++ b/libopie2/opieui/opopupmenu.cpp
@@ -82,13 +82,13 @@ void OPopupTitle::setIcon( const QPixmap &pix )
}
void OPopupTitle::paintEvent(QPaintEvent *)
{
QRect r(rect());
QPainter p(this);
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
qApp->style().drawPrimitive(QStyle::PE_HeaderSection, &p, r, palette().active());
#else
#warning OPopupMenu is not fully functional on Qt2
#endif
if (!miniicon.isNull())
@@ -546,13 +546,13 @@ bool OPopupMenu::eventFilter(QObject* obj, QEvent* event)
{
if (d->m_ctxMenu->isVisible())
{
return true;
}
}
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
else if (event->type() == QEvent::ContextMenu)
#else
else if ( (event->type() == QEvent::MouseButtonPress) &&
( (QMouseEvent*) event )->button() == QMouseEvent::RightButton )
#endif
{
diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp
index 05543c5..936dfe6 100644
--- a/libopie2/opieui/oselector.cpp
+++ b/libopie2/opieui/oselector.cpp
@@ -136,13 +136,13 @@ void OXYSelector::mouseMoveEvent( QMouseEvent *e )
emit valueChanged( xPos, yPos );
}
void OXYSelector::wheelEvent( QWheelEvent *e )
{
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if ( e->orientation() == Qt::Horizontal )
setValues( xValue() + e->delta()/120, yValue() );
else
setValues( xValue(), yValue() + e->delta()/120 );
emit valueChanged( xPos, yPos );
diff --git a/libopie2/opieui/oselector.h b/libopie2/opieui/oselector.h
index fe75a46..3dbdb38 100644
--- a/libopie2/opieui/oselector.h
+++ b/libopie2/opieui/oselector.h
@@ -205,13 +205,13 @@ public:
int value() const
{ return QRangeControl::value(); }
/**
* Sets the min value.
*/
- #if ( QT_VERSION > 290 )
+ #if ( QT_VERSION >= 0x030000 )
void setMinValue(int value) { QRangeControl::setMinValue(value); }
#else
void setMinValue(int value) { QRangeControl::setRange(value,QRangeControl::maxValue()); }
#endif
/**
@@ -220,13 +220,13 @@ public:
int minValue() const
{ return QRangeControl::minValue(); }
/**
* Sets the max value.
*/
- #if ( QT_VERSION > 290 )
+ #if ( QT_VERSION >= 0x030000 )
void setMaxValue(int value) { QRangeControl::setMaxValue(value); }
#else
void setMaxValue(int value) { QRangeControl::setRange(QRangeControl::minValue(),value); }
#endif
/**
diff --git a/libopie2/qt3/opiecore/osortablevaluelist.h b/libopie2/qt3/opiecore/osortablevaluelist.h
index f66cf25..a3f75b4 100644
--- a/libopie2/qt3/opiecore/osortablevaluelist.h
+++ b/libopie2/qt3/opiecore/osortablevaluelist.h
@@ -28,13 +28,13 @@
Boston, MA 02111-1307, USA.
*/
#ifndef OSORTABLEVALUELIST_H
#define OSORTABLEVALUELIST_H
-#if QT_VERSION > 290
+#if QT_VERSION >= 0x030000
#include <qtl.h>
#include <qpair.h>
#else
#include <opie2/otl.h>
#include <opie2/opair.h>
#endif
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
@@ -315,13 +315,13 @@ 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 );
@@ -349,26 +349,26 @@ void OComboBox::setLineEdit( OLineEdit *edit )
}
// 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();
diff --git a/libopie2/qt3/opieui/oeditlistbox.cpp b/libopie2/qt3/opieui/oeditlistbox.cpp
index 0e95274..dcc697d 100644
--- a/libopie2/qt3/opieui/oeditlistbox.cpp
+++ b/libopie2/qt3/opieui/oeditlistbox.cpp
@@ -189,13 +189,13 @@ void OEditListBox::typedSomething(const QString& text)
if (text.isEmpty())
{
servNewButton->setEnabled(false);
}
else
{
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
StringComparisonMode mode = (StringComparisonMode) (ExactMatch | CaseSensitive );
bool enable = (m_listBox->findItem( text, mode ) == 0L);
#else
bool enable = (m_listBox->findItem( text ) == 0L);
#endif
servNewButton->setEnabled( enable );
@@ -264,13 +264,13 @@ void OEditListBox::addItem()
{
// first check current item instead of dumb iterating the entire list
if ( m_listBox->currentText() == currentTextLE )
alreadyInList = true;
else
{
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
StringComparisonMode mode = (StringComparisonMode) (ExactMatch | CaseSensitive );
alreadyInList =(m_listBox->findItem(currentTextLE, mode) != 0);
#else
alreadyInList =(m_listBox->findItem(currentTextLE) != 0);
#endif
}
@@ -297,13 +297,13 @@ void OEditListBox::addItem()
}
}
int OEditListBox::currentItem() const
{
int nr = m_listBox->currentItem();
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if(nr >= 0 && !m_listBox->item(nr)->isSelected()) return -1;
#else
if(nr >= 0 && !m_listBox->isSelected(m_listBox->item(nr))) return -1;
#endif
return nr;
}
diff --git a/libopie2/qt3/opieui/olineedit.cpp b/libopie2/qt3/opieui/olineedit.cpp
index 6f66fc7..b150987 100644
--- a/libopie2/qt3/opieui/olineedit.cpp
+++ b/libopie2/qt3/opieui/olineedit.cpp
@@ -142,13 +142,13 @@ void OLineEdit::rotateText( OCompletionBase::KeyBindingType type )
type == OCompletionBase::NextCompletionMatch ) )
{
QString input = (type == OCompletionBase::PrevCompletionMatch) ? comp->previousMatch() : comp->nextMatch();
// Skip rotation if previous/next match is null or the same text
if ( input.isNull() || input == displayText() )
return;
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
setCompletedText( input, hasSelectedText() );
#else
setCompletedText( input, hasMarkedText() );
#endif
}
}
@@ -268,13 +268,13 @@ void OLineEdit::keyPressEvent( QKeyEvent *e )
QString keycode = e->text();
if ( !keycode.isNull() && keycode.unicode()->isPrint() )
{
QLineEdit::keyPressEvent ( e );
QString txt = text();
int len = txt.length();
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
if ( !hasSelectedText() && len && cursorPosition() == len )
#else
if ( !hasMarkedText() && len && cursorPosition() == len )
#endif
{
if ( emitSignals() )
@@ -433,13 +433,13 @@ void OLineEdit::tripleClickTimeout()
QPopupMenu *OLineEdit::createPopupMenu()
{
// Return if popup menu is not enabled !!
if ( !m_bEnableMenu )
return 0;
- #if QT_VERSION > 290
+ #if QT_VERSION >= 0x030000
QPopupMenu *popup = QLineEdit::createPopupMenu();
#else
QPopupMenu *popup = new QPopupMenu();
#warning OLineEdit is not fully functional on Qt2
#endif