author | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-04-13 16:57:28 (UTC) |
commit | 0b311079ff19798866291034663757103c6ba935 (patch) (unidiff) | |
tree | 70ddccf3a3147475050fa06cc2d807a71ab1d5ee /libopie/otimepicker.cpp | |
parent | 1537ccb435ca725c793db6e94e0b9e83484b57e7 (diff) | |
download | opie-0b311079ff19798866291034663757103c6ba935.zip opie-0b311079ff19798866291034663757103c6ba935.tar.gz opie-0b311079ff19798866291034663757103c6ba935.tar.bz2 |
Jumbo API documentation update
and some API fixed
ColorDialog is now OColorDialog!!! keep the namespace tidy!
ColorPopupMenu is now OColorPopupMenu!!! keep the namespace tidy
ColorDialog TT couldn't break bc we can so make it const QColor&
OTimePicker add some convience methods
more I might have forgot
-rw-r--r-- | libopie/otimepicker.cpp | 86 |
1 files changed, 78 insertions, 8 deletions
diff --git a/libopie/otimepicker.cpp b/libopie/otimepicker.cpp index 8e8a4e7..115d39b 100644 --- a/libopie/otimepicker.cpp +++ b/libopie/otimepicker.cpp | |||
@@ -9,3 +9,10 @@ | |||
9 | 9 | ||
10 | OTimePicker::OTimePicker(QWidget* parent, const char* name, | 10 | |
11 | /** | ||
12 | * Constructs the widget | ||
13 | * @param parent The parent of the OTimePicker | ||
14 | * @param name The name of the object | ||
15 | * @param fl Window Flags | ||
16 | */ | ||
17 | OTimePicker::OTimePicker(QWidget* parent, const char* name, | ||
11 | WFlags fl) : | 18 | WFlags fl) : |
@@ -13,2 +20,3 @@ OTimePicker::OTimePicker(QWidget* parent, const char* name, | |||
13 | { | 20 | { |
21 | |||
14 | QVBoxLayout *vbox=new QVBoxLayout(this); | 22 | QVBoxLayout *vbox=new QVBoxLayout(this); |
@@ -22,4 +30,4 @@ OTimePicker::OTimePicker(QWidget* parent, const char* name, | |||
22 | vbox->addWidget(row); | 30 | vbox->addWidget(row); |
23 | 31 | ||
24 | 32 | ||
25 | for (int i=0; i<24; i++) { | 33 | for (int i=0; i<24; i++) { |
@@ -46,3 +54,3 @@ OTimePicker::OTimePicker(QWidget* parent, const char* name, | |||
46 | vbox->addWidget(row); | 54 | vbox->addWidget(row); |
47 | 55 | ||
48 | for (int i=0; i<60; i+=5) { | 56 | for (int i=0; i<60; i+=5) { |
@@ -60,2 +68,10 @@ OTimePicker::OTimePicker(QWidget* parent, const char* name, | |||
60 | 68 | ||
69 | /** | ||
70 | * This method return the current time | ||
71 | * @return the time | ||
72 | */ | ||
73 | QTime OTimePicker::time()const { | ||
74 | return tm; | ||
75 | } | ||
76 | |||
61 | void OTimePicker::slotHour(bool b) { | 77 | void OTimePicker::slotHour(bool b) { |
@@ -94,2 +110,28 @@ void OTimePicker::slotMinute(bool b) { | |||
94 | 110 | ||
111 | /** | ||
112 | * Method to set the time. No signal gets emitted during this method call | ||
113 | * Minutes must be within 5 minutes step starting at 0 ( 0,5,10,15,20... ) | ||
114 | * @param t The time to be set | ||
115 | */ | ||
116 | void OTimePicker::setTime( const QTime& t) { | ||
117 | setTime( t.hour(), t.minute() ); | ||
118 | } | ||
119 | |||
120 | /** | ||
121 | * Method to set the time. No signal gets emitted during this method call | ||
122 | * @param h The hour | ||
123 | * @param m The minute. Minutes need to set by 5 minute steps | ||
124 | */ | ||
125 | void OTimePicker::setTime( int h, int m ) { | ||
126 | setHour(h); | ||
127 | setMinute(m); | ||
128 | } | ||
129 | |||
130 | /* | ||
131 | * FIXME round minutes to the 5 minute arrangement -zecke | ||
132 | */ | ||
133 | /** | ||
134 | * Method to set the minutes | ||
135 | * @param m minutes | ||
136 | */ | ||
95 | void OTimePicker::setMinute(int m) { | 137 | void OTimePicker::setMinute(int m) { |
@@ -103,3 +145,3 @@ void OTimePicker::setMinute(int m) { | |||
103 | else (*it)->setOn(false); | 145 | else (*it)->setOn(false); |
104 | } | 146 | } |
105 | 147 | ||
@@ -108,2 +150,5 @@ void OTimePicker::setMinute(int m) { | |||
108 | 150 | ||
151 | /** | ||
152 | * Method to set the hour | ||
153 | */ | ||
109 | void OTimePicker::setHour(int h) { | 154 | void OTimePicker::setHour(int h) { |
@@ -117,3 +162,3 @@ void OTimePicker::setHour(int h) { | |||
117 | else (*it)->setOn(false); | 162 | else (*it)->setOn(false); |
118 | } | 163 | } |
119 | tm.setHMS(h,tm.minute(),0); | 164 | tm.setHMS(h,tm.minute(),0); |
@@ -122,2 +167,9 @@ void OTimePicker::setHour(int h) { | |||
122 | 167 | ||
168 | /** | ||
169 | * This is a modal Dialog. | ||
170 | * | ||
171 | * @param parent The parent widget | ||
172 | * @param name The name of the object | ||
173 | * @param fl Possible window flags | ||
174 | */ | ||
123 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) | 175 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) |
@@ -135,3 +187,6 @@ OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags | |||
135 | 187 | ||
136 | QTime& OTimePickerDialog::time() | 188 | /** |
189 | * @return the time | ||
190 | */ | ||
191 | QTime OTimePickerDialog::time()const | ||
137 | { | 192 | { |
@@ -139,2 +194,7 @@ QTime& OTimePickerDialog::time() | |||
139 | } | 194 | } |
195 | |||
196 | /** | ||
197 | * Set the time to time | ||
198 | * @param time The time to be set | ||
199 | */ | ||
140 | void OTimePickerDialog::setTime( const QTime& time ) | 200 | void OTimePickerDialog::setTime( const QTime& time ) |
@@ -156,5 +216,10 @@ void OTimePickerDialog::setTime( const QTime& time ) | |||
156 | minuteField->setText( QString::number( time.minute() ) ); | 216 | minuteField->setText( QString::number( time.minute() ) ); |
157 | 217 | ||
158 | } | 218 | } |
159 | 219 | ||
220 | /** | ||
221 | * This method takes the current minute and tries to set hour | ||
222 | * to hour. This succeeds if the resulting date is valid | ||
223 | * @param hour The hour as a string | ||
224 | */ | ||
160 | void OTimePickerDialog::setHour ( const QString& hour ) | 225 | void OTimePickerDialog::setHour ( const QString& hour ) |
@@ -168,2 +233,7 @@ void OTimePickerDialog::setHour ( const QString& hour ) | |||
168 | 233 | ||
234 | /** | ||
235 | * Method to set a new minute. It tries to convert the string to int and | ||
236 | * if the resulting date is valid a new date is set. | ||
237 | * @see setHour | ||
238 | */ | ||
169 | void OTimePickerDialog::setMinute ( const QString& minute ) | 239 | void OTimePickerDialog::setMinute ( const QString& minute ) |