author | ar <ar> | 2005-01-21 19:56:15 (UTC) |
---|---|---|
committer | ar <ar> | 2005-01-21 19:56:15 (UTC) |
commit | cd51d382be50bc021739395309e23760f1619759 (patch) (unidiff) | |
tree | e76155f772df7faea5fcf38667c6da8c916208db /libopie2/qt3 | |
parent | fdc37fbd908472e28735a8f0b01e3e66a43535e0 (diff) | |
download | opie-cd51d382be50bc021739395309e23760f1619759.zip opie-cd51d382be50bc021739395309e23760f1619759.tar.gz opie-cd51d382be50bc021739395309e23760f1619759.tar.bz2 |
- make opie compilable against qte 2.3.10 snapshot
check QT_VERSION against 0x030000 instead of 300
-rw-r--r-- | libopie2/qt3/opieui/oeditlistbox.h | 2 | ||||
-rw-r--r-- | libopie2/qt3/opieui/ojanuswidget.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
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,78 +1,78 @@ | |||
1 | /* This file is part of the KDE libraries | 1 | /* This file is part of the KDE libraries |
2 | Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org> | 2 | Copyright (C) 2000 David Faure <faure@kde.org>, Alexander Neundorf <neundorf@kde.org> |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef OEDITLISTBOX_H | 20 | #ifndef OEDITLISTBOX_H |
21 | #define OEDITLISTBOX_H | 21 | #define OEDITLISTBOX_H |
22 | 22 | ||
23 | #include <qgroupbox.h> | 23 | #include <qgroupbox.h> |
24 | #include <qlistbox.h> | 24 | #include <qlistbox.h> |
25 | 25 | ||
26 | class OLineEdit; | 26 | class OLineEdit; |
27 | class OComboBox; | 27 | class OComboBox; |
28 | class QPushButton; | 28 | class QPushButton; |
29 | 29 | ||
30 | #if QT_VERSION < 300 | 30 | #if QT_VERSION < 0x030000 |
31 | enum StringComparisonMode { | 31 | enum StringComparisonMode { |
32 | CaseSensitive = 0x00001, // 0 0001 | 32 | CaseSensitive = 0x00001, // 0 0001 |
33 | BeginsWith = 0x00002, // 0 0010 | 33 | BeginsWith = 0x00002, // 0 0010 |
34 | EndsWith = 0x00004, // 0 0100 | 34 | EndsWith = 0x00004, // 0 0100 |
35 | Contains = 0x00008, // 0 1000 | 35 | Contains = 0x00008, // 0 1000 |
36 | ExactMatch = 0x00010 // 1 0000 | 36 | ExactMatch = 0x00010 // 1 0000 |
37 | }; | 37 | }; |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | class OEditListBoxPrivate; | 40 | class OEditListBoxPrivate; |
41 | /** | 41 | /** |
42 | * An editable listbox | 42 | * An editable listbox |
43 | * | 43 | * |
44 | * This class provides a editable listbox ;-), this means | 44 | * This class provides a editable listbox ;-), this means |
45 | * a listbox which is accompanied by a line edit to enter new | 45 | * a listbox which is accompanied by a line edit to enter new |
46 | * items into the listbox and pushbuttons to add and remove | 46 | * items into the listbox and pushbuttons to add and remove |
47 | * items from the listbox and two buttons to move items up and down. | 47 | * items from the listbox and two buttons to move items up and down. |
48 | */ | 48 | */ |
49 | class OEditListBox : public QGroupBox | 49 | class OEditListBox : public QGroupBox |
50 | { | 50 | { |
51 | Q_OBJECT | 51 | Q_OBJECT |
52 | 52 | ||
53 | public: | 53 | public: |
54 | /// @since 3.1 | 54 | /// @since 3.1 |
55 | class CustomEditor | 55 | class CustomEditor |
56 | { | 56 | { |
57 | public: | 57 | public: |
58 | CustomEditor() | 58 | CustomEditor() |
59 | : m_representationWidget( 0L ), | 59 | : m_representationWidget( 0L ), |
60 | m_lineEdit( 0L ) {} | 60 | m_lineEdit( 0L ) {} |
61 | CustomEditor( QWidget *repWidget, OLineEdit *edit ) | 61 | CustomEditor( QWidget *repWidget, OLineEdit *edit ) |
62 | : m_representationWidget( repWidget ), | 62 | : m_representationWidget( repWidget ), |
63 | m_lineEdit( edit ) {} | 63 | m_lineEdit( edit ) {} |
64 | CustomEditor( OComboBox *combo ); | 64 | CustomEditor( OComboBox *combo ); |
65 | 65 | ||
66 | void setRepresentationWidget( QWidget *repWidget ) { | 66 | void setRepresentationWidget( QWidget *repWidget ) { |
67 | m_representationWidget = repWidget; | 67 | m_representationWidget = repWidget; |
68 | } | 68 | } |
69 | void setLineEdit( OLineEdit *edit ) { | 69 | void setLineEdit( OLineEdit *edit ) { |
70 | m_lineEdit = edit; | 70 | m_lineEdit = edit; |
71 | } | 71 | } |
72 | 72 | ||
73 | virtual QWidget *representationWidget() const { | 73 | virtual QWidget *representationWidget() const { |
74 | return m_representationWidget; | 74 | return m_representationWidget; |
75 | } | 75 | } |
76 | virtual OLineEdit *lineEdit() const { | 76 | virtual OLineEdit *lineEdit() const { |
77 | return m_lineEdit; | 77 | return m_lineEdit; |
78 | } | 78 | } |
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 | |||
@@ -727,97 +727,97 @@ void OJanusWidget::slotFontChanged() | |||
727 | mIconList->invalidateWidth(); | 727 | mIconList->invalidateWidth(); |
728 | } | 728 | } |
729 | } | 729 | } |
730 | 730 | ||
731 | // makes the treelist behave like the list of kcontrol | 731 | // makes the treelist behave like the list of kcontrol |
732 | void OJanusWidget::slotItemClicked(QListViewItem *it) | 732 | void OJanusWidget::slotItemClicked(QListViewItem *it) |
733 | { | 733 | { |
734 | if(it && (it->childCount()>0)) | 734 | if(it && (it->childCount()>0)) |
735 | it->setOpen(!it->isOpen()); | 735 | it->setOpen(!it->isOpen()); |
736 | } | 736 | } |
737 | 737 | ||
738 | void OJanusWidget::setFocus() | 738 | void OJanusWidget::setFocus() |
739 | { | 739 | { |
740 | if( mValid == false ) { return; } | 740 | if( mValid == false ) { return; } |
741 | if( mFace == TreeList ) | 741 | if( mFace == TreeList ) |
742 | { | 742 | { |
743 | mTreeList->setFocus(); | 743 | mTreeList->setFocus(); |
744 | } | 744 | } |
745 | if( mFace == IconList ) | 745 | if( mFace == IconList ) |
746 | { | 746 | { |
747 | mIconList->setFocus(); | 747 | mIconList->setFocus(); |
748 | } | 748 | } |
749 | else if( mFace == Tabbed ) | 749 | else if( mFace == Tabbed ) |
750 | { | 750 | { |
751 | mTabControl->setFocus(); | 751 | mTabControl->setFocus(); |
752 | } | 752 | } |
753 | else if( mFace == Swallow ) | 753 | else if( mFace == Swallow ) |
754 | { | 754 | { |
755 | mSwallowPage->setFocus(); | 755 | mSwallowPage->setFocus(); |
756 | } | 756 | } |
757 | else if( mFace == Plain ) | 757 | else if( mFace == Plain ) |
758 | { | 758 | { |
759 | mPlainPage->setFocus(); | 759 | mPlainPage->setFocus(); |
760 | } | 760 | } |
761 | } | 761 | } |
762 | 762 | ||
763 | 763 | ||
764 | QSize OJanusWidget::minimumSizeHint() const | 764 | QSize OJanusWidget::minimumSizeHint() const |
765 | { | 765 | { |
766 | if( mFace == TreeList || mFace == IconList ) | 766 | if( mFace == TreeList || mFace == IconList ) |
767 | { | 767 | { |
768 | QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); | 768 | QSize s1( ODialog::spacingHint(), ODialog::spacingHint()*2 ); |
769 | QSize s2(0,0); | 769 | QSize s2(0,0); |
770 | QSize s3(0,0); | 770 | QSize s3(0,0); |
771 | QSize s4( mPageStack->sizeHint() ); | 771 | QSize s4( mPageStack->sizeHint() ); |
772 | 772 | ||
773 | if( mFace == TreeList ) | 773 | if( mFace == TreeList ) |
774 | { | 774 | { |
775 | #if QT_VERSION < 300 | 775 | #if QT_VERSION < 0x030000 |
776 | s1.rwidth() += style().splitterWidth(); | 776 | s1.rwidth() += style().splitterWidth(); |
777 | #else | 777 | #else |
778 | s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); | 778 | s1.rwidth() += style().pixelMetric( QStyle::PM_SplitterWidth ); |
779 | #endif | 779 | #endif |
780 | s2 = mTreeList->minimumSize(); | 780 | s2 = mTreeList->minimumSize(); |
781 | } | 781 | } |
782 | else | 782 | else |
783 | { | 783 | { |
784 | mIconList->updateMinimumHeight(); | 784 | mIconList->updateMinimumHeight(); |
785 | mIconList->updateWidth(); | 785 | mIconList->updateWidth(); |
786 | s2 = mIconList->minimumSize(); | 786 | s2 = mIconList->minimumSize(); |
787 | } | 787 | } |
788 | 788 | ||
789 | if( mTitleLabel->isVisible() == true ) | 789 | if( mTitleLabel->isVisible() == true ) |
790 | { | 790 | { |
791 | s3 += mTitleLabel->sizeHint(); | 791 | s3 += mTitleLabel->sizeHint(); |
792 | s3.rheight() += mTitleSep->minimumSize().height(); | 792 | s3.rheight() += mTitleSep->minimumSize().height(); |
793 | } | 793 | } |
794 | 794 | ||
795 | // | 795 | // |
796 | // Select the tallest item. It has only effect in IconList mode | 796 | // Select the tallest item. It has only effect in IconList mode |
797 | // | 797 | // |
798 | int h1 = s1.rheight() + s3.rheight() + s4.height(); | 798 | int h1 = s1.rheight() + s3.rheight() + s4.height(); |
799 | int h2 = QMAX( h1, s2.rheight() ); | 799 | int h2 = QMAX( h1, s2.rheight() ); |
800 | 800 | ||
801 | return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); | 801 | return( QSize( s1.width()+s2.width()+QMAX(s3.width(),s4.width()), h2 ) ); |
802 | } | 802 | } |
803 | else if( mFace == Tabbed ) | 803 | else if( mFace == Tabbed ) |
804 | { | 804 | { |
805 | return( mTabControl->sizeHint() ); | 805 | return( mTabControl->sizeHint() ); |
806 | } | 806 | } |
807 | else if( mFace == Swallow ) | 807 | else if( mFace == Swallow ) |
808 | { | 808 | { |
809 | return( mSwallowPage->minimumSize() ); | 809 | return( mSwallowPage->minimumSize() ); |
810 | } | 810 | } |
811 | else if( mFace == Plain ) | 811 | else if( mFace == Plain ) |
812 | { | 812 | { |
813 | return( mPlainPage->sizeHint() ); | 813 | return( mPlainPage->sizeHint() ); |
814 | } | 814 | } |
815 | else | 815 | else |
816 | { | 816 | { |
817 | return( QSize( 100, 100 ) ); // Should never happen though. | 817 | return( QSize( 100, 100 ) ); // Should never happen though. |
818 | } | 818 | } |
819 | 819 | ||
820 | } | 820 | } |
821 | 821 | ||
822 | 822 | ||
823 | QSize OJanusWidget::sizeHint() const | 823 | QSize OJanusWidget::sizeHint() const |