author | cniehaus <cniehaus> | 2002-09-30 13:05:45 (UTC) |
---|---|---|
committer | cniehaus <cniehaus> | 2002-09-30 13:05:45 (UTC) |
commit | b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3 (patch) (unidiff) | |
tree | a5579c7242791b2602a764a781051c7f9a298be1 | |
parent | ece83520d6bf5c481275a3d4a8e792749119fa08 (diff) | |
download | opie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.zip opie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.tar.gz opie-b753c264b7acd26aba9f5a73c1fa0a7deb0b73a3.tar.bz2 |
fixed one typo
I tried to fix the layouting problem but I give up. /me is to lame
-rw-r--r-- | noncore/apps/oxygen/calcdlg.ui | 4 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.cpp | 10 | ||||
-rw-r--r-- | noncore/apps/oxygen/dataTable.h | 3 | ||||
-rw-r--r-- | noncore/apps/oxygen/datawidgetui.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/oxygen/psewidget.cpp | 1 |
5 files changed, 15 insertions, 4 deletions
diff --git a/noncore/apps/oxygen/calcdlg.ui b/noncore/apps/oxygen/calcdlg.ui index a8ed170..c817a47 100644 --- a/noncore/apps/oxygen/calcdlg.ui +++ b/noncore/apps/oxygen/calcdlg.ui | |||
@@ -2,25 +2,25 @@ | |||
2 | <class>CalcDlg</class> | 2 | <class>CalcDlg</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>CalcDlg</cstring> | 7 | <cstring>CalcDlg</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>241</width> | 14 | <width>237</width> |
15 | <height>318</height> | 15 | <height>318</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Form1</string> | 20 | <string>Form1</string> |
21 | </property> | 21 | </property> |
22 | <widget> | 22 | <widget> |
23 | <class>QTabWidget</class> | 23 | <class>QTabWidget</class> |
24 | <property stdset="1"> | 24 | <property stdset="1"> |
25 | <name>name</name> | 25 | <name>name</name> |
26 | <cstring>TabWidget3</cstring> | 26 | <cstring>TabWidget3</cstring> |
@@ -67,25 +67,25 @@ | |||
67 | <property stdset="1"> | 67 | <property stdset="1"> |
68 | <name>spacing</name> | 68 | <name>spacing</name> |
69 | <number>6</number> | 69 | <number>6</number> |
70 | </property> | 70 | </property> |
71 | <widget> | 71 | <widget> |
72 | <class>QLabel</class> | 72 | <class>QLabel</class> |
73 | <property stdset="1"> | 73 | <property stdset="1"> |
74 | <name>name</name> | 74 | <name>name</name> |
75 | <cstring>TextLabel2</cstring> | 75 | <cstring>TextLabel2</cstring> |
76 | </property> | 76 | </property> |
77 | <property stdset="1"> | 77 | <property stdset="1"> |
78 | <name>text</name> | 78 | <name>text</name> |
79 | <string>chemical Formula</string> | 79 | <string>Chemical Formula</string> |
80 | </property> | 80 | </property> |
81 | </widget> | 81 | </widget> |
82 | <widget> | 82 | <widget> |
83 | <class>QLineEdit</class> | 83 | <class>QLineEdit</class> |
84 | <property stdset="1"> | 84 | <property stdset="1"> |
85 | <name>name</name> | 85 | <name>name</name> |
86 | <cstring>formula</cstring> | 86 | <cstring>formula</cstring> |
87 | </property> | 87 | </property> |
88 | </widget> | 88 | </widget> |
89 | <widget> | 89 | <widget> |
90 | <class>QLayoutWidget</class> | 90 | <class>QLayoutWidget</class> |
91 | <property stdset="1"> | 91 | <property stdset="1"> |
diff --git a/noncore/apps/oxygen/dataTable.cpp b/noncore/apps/oxygen/dataTable.cpp index 98d3bd8..82b425e 100644 --- a/noncore/apps/oxygen/dataTable.cpp +++ b/noncore/apps/oxygen/dataTable.cpp | |||
@@ -34,25 +34,24 @@ OxydataWidget::OxydataWidget(QWidget *parent) : QWidget(parent) | |||
34 | middle = new QLabel( hbox ); | 34 | middle = new QLabel( hbox ); |
35 | right = new QLabel( hbox ); | 35 | right = new QLabel( hbox ); |
36 | 36 | ||
37 | right->setAlignment( AlignRight ); | 37 | right->setAlignment( AlignRight ); |
38 | middle->setAlignment( AlignHCenter ); | 38 | middle->setAlignment( AlignHCenter ); |
39 | 39 | ||
40 | QFont bf; | 40 | QFont bf; |
41 | bf.setBold( true ); | 41 | bf.setBold( true ); |
42 | bf.setPointSize( bf.pointSize()+2 ); | 42 | bf.setPointSize( bf.pointSize()+2 ); |
43 | middle->setFont( bf ); | 43 | middle->setFont( bf ); |
44 | 44 | ||
45 | DataTable = new OxydataTable( 9,2, this ); | 45 | DataTable = new OxydataTable( 9,2, this ); |
46 | //DataTable->setColumnWidth ( 1 , ( parent->width())-10 ); | ||
47 | setTable(); | 46 | setTable(); |
48 | 47 | ||
49 | qgrid->addWidget( hbox,0,0 ); | 48 | qgrid->addWidget( hbox,0,0 ); |
50 | qgrid->addWidget( DataTable,1,0 ); | 49 | qgrid->addWidget( DataTable,1,0 ); |
51 | } | 50 | } |
52 | 51 | ||
53 | void OxydataWidget::setElement( int el ) | 52 | void OxydataWidget::setElement( int el ) |
54 | { | 53 | { |
55 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 54 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
56 | 55 | ||
57 | configobj.setGroup( QString::number( el+1 )); | 56 | configobj.setGroup( QString::number( el+1 )); |
58 | 57 | ||
@@ -74,25 +73,34 @@ void OxydataWidget::setElement( int el ) | |||
74 | 73 | ||
75 | void OxydataWidget::setTable() const | 74 | void OxydataWidget::setTable() const |
76 | { | 75 | { |
77 | DataTable->setText( 0,0, tr( "Weight:" ) ); | 76 | DataTable->setText( 0,0, tr( "Weight:" ) ); |
78 | DataTable->setText( 1,0, tr( "Block" )) ; | 77 | DataTable->setText( 1,0, tr( "Block" )) ; |
79 | DataTable->setText( 2,0, tr( "Group" )) ; | 78 | DataTable->setText( 2,0, tr( "Group" )) ; |
80 | DataTable->setText( 3,0, tr( "Electronegativity" )) ; | 79 | DataTable->setText( 3,0, tr( "Electronegativity" )) ; |
81 | DataTable->setText( 4,0, tr( "Atomic radius" )) ; | 80 | DataTable->setText( 4,0, tr( "Atomic radius" )) ; |
82 | DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; | 81 | DataTable->setText( 5,0, tr( "Ionizationenergie" )) ; |
83 | DataTable->setText( 6,0, tr( "Density" )) ; | 82 | DataTable->setText( 6,0, tr( "Density" )) ; |
84 | DataTable->setText( 7,0, tr( "Boilingpoint" ) ); | 83 | DataTable->setText( 7,0, tr( "Boilingpoint" ) ); |
85 | DataTable->setText( 8,0, tr( "Meltingpoint" ) ); | 84 | DataTable->setText( 8,0, tr( "Meltingpoint" ) ); |
85 | } | ||
86 | |||
87 | void OxydataWidget::setLayout() | ||
88 | { | ||
89 | #warning this is not working and I have no idea why! | ||
90 | // DataTable->setColumnWidth ( 0 , this->width()/2 ); | ||
91 | // DataTable->setColumnWidth ( 1 , this->width()/2 ); | ||
86 | 92 | ||
93 | DataTable->setColumnWidth ( 0 , 110 ); | ||
94 | DataTable->setColumnWidth ( 1 , 110 ); | ||
87 | } | 95 | } |
88 | 96 | ||
89 | OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, | 97 | OxydataTable::OxydataTable(int numRows, int numCols, QWidget *parent, |
90 | const char *name) : QTable(numRows, numCols,parent, name) | 98 | const char *name) : QTable(numRows, numCols,parent, name) |
91 | { | 99 | { |
92 | 100 | ||
93 | for (int zeile = 0; zeile < numRows; zeile++) | 101 | for (int zeile = 0; zeile < numRows; zeile++) |
94 | for ( int spalte = 0; spalte < numCols; spalte++ ) | 102 | for ( int spalte = 0; spalte < numCols; spalte++ ) |
95 | { | 103 | { |
96 | OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); | 104 | OxydataQTI *testus = new OxydataQTI (this, OxydataQTI::Never, "hm" ); |
97 | setItem(zeile, spalte, (QTableItem*)testus); | 105 | setItem(zeile, spalte, (QTableItem*)testus); |
98 | } | 106 | } |
diff --git a/noncore/apps/oxygen/dataTable.h b/noncore/apps/oxygen/dataTable.h index a4a3b18..f2eb71d 100644 --- a/noncore/apps/oxygen/dataTable.h +++ b/noncore/apps/oxygen/dataTable.h | |||
@@ -25,28 +25,29 @@ class OxydataTable; | |||
25 | * | 25 | * |
26 | * Author: Carsten Niehaus <cniehaus@handhelds.org> | 26 | * Author: Carsten Niehaus <cniehaus@handhelds.org> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | class OxydataWidget : public QWidget | 29 | class OxydataWidget : public QWidget |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | 32 | ||
33 | public: | 33 | public: |
34 | OxydataWidget(QWidget *parent=0); | 34 | OxydataWidget(QWidget *parent=0); |
35 | 35 | ||
36 | QLabel *left, *middle, *right; | 36 | QLabel *left, *middle, *right; |
37 | void setLayout(); | ||
37 | 38 | ||
38 | private: | 39 | private: |
39 | OxydataTable *DataTable; | ||
40 | void setTable() const; | 40 | void setTable() const; |
41 | OxydataTable *DataTable; | ||
41 | 42 | ||
42 | public slots: | 43 | public slots: |
43 | void setElement( int ); | 44 | void setElement( int ); |
44 | }; | 45 | }; |
45 | 46 | ||
46 | /* | 47 | /* |
47 | * A OxydataTable is derived from QTable. I recoded the paintCell to have | 48 | * A OxydataTable is derived from QTable. I recoded the paintCell to have |
48 | * different colors in the backgound. Furthermore this widget never has a | 49 | * different colors in the backgound. Furthermore this widget never has a |
49 | * grid, thus I removed that code in paintCell. | 50 | * grid, thus I removed that code in paintCell. |
50 | * | 51 | * |
51 | * Author: Carsten Niehaus <cniehaus@handhelds.org> | 52 | * Author: Carsten Niehaus <cniehaus@handhelds.org> |
52 | */ | 53 | */ |
diff --git a/noncore/apps/oxygen/datawidgetui.cpp b/noncore/apps/oxygen/datawidgetui.cpp index c7afa32..99c4fd7 100644 --- a/noncore/apps/oxygen/datawidgetui.cpp +++ b/noncore/apps/oxygen/datawidgetui.cpp | |||
@@ -36,17 +36,18 @@ dataWidgetUI::dataWidgetUI() : QWidget() | |||
36 | //read in all names of the 118 elements | 36 | //read in all names of the 118 elements |
37 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); | 37 | Config configobj( QPEApplication::qpeDir() +"share/oxygen/oxygendata", Config::File ); |
38 | for ( int i = 1 ; i < 119 ; i++ ) | 38 | for ( int i = 1 ; i < 119 ; i++ ) |
39 | { | 39 | { |
40 | configobj.setGroup( QString::number( i ) ); | 40 | configobj.setGroup( QString::number( i ) ); |
41 | QString foo = configobj.readEntry( "Name" ); | 41 | QString foo = configobj.readEntry( "Name" ); |
42 | dataCombo->insertItem( QString::number( i )+" - "+foo ); | 42 | dataCombo->insertItem( QString::number( i )+" - "+foo ); |
43 | } | 43 | } |
44 | 44 | ||
45 | OxydataWidget *oxyDW = new OxydataWidget(this); | 45 | OxydataWidget *oxyDW = new OxydataWidget(this); |
46 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); | 46 | connect ( dataCombo, SIGNAL( activated(int) ), oxyDW, SLOT( setElement(int) ) ); |
47 | oxyDW->setElement( 0 ); | 47 | oxyDW->setElement( 0 ); |
48 | oxyDW->setLayout(); | ||
48 | 49 | ||
49 | qgrid->addWidget( dataCombo, 0,0); | 50 | qgrid->addWidget( dataCombo, 0,0); |
50 | qgrid->addWidget( oxyDW , 1,0 ); | 51 | qgrid->addWidget( oxyDW , 1,0 ); |
51 | } | 52 | } |
52 | 53 | ||
diff --git a/noncore/apps/oxygen/psewidget.cpp b/noncore/apps/oxygen/psewidget.cpp index ba9b71a..18b41c3 100644 --- a/noncore/apps/oxygen/psewidget.cpp +++ b/noncore/apps/oxygen/psewidget.cpp | |||
@@ -40,24 +40,25 @@ PSEWidget::PSEWidget() : QWidget() | |||
40 | 40 | ||
41 | position( n+1,h,v ); | 41 | position( n+1,h,v ); |
42 | QList<OxyFrame> PSEframe; | 42 | QList<OxyFrame> PSEframe; |
43 | PSEframe.append( new OxyFrame( this , QString::number(n) ) ); | 43 | PSEframe.append( new OxyFrame( this , QString::number(n) ) ); |
44 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); | 44 | grid->addWidget( PSEframe.current() , v/40+1 , h/40 ); |
45 | PSEframe.current()->setMinimumHeight( 11 ); | 45 | PSEframe.current()->setMinimumHeight( 11 ); |
46 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); | 46 | PSEframe.current()->setPalette( QPalette( PSEColor( configobj.readEntry( "Block" ) ) ) ); |
47 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); | 47 | connect( PSEframe.current(), SIGNAL( num(QString) ), this, SLOT( slotShowElement(QString) )); |
48 | } | 48 | } |
49 | 49 | ||
50 | oxyDW = new OxydataWidget(this); | 50 | oxyDW = new OxydataWidget(this); |
51 | oxyDW->setElement( 0 ); | 51 | oxyDW->setElement( 0 ); |
52 | oxyDW->setLayout(); | ||
52 | 53 | ||
53 | vlay->addLayout( grid ); | 54 | vlay->addLayout( grid ); |
54 | vlay->addWidget( oxyDW ); | 55 | vlay->addWidget( oxyDW ); |
55 | } | 56 | } |
56 | 57 | ||
57 | QColor PSEWidget::PSEColor( QString block ) | 58 | QColor PSEWidget::PSEColor( QString block ) |
58 | { | 59 | { |
59 | QColor c; | 60 | QColor c; |
60 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); | 61 | if ( block == "s" ) c.setRgb( 213 , 233 , 231 ); |
61 | else if ( block == "d" ) c.setRgb( 200,230,160 ); | 62 | else if ( block == "d" ) c.setRgb( 200,230,160 ); |
62 | else if ( block == "p" ) c.setRgb( 238,146,138 ); | 63 | else if ( block == "p" ) c.setRgb( 238,146,138 ); |
63 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); | 64 | else if ( block == "f" ) c.setRgb( 190 , 190 , 190 ); |