-rw-r--r-- | libopie2/opieui/oseparator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opieui/oseparator.cpp b/libopie2/opieui/oseparator.cpp index bbc4381..177368b 100644 --- a/libopie2/opieui/oseparator.cpp +++ b/libopie2/opieui/oseparator.cpp @@ -47,83 +47,83 @@ OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) setOrientation( HLine ); } OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) : QFrame(parent, name, f) { setLineWidth(1); setMidLineWidth(0); setOrientation( orientation ); } void OSeparator::setOrientation(int orientation) { switch(orientation) { case Vertical: case VLine: setFrameStyle( QFrame::VLine | QFrame::Sunken ); setMinimumSize(2, 0); break; default: owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; case Horizontal: case HLine: setFrameStyle( QFrame::HLine | QFrame::Sunken ); setMinimumSize(0, 2); break; } } int OSeparator::orientation() const { if ( frameStyle() & VLine ) return VLine; if ( frameStyle() & HLine ) return HLine; return 0; } void OSeparator::drawFrame(QPainter *p) { QPoint p1, p2; QRect r = frameRect(); const QColorGroup & g = colorGroup(); if ( frameStyle() & HLine ) { p1 = QPoint( r.x(), r.height()/2 ); p2 = QPoint( r.x()+r.width(), p1.y() ); } else { p1 = QPoint( r.x()+r.width()/2, 0 ); p2 = QPoint( p1.x(), r.height() ); } -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); #else QStyleOption opt( lineWidth(), midLineWidth() ); style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); #endif } QSize OSeparator::sizeHint() const { if ( frameStyle() & VLine ) return QSize(2, 0); if ( frameStyle() & HLine ) return QSize(0, 2); return QSize(-1, -1); } |