summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (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
@@ -54,62 +54,62 @@ OListView::OListView( QWidget *parent, const char *name, WFlags fl )
m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine );
m_fullWidth = true;
connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*)));
}
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
}
const QColor& OListView::alternateBackground() const
{
return m_alternateBackground;
}
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
@@ -76,25 +76,25 @@ void OPopupTitle::setText( const QString &text )
void OPopupTitle::setIcon( const QPixmap &pix )
{
miniicon = pix;
int w = miniicon.width()+fontMetrics().width(titleStr);
int h = QMAX( fontMetrics().height(), miniicon.height() );
setMinimumSize( w+16, h+8 );
}
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())
p.drawPixmap(4, (r.height()-miniicon.height())/2, miniicon);
if (!titleStr.isNull())
{
p.setPen(palette().active().text());
QFont f = p.font();
@@ -540,25 +540,25 @@ void OPopupMenu::ctxMenuHiding()
bool OPopupMenu::eventFilter(QObject* obj, QEvent* event)
{
if (d->m_ctxMenu && obj == this)
{
if (event->type() == QEvent::MouseButtonRelease)
{
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
{
showCtxMenu(mapFromGlobal(QCursor::pos()));
return true;
}
}
return QWidget::eventFilter(obj, event);
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
@@ -130,25 +130,25 @@ void OXYSelector::mousePressEvent( QMouseEvent *e )
void OXYSelector::mouseMoveEvent( QMouseEvent *e )
{
int xVal, yVal;
valuesFromPosition( e->pos().x() - 2, e->pos().y() - 2, xVal, yVal );
setValues( xVal, yVal );
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 );
#else
Q_UNUSED( e )
#endif
}
void OXYSelector::valuesFromPosition( int x, int y, int &xVal, int &yVal ) const
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
@@ -199,40 +199,40 @@ public:
void setValue(int value)
{ QRangeControl::setValue(value); }
/**
* @returns the value.
*/
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
/**
* @return the min value.
*/
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
/**
* @return the max value.
*/
int maxValue() const
{ return QRangeControl::maxValue(); }
signals:
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
@@ -22,25 +22,25 @@
 :     =  ...= . :.=-
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
    --        :-=` this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
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
#include <qvaluelist.h>
template<class T, class Key = int> class OSortableItem : public QPair<Key,T>
{
public:
OSortableItem( Key i, const T& t ) : QPair<Key, T>( i, t ) {}
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
@@ -309,25 +309,25 @@ OCompletionBox * OComboBox::completionBox( bool 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&)),
@@ -343,38 +343,38 @@ void OComboBox::setLineEdit( OLineEdit *edit )
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;
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
@@ -183,25 +183,25 @@ void OEditListBox::typedSomething(const QString& text)
return;
if (!d->m_checkAtEntering)
servNewButton->setEnabled(!text.isEmpty());
else
{
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 );
}
}
}
void OEditListBox::moveItemUp()
{
@@ -258,25 +258,25 @@ void OEditListBox::addItem()
return;
const QString& currentTextLE=m_lineEdit->text();
bool alreadyInList(false);
//if we didn't check for dupes at the inserting we have to do it now
if (!d->m_checkAtEntering)
{
// 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
}
}
if ( servNewButton )
servNewButton->setEnabled(false);
bool block = m_lineEdit->signalsBlocked();
@@ -291,25 +291,25 @@ void OEditListBox::addItem()
block = m_listBox->signalsBlocked();
m_listBox->blockSignals( true );
m_listBox->insertItem(currentTextLE);
m_listBox->blockSignals( block );
emit changed();
emit added( currentTextLE );
}
}
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;
}
void OEditListBox::removeItem()
{
int selected = m_listBox->currentItem();
if ( selected >= 0 )
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
@@ -136,25 +136,25 @@ void OLineEdit::setCompletedText( const QString& text )
void OLineEdit::rotateText( OCompletionBase::KeyBindingType type )
{
OCompletion* comp = compObj();
if ( comp &&
(type == OCompletionBase::PrevCompletionMatch ||
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
}
}
void OLineEdit::makeCompletion( const QString& text )
{
OCompletion *comp = compObj();
if ( !comp )
return; // No completion object...
@@ -262,25 +262,25 @@ void OLineEdit::keyPressEvent( QKeyEvent *e )
OGlobalSettings::Completion mode = completionMode();
bool noModifier = (e->state() == NoButton || e->state()== ShiftButton);
if ( (mode == OGlobalSettings::CompletionAuto ||
mode == OGlobalSettings::CompletionMan) && noModifier )
{
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() )
emit completion( txt );
if ( handleSignals() )
makeCompletion( txt );
e->accept();
}
return;
@@ -427,25 +427,25 @@ void OLineEdit::mousePressEvent( QMouseEvent* e )
void OLineEdit::tripleClickTimeout()
{
possibleTripleClick=false;
}
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
// completion object is present.
if ( compObj() )
{
QPopupMenu *subMenu = new QPopupMenu( popup );
connect( subMenu, SIGNAL( activated(int) ),
this, SLOT( completionMenuActivated(int) ) );