Diffstat (limited to 'noncore/apps/oxygen/dataTable.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index 70b5a6a..ff01417 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp | |||
@@ -1,7 +1,15 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | application: : Oxygen | ||
3 | |||
4 | begin : September 2002 | ||
5 | copyright : ( C ) 2002 by Carsten Niehaus | ||
6 | email : cniehaus@handhelds.org | ||
7 | **************************************************************************/ | ||
8 | |||
9 | /*************************************************************************** | ||
2 | * * | 10 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 11 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 12 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 13 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * ( at your option ) any later version. * | 14 | * ( at your option ) any later version. * |
7 | * * | 15 | * * |
@@ -16,24 +24,29 @@ | |||
16 | #include <qfont.h> | 24 | #include <qfont.h> |
17 | #include <qlayout.h> | 25 | #include <qlayout.h> |
18 | 26 | ||
19 | OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) | 27 | OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) |
20 | { | 28 | { |
21 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); | 29 | QGridLayout *qgrid = new QGridLayout( this, 2,1 ); |
30 | |||
22 | QHBox *hbox = new QHBox( this ); | 31 | QHBox *hbox = new QHBox( this ); |
23 | left = new QLabel( hbox ); | 32 | left = new QLabel( hbox ); |
24 | middle = new QLabel( hbox ); | 33 | middle = new QLabel( hbox ); |
25 | right = new QLabel( hbox ); | 34 | right = new QLabel( hbox ); |
26 | 35 | ||
27 | DataTable = new OxydataTable( 9,2, this ); | 36 | right->setAlignment( AlignRight ); |
28 | 37 | middle->setAlignment( AlignHCenter ); | |
38 | |||
29 | QFont bf; | 39 | QFont bf; |
30 | bf.setBold( true ); | 40 | bf.setBold( true ); |
31 | bf.setPointSize( bf.pointSize()+2 ); | 41 | bf.setPointSize( bf.pointSize()+2 ); |
32 | middle->setFont( bf ); | 42 | middle->setFont( bf ); |
33 | 43 | ||
44 | DataTable = new OxydataTable( 9,2, this ); | ||
45 | DataTable->setColumnWidth ( 1 , 118 ); | ||
46 | DataTable->setColumnWidth ( 0 , 118 ); | ||
34 | setTable(); | 47 | setTable(); |
35 | 48 | ||
36 | qgrid->addWidget( hbox,0,0 ); | 49 | qgrid->addWidget( hbox,0,0 ); |
37 | qgrid->addWidget( DataTable,1,0 ); | 50 | qgrid->addWidget( DataTable,1,0 ); |
38 | } | 51 | } |
39 | 52 | ||
@@ -78,12 +91,19 @@ OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, | |||
78 | this->horizontalHeader()->hide(); | 91 | this->horizontalHeader()->hide(); |
79 | this->verticalHeader()->hide(); | 92 | this->verticalHeader()->hide(); |
80 | this->setTopMargin( 0 ); | 93 | this->setTopMargin( 0 ); |
81 | this->setLeftMargin( 0 ); | 94 | this->setLeftMargin( 0 ); |
82 | } | 95 | } |
83 | 96 | ||
97 | int OxydataTable::alignment() const | ||
98 | { | ||
99 | return AlignLeft | AlignVCenter; | ||
100 | }; | ||
101 | |||
102 | |||
103 | |||
84 | void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) | 104 | void OxydataTable::paintCell( QPainter *p, int row, int col, const QRect &cr, bool selected) |
85 | { | 105 | { |
86 | if ( cr.width() == 0 || cr.height() == 0 ) | 106 | if ( cr.width() == 0 || cr.height() == 0 ) |
87 | return; | 107 | return; |
88 | selected = FALSE; | 108 | selected = FALSE; |
89 | 109 | ||