author | zecke <zecke> | 2004-03-26 22:36:43 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-26 22:36:43 (UTC) |
commit | c54a3c8cc47258743381d4dee4200304d247182d (patch) (unidiff) | |
tree | bc96497821743c7b7789004fd700f58f10f0f772 /libopie2 | |
parent | 2487838d0f9358d6efdf714e9dfd892f92802b46 (diff) | |
download | opie-c54a3c8cc47258743381d4dee4200304d247182d.zip opie-c54a3c8cc47258743381d4dee4200304d247182d.tar.gz opie-c54a3c8cc47258743381d4dee4200304d247182d.tar.bz2 |
Add WFlags to the c'tor so we eventually can use this
in the designer... but anyway making it more consistent with Qt
Ah and this is binary incompatible but the API isn't marked as stable
anyway
-rw-r--r-- | libopie2/opieui/olistview.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/olistview.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libopie2/opieui/olistview.cpp b/libopie2/opieui/olistview.cpp index 38670b4..d7c92fd 100644 --- a/libopie2/opieui/olistview.cpp +++ b/libopie2/opieui/olistview.cpp | |||
@@ -16,66 +16,66 @@ | |||
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ..}^=.= = ; Library General Public License for more | 18 | ..}^=.= = ; Library General Public License for more |
19 | ++= -. .` .: details. | 19 | ++= -. .` .: details. |
20 | : = ...= . :.=- | 20 | : = ...= . :.=- |
21 | -. .:....=;==+<; You should have received a copy of the GNU | 21 | -. .:....=;==+<; You should have received a copy of the GNU |
22 | -_. . . )=. = Library General Public License along with | 22 | -_. . . )=. = Library General Public License along with |
23 | -- :-=` this library; see the file COPYING.LIB. | 23 | -- :-=` this library; see the file COPYING.LIB. |
24 | If not, write to the Free Software Foundation, | 24 | If not, write to the Free Software Foundation, |
25 | Inc., 59 Temple Place - Suite 330, | 25 | Inc., 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | /* QT */ | 30 | /* QT */ |
31 | 31 | ||
32 | #include <qpixmap.h> | 32 | #include <qpixmap.h> |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | 35 | ||
36 | #include <opie2/odebug.h> | 36 | #include <opie2/odebug.h> |
37 | #include <opie2/olistview.h> | 37 | #include <opie2/olistview.h> |
38 | 38 | ||
39 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
40 | 40 | ||
41 | 41 | ||
42 | namespace Opie { | 42 | namespace Opie { |
43 | namespace Ui { | 43 | namespace Ui { |
44 | /*====================================================================================== | 44 | /*====================================================================================== |
45 | * OListView | 45 | * OListView |
46 | *======================================================================================*/ | 46 | *======================================================================================*/ |
47 | 47 | ||
48 | OListView::OListView( QWidget *parent, const char *name ) | 48 | OListView::OListView( QWidget *parent, const char *name, WFlags fl ) |
49 | :QListView( parent, name ) | 49 | :QListView( parent, name, fl ) |
50 | { | 50 | { |
51 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* | 51 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* |
52 | 52 | ||
53 | m_alternateBackground = QColor( 238, 246, 255 ); | 53 | m_alternateBackground = QColor( 238, 246, 255 ); |
54 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); | 54 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); |
55 | m_fullWidth = true; | 55 | m_fullWidth = true; |
56 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); | 56 | connect( this, SIGNAL(expanded(QListViewItem*)), SLOT(expand(QListViewItem*))); |
57 | } | 57 | } |
58 | 58 | ||
59 | OListView::~OListView() | 59 | OListView::~OListView() |
60 | { | 60 | { |
61 | } | 61 | } |
62 | 62 | ||
63 | void OListView::setFullWidth( bool fullWidth ) | 63 | void OListView::setFullWidth( bool fullWidth ) |
64 | { | 64 | { |
65 | m_fullWidth = m_fullWidth; | 65 | m_fullWidth = m_fullWidth; |
66 | #if QT_VERSION > 290 | 66 | #if QT_VERSION > 290 |
67 | header()->setStretchEnabled( fullWidth, columns()-1 ); | 67 | header()->setStretchEnabled( fullWidth, columns()-1 ); |
68 | #endif | 68 | #endif |
69 | } | 69 | } |
70 | 70 | ||
71 | bool OListView::fullWidth() const | 71 | bool OListView::fullWidth() const |
72 | { | 72 | { |
73 | return m_fullWidth; | 73 | return m_fullWidth; |
74 | } | 74 | } |
75 | 75 | ||
76 | int OListView::addColumn( const QString& label, int width ) | 76 | int OListView::addColumn( const QString& label, int width ) |
77 | { | 77 | { |
78 | int result = QListView::addColumn( label, width ); | 78 | int result = QListView::addColumn( label, width ); |
79 | #if QT_VERSION > 290 | 79 | #if QT_VERSION > 290 |
80 | if (m_fullWidth) { | 80 | if (m_fullWidth) { |
81 | header()->setStretchEnabled( false, columns()-2 ); | 81 | header()->setStretchEnabled( false, columns()-2 ); |
diff --git a/libopie2/opieui/olistview.h b/libopie2/opieui/olistview.h index 8195a62..3ff11ef 100644 --- a/libopie2/opieui/olistview.h +++ b/libopie2/opieui/olistview.h | |||
@@ -36,65 +36,65 @@ | |||
36 | #include <qdatastream.h> | 36 | #include <qdatastream.h> |
37 | #include <qstringlist.h> | 37 | #include <qstringlist.h> |
38 | 38 | ||
39 | 39 | ||
40 | namespace Opie { | 40 | namespace Opie { |
41 | namespace Ui { | 41 | namespace Ui { |
42 | class OListViewItem; | 42 | class OListViewItem; |
43 | 43 | ||
44 | 44 | ||
45 | /*====================================================================================== | 45 | /*====================================================================================== |
46 | * OListView | 46 | * OListView |
47 | *======================================================================================*/ | 47 | *======================================================================================*/ |
48 | 48 | ||
49 | /** | 49 | /** |
50 | * @brief A list/tree widget. | 50 | * @brief A list/tree widget. |
51 | * | 51 | * |
52 | * A @ref QListView variant featuring visual and functional enhancements | 52 | * A @ref QListView variant featuring visual and functional enhancements |
53 | * like an alternate background for odd rows, an autostretch mode | 53 | * like an alternate background for odd rows, an autostretch mode |
54 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. | 54 | * for the width of the widget ( >= Qt 3 only ) and persistence capabilities. |
55 | * | 55 | * |
56 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> | 56 | * @author Michael 'Mickey' Lauer <mickey@vanille.de> |
57 | */ | 57 | */ |
58 | class OListView: public QListView | 58 | class OListView: public QListView |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | public: | 61 | public: |
62 | /** | 62 | /** |
63 | * Constructor. | 63 | * Constructor. |
64 | * | 64 | * |
65 | * The parameters @a parent and @a name are handled by | 65 | * The parameters @a parent and @a name are handled by |
66 | * @ref QListView, as usual. | 66 | * @ref QListView, as usual. |
67 | */ | 67 | */ |
68 | OListView( QWidget* parent = 0, const char* name = 0 ); | 68 | OListView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
69 | /** | 69 | /** |
70 | * Destructor. | 70 | * Destructor. |
71 | */ | 71 | */ |
72 | virtual ~OListView(); | 72 | virtual ~OListView(); |
73 | /** | 73 | /** |
74 | * Let the last column fit exactly all the available width. | 74 | * Let the last column fit exactly all the available width. |
75 | */ | 75 | */ |
76 | void setFullWidth( bool fullWidth ); | 76 | void setFullWidth( bool fullWidth ); |
77 | /** | 77 | /** |
78 | * Returns whether the last column is set to fit the available width. | 78 | * Returns whether the last column is set to fit the available width. |
79 | */ | 79 | */ |
80 | bool fullWidth() const; | 80 | bool fullWidth() const; |
81 | /** | 81 | /** |
82 | * Reimplemented for full width support | 82 | * Reimplemented for full width support |
83 | */ | 83 | */ |
84 | virtual int addColumn( const QString& label, int width = -1 ); | 84 | virtual int addColumn( const QString& label, int width = -1 ); |
85 | /** | 85 | /** |
86 | * Reimplemented for full width support | 86 | * Reimplemented for full width support |
87 | */ | 87 | */ |
88 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); | 88 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); |
89 | /** | 89 | /** |
90 | * Reimplemented for full width support | 90 | * Reimplemented for full width support |
91 | */ | 91 | */ |
92 | virtual void removeColumn(int index); | 92 | virtual void removeColumn(int index); |
93 | /** | 93 | /** |
94 | * Set the alternate background background @a color. | 94 | * Set the alternate background background @a color. |
95 | * Set to an invalid color to disable alternate colors. | 95 | * Set to an invalid color to disable alternate colors. |
96 | * This only has an effect if the items are OListViewItems | 96 | * This only has an effect if the items are OListViewItems |
97 | */ | 97 | */ |
98 | void setAlternateBackground( const QColor& color ); | 98 | void setAlternateBackground( const QColor& color ); |
99 | /** | 99 | /** |
100 | * Sets the column separator @a pen. | 100 | * Sets the column separator @a pen. |