-rw-r--r-- | libopie2/opieui/oseparator.cpp | 2 | ||||
-rw-r--r-- | libopie2/qt3/opieui/oeditlistbox.h | 2 | ||||
-rw-r--r-- | libopie2/qt3/opieui/ojanuswidget.cpp | 2 |
3 files changed, 3 insertions, 3 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); } diff --git a/libopie2/qt3/opieui/oeditlistbox.h b/libopie2/qt3/opieui/oeditlistbox.h index 63fab11..c9c207d 100644 --- a/libopie2/qt3/opieui/oeditlistbox.h +++ b/libopie2/qt3/opieui/oeditlistbox.h @@ -1,94 +1,94 @@ /* This file is part of the KDE libraries Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. 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 OEDITLISTBOX_H #define OEDITLISTBOX_H #include <qgroupbox.h> #include <qlistbox.h> class OLineEdit; class OComboBox; class QPushButton; -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 enum StringComparisonMode { CaseSensitive = 0x00001, // 0 0001 BeginsWith = 0x00002, // 0 0010 EndsWith = 0x00004, // 0 0100 Contains = 0x00008, // 0 1000 ExactMatch = 0x00010 // 1 0000 }; #endif class OEditListBoxPrivate; /** * An editable listbox * * This class provides a editable listbox ;-), this means * a listbox which is accompanied by a line edit to enter new * items into the listbox and pushbuttons to add and remove * items from the listbox and two buttons to move items up and down. */ class OEditListBox : public QGroupBox { Q_OBJECT public: /// @since 3.1 class CustomEditor { public: CustomEditor() : m_representationWidget( 0L ), m_lineEdit( 0L ) {} CustomEditor( QWidget *repWidget, OLineEdit *edit ) : m_representationWidget( repWidget ), m_lineEdit( edit ) {} CustomEditor( OComboBox *combo ); void setRepresentationWidget( QWidget *repWidget ) { m_representationWidget = repWidget; } void setLineEdit( OLineEdit *edit ) { m_lineEdit = edit; } virtual QWidget *representationWidget() const { return m_representationWidget; } virtual OLineEdit *lineEdit() const { return m_lineEdit; } protected: QWidget *m_representationWidget; OLineEdit *m_lineEdit; }; public: /** * Enumeration of the buttons, the listbox offers. Specify them in the * constructor in the buttons parameter. */ enum Button { Add = 1, Remove = 2, UpDown = 4, All = Add|Remove|UpDown }; /** * Create an editable listbox. diff --git a/libopie2/qt3/opieui/ojanuswidget.cpp b/libopie2/qt3/opieui/ojanuswidget.cpp index 063e393..8bdbc03 100644 --- a/libopie2/qt3/opieui/ojanuswidget.cpp +++ b/libopie2/qt3/opieui/ojanuswidget.cpp @@ -711,129 +711,129 @@ void OJanusWidget::slotFontChanged() if ( mTitleLabel != 0 ) { mTitleLabel->setFont( KGlobalSettings::generalFont() ); QFont titleFont( mTitleLabel->font() ); titleFont.setBold( true ); mTitleLabel->setFont( titleFont ); } #endif if( mFace == IconList ) { QFont listFont( mIconList->font() ); listFont.setBold( true ); mIconList->setFont( listFont ); mIconList->invalidateHeight(); mIconList->invalidateWidth(); } } // makes the treelist behave like the list of kcontrol void OJanusWidget::slotItemClicked(QListViewItem *it) { if(it && (it->childCount()>0)) it->setOpen(!it->isOpen()); } void OJanusWidget::setFocus() { if( mValid == false ) { return; } if( mFace == TreeList ) { mTreeList->setFocus(); } if( mFace == IconList ) { mIconList->setFocus(); } else if( mFace == Tabbed ) { mTabControl->setFocus(); } else if( mFace == Swallow ) { mSwallowPage->setFocus(); } else if( mFace == Plain ) { mPlainPage->setFocus(); } } QSize OJanusWidget::minimumSizeHint() const { if( mFace == TreeList || mFace == IconList ) { QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); QSize s2(0,0); QSize s3(0,0); QSize s4( mPageStack->sizeHint() ); if( mFace == TreeList ) { -#if QT_VERSION < 300 +#if QT_VERSION < 0x030000 s1.rwidth() += style().splitterWidth(); #else s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); #endif s2 = mTreeList->minimumSize(); } else { mIconList->updateMinimumHeight(); mIconList->updateWidth(); s2 = mIconList->minimumSize(); } if( mTitleLabel->isVisible() == true ) { s3 += mTitleLabel->sizeHint(); s3.rheight() += mTitleSep->minimumSize().height(); } // // Select the tallest item. It has only effect in IconList mode // int h1 = s1.rheight() + s3.rheight() + s4.height(); int h2 = QMAX( h1, s2.rheight() ); return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); } else if( mFace == Tabbed ) { return( mTabControl->sizeHint() ); } else if( mFace == Swallow ) { return( mSwallowPage->minimumSize() ); } else if( mFace == Plain ) { return( mPlainPage->sizeHint() ); } else { return( QSize( 100, 100 ) ); // Should never happen though. } } QSize OJanusWidget::sizeHint() const { return( minimumSizeHint() ); } void OJanusWidget::setTreeListAutoResize( bool state ) { if( mFace == TreeList ) { mTreeListResizeMode = state == false ? QSplitter::KeepSize : QSplitter::Stretch; QSplitter *splitter = (QSplitter*)(mTreeList->parentWidget()); splitter->setResizeMode( mTreeList, mTreeListResizeMode ); } } |