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/opieui | |
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/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 | |||
@@ -1,129 +1,129 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | 3 | Copyright (C) 2003 Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> |
4 | Copyright (C) 1997 Michael Roth <mroth@wirlweb.de> | 4 | Copyright (C) 1997 Michael Roth <mroth@wirlweb.de> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | 33 | ||
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | #include <opie2/oseparator.h> | 35 | #include <opie2/oseparator.h> |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | 38 | ||
39 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
40 | using namespace Opie::Ui; | 40 | using namespace Opie::Ui; |
41 | 41 | ||
42 | OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) | 42 | OSeparator::OSeparator(QWidget* parent, const char* name, WFlags f) |
43 | : QFrame(parent, name, f) | 43 | : QFrame(parent, name, f) |
44 | { | 44 | { |
45 | setLineWidth(1); | 45 | setLineWidth(1); |
46 | setMidLineWidth(0); | 46 | setMidLineWidth(0); |
47 | setOrientation( HLine ); | 47 | setOrientation( HLine ); |
48 | } | 48 | } |
49 | 49 | ||
50 | 50 | ||
51 | 51 | ||
52 | OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) | 52 | OSeparator::OSeparator(int orientation, QWidget* parent, const char* name, WFlags f) |
53 | : QFrame(parent, name, f) | 53 | : QFrame(parent, name, f) |
54 | { | 54 | { |
55 | setLineWidth(1); | 55 | setLineWidth(1); |
56 | setMidLineWidth(0); | 56 | setMidLineWidth(0); |
57 | setOrientation( orientation ); | 57 | setOrientation( orientation ); |
58 | } | 58 | } |
59 | 59 | ||
60 | 60 | ||
61 | 61 | ||
62 | void OSeparator::setOrientation(int orientation) | 62 | void OSeparator::setOrientation(int orientation) |
63 | { | 63 | { |
64 | switch(orientation) | 64 | switch(orientation) |
65 | { | 65 | { |
66 | case Vertical: | 66 | case Vertical: |
67 | case VLine: | 67 | case VLine: |
68 | setFrameStyle( QFrame::VLine | QFrame::Sunken ); | 68 | setFrameStyle( QFrame::VLine | QFrame::Sunken ); |
69 | setMinimumSize(2, 0); | 69 | setMinimumSize(2, 0); |
70 | break; | 70 | break; |
71 | 71 | ||
72 | default: | 72 | default: |
73 | owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; | 73 | owarn << "OSeparator::setOrientation(): invalid orientation, using default orientation HLine" << oendl; |
74 | 74 | ||
75 | case Horizontal: | 75 | case Horizontal: |
76 | case HLine: | 76 | case HLine: |
77 | setFrameStyle( QFrame::HLine | QFrame::Sunken ); | 77 | setFrameStyle( QFrame::HLine | QFrame::Sunken ); |
78 | setMinimumSize(0, 2); | 78 | setMinimumSize(0, 2); |
79 | break; | 79 | break; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | 83 | ||
84 | 84 | ||
85 | int OSeparator::orientation() const | 85 | int OSeparator::orientation() const |
86 | { | 86 | { |
87 | if ( frameStyle() & VLine ) | 87 | if ( frameStyle() & VLine ) |
88 | return VLine; | 88 | return VLine; |
89 | 89 | ||
90 | if ( frameStyle() & HLine ) | 90 | if ( frameStyle() & HLine ) |
91 | return HLine; | 91 | return HLine; |
92 | 92 | ||
93 | return 0; | 93 | return 0; |
94 | } | 94 | } |
95 | 95 | ||
96 | void OSeparator::drawFrame(QPainter *p) | 96 | void OSeparator::drawFrame(QPainter *p) |
97 | { | 97 | { |
98 | QPointp1, p2; | 98 | QPointp1, p2; |
99 | QRectr = frameRect(); | 99 | QRectr = frameRect(); |
100 | const QColorGroup & g = colorGroup(); | 100 | const QColorGroup & g = colorGroup(); |
101 | 101 | ||
102 | if ( frameStyle() & HLine ) { | 102 | if ( frameStyle() & HLine ) { |
103 | p1 = QPoint( r.x(), r.height()/2 ); | 103 | p1 = QPoint( r.x(), r.height()/2 ); |
104 | p2 = QPoint( r.x()+r.width(), p1.y() ); | 104 | p2 = QPoint( r.x()+r.width(), p1.y() ); |
105 | } | 105 | } |
106 | else { | 106 | else { |
107 | p1 = QPoint( r.x()+r.width()/2, 0 ); | 107 | p1 = QPoint( r.x()+r.width()/2, 0 ); |
108 | p2 = QPoint( p1.x(), r.height() ); | 108 | p2 = QPoint( p1.x(), r.height() ); |
109 | } | 109 | } |
110 | 110 | ||
111 | #if QT_VERSION < 300 | 111 | #if QT_VERSION < 0x030000 |
112 | style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); | 112 | style().drawSeparator( p, p1.x(), p1.y(), p2.x(), p2.y(), g, true, 1, midLineWidth() ); |
113 | #else | 113 | #else |
114 | QStyleOption opt( lineWidth(), midLineWidth() ); | 114 | QStyleOption opt( lineWidth(), midLineWidth() ); |
115 | style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); | 115 | style().drawPrimitive( QStyle::PE_Separator, p, QRect( p1, p2 ), g, QStyle::Style_Sunken, opt ); |
116 | #endif | 116 | #endif |
117 | } | 117 | } |
118 | 118 | ||
119 | 119 | ||
120 | QSize OSeparator::sizeHint() const | 120 | QSize OSeparator::sizeHint() const |
121 | { | 121 | { |
122 | if ( frameStyle() & VLine ) | 122 | if ( frameStyle() & VLine ) |
123 | return QSize(2, 0); | 123 | return QSize(2, 0); |
124 | 124 | ||
125 | if ( frameStyle() & HLine ) | 125 | if ( frameStyle() & HLine ) |
126 | return QSize(0, 2); | 126 | return QSize(0, 2); |
127 | 127 | ||
128 | return QSize(-1, -1); | 128 | return QSize(-1, -1); |
129 | } | 129 | } |