Skip to content

Commit 81316ec

Browse files
committed
Update documentation
1 parent e1d93af commit 81316ec

7 files changed

+468
-54
lines changed

src/xlsx/xlsxcell.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ CellPrivate::CellPrivate(Cell *p) :
4646
4747
*/
4848

49+
/*!
50+
\enum Cell::DataType
51+
52+
\value Blank,
53+
\value String,
54+
\value Numeric,
55+
\value Formula,
56+
\value Boolean,
57+
\value Error,
58+
\value InlineString,
59+
\value ArrayFormula
60+
*/
61+
4962
/*!
5063
* \internal
5164
* Created by Worksheet only.
@@ -114,6 +127,9 @@ bool Cell::isDateTime() const
114127
return false;
115128
}
116129

130+
/*!
131+
* Return the data time value.
132+
*/
117133
QDateTime Cell::dateTime() const
118134
{
119135
Q_D(const Cell);

src/xlsx/xlsxcellrange.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ QString CellRange::toString() const
116116
return cell_1 + QLatin1String(":") + cell_2;
117117
}
118118

119+
/*!
120+
* Returns true if the Range is valid.
121+
*/
119122
bool CellRange::isValid() const
120123
{
121124
return left <= right && top <= bottom;

src/xlsx/xlsxdatavalidation.cpp

+91-5
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ DataValidationPrivate::~DataValidationPrivate()
6464
* \class DataValidation
6565
* \brief Data validation for single cell or a range
6666
* \inmodule QtXlsx
67+
*
6768
* The data validation can be applied to a single cell or a range of cells.
6869
*/
6970

@@ -110,7 +111,8 @@ DataValidationPrivate::~DataValidationPrivate()
110111
*/
111112

112113
/*!
113-
* Construct a data validation object
114+
* Construct a data validation object with the given \a type, \a op, \a formula1
115+
* \a formula2, and \a allowBlank.
114116
*/
115117
DataValidation::DataValidation(ValidationType type, ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank)
116118
:d(new DataValidationPrivate(type, op, formula1, formula2, allowBlank))
@@ -128,101 +130,162 @@ DataValidation::DataValidation()
128130
}
129131

130132
/*!
131-
\internal
133+
Constructs a copy of \a other.
132134
*/
133135
DataValidation::DataValidation(const DataValidation &other)
134136
:d(other.d)
135137
{
136138

137139
}
138140

141+
/*!
142+
Assigns \a other to this validation and returns a reference to this validation.
143+
*/
144+
DataValidation &DataValidation::operator=(const DataValidation &other)
145+
{
146+
this->d = other.d;
147+
return *this;
148+
}
149+
150+
139151
/*!
140152
* Destroy the object.
141153
*/
142154
DataValidation::~DataValidation()
143155
{
144156
}
145157

158+
/*!
159+
Returns the validation type.
160+
*/
146161
DataValidation::ValidationType DataValidation::validationType() const
147162
{
148163
return d->validationType;
149164
}
150165

166+
/*!
167+
Returns the validation operator.
168+
*/
151169
DataValidation::ValidationOperator DataValidation::validationOperator() const
152170
{
153171
return d->validationOperator;
154172
}
155173

174+
/*!
175+
Returns the validation error style.
176+
*/
156177
DataValidation::ErrorStyle DataValidation::errorStyle() const
157178
{
158179
return d->errorStyle;
159180
}
160181

182+
/*!
183+
Returns the formula1.
184+
*/
161185
QString DataValidation::formula1() const
162186
{
163187
return d->formula1;
164188
}
165189

190+
/*!
191+
Returns the formula2.
192+
*/
166193
QString DataValidation::formula2() const
167194
{
168195
return d->formula2;
169196
}
170197

198+
/*!
199+
Returns whether blank is allowed.
200+
*/
171201
bool DataValidation::allowBlank() const
172202
{
173203
return d->allowBlank;
174204
}
175205

206+
/*!
207+
Returns the error message.
208+
*/
176209
QString DataValidation::errorMessage() const
177210
{
178211
return d->errorMessage;
179212
}
180213

214+
/*!
215+
Returns the error message title.
216+
*/
181217
QString DataValidation::errorMessageTitle() const
182218
{
183219
return d->errorMessageTitle;
184220
}
185221

222+
/*!
223+
Returns the prompt message.
224+
*/
186225
QString DataValidation::promptMessage() const
187226
{
188227
return d->promptMessage;
189228
}
190229

230+
/*!
231+
Returns the prompt message title.
232+
*/
191233
QString DataValidation::promptMessageTitle() const
192234
{
193235
return d->promptMessageTitle;
194236
}
195237

238+
/*!
239+
Returns the whether prompt message is shown.
240+
*/
196241
bool DataValidation::isPromptMessageVisible() const
197242
{
198243
return d->isPromptMessageVisible;
199244
}
200245

246+
/*!
247+
Returns the whether error message is shown.
248+
*/
201249
bool DataValidation::isErrorMessageVisible() const
202250
{
203251
return d->isErrorMessageVisible;
204252
}
205253

254+
/*!
255+
Returns the ranges on which the validation will be applied.
256+
*/
206257
QList<CellRange> DataValidation::ranges() const
207258
{
208259
return d->ranges;
209260
}
210261

262+
/*!
263+
Sets the validation type to \a type.
264+
*/
211265
void DataValidation::setValidationType(DataValidation::ValidationType type)
212266
{
213267
d->validationType = type;
214268
}
215269

270+
/*!
271+
Sets the validation operator to \a op.
272+
*/
216273
void DataValidation::setValidationOperator(DataValidation::ValidationOperator op)
217274
{
218275
d->validationOperator = op;
219276
}
220277

278+
/*!
279+
Sets the error style to \a es.
280+
*/
221281
void DataValidation::setErrorStyle(DataValidation::ErrorStyle es)
222282
{
223283
d->errorStyle = es;
224284
}
225285

286+
/*!
287+
Sets the formula1 to \a formula.
288+
*/
226289
void DataValidation::setFormula1(const QString &formula)
227290
{
228291
if (formula.startsWith(QLatin1Char('=')))
@@ -231,42 +294,61 @@ void DataValidation::setFormula1(const QString &formula)
231294
d->formula1 = formula;
232295
}
233296

297+
/*!
298+
Sets the formulas to \a formula.
299+
*/
234300
void DataValidation::setFormula2(const QString &formula)
235301
{
236302
if (formula.startsWith(QLatin1Char('=')))
237303
d->formula2 = formula.mid(1);
238304
else
239-
d->formula2 = formula;}
305+
d->formula2 = formula;
306+
}
240307

308+
/*!
309+
Sets the error message to \a error with title \a title.
310+
*/
241311
void DataValidation::setErrorMessage(const QString &error, const QString &title)
242312
{
243313
d->errorMessage = error;
244314
d->errorMessageTitle = title;
245315
}
246316

317+
/*!
318+
Sets the prompt message to \a prompt with title \a title.
319+
*/
247320
void DataValidation::setPromptMessage(const QString &prompt, const QString &title)
248321
{
249322
d->promptMessage = prompt;
250323
d->promptMessageTitle = title;
251324
}
252325

326+
/*!
327+
Enable/disabe blank allow based on \a enable.
328+
*/
253329
void DataValidation::setAllowBlank(bool enable)
254330
{
255331
d->allowBlank = enable;
256332
}
257333

334+
/*!
335+
Enable/disabe prompt message visible based on \a visible.
336+
*/
258337
void DataValidation::setPromptMessageVisible(bool visible)
259338
{
260339
d->isPromptMessageVisible = visible;
261340
}
262341

342+
/*!
343+
Enable/disabe error message visible based on \a visible.
344+
*/
263345
void DataValidation::setErrorMessageVisible(bool visible)
264346
{
265347
d->isErrorMessageVisible = visible;
266348
}
267349

268350
/*!
269-
Add the \a cell which the DataValidation will apply to.
351+
Add the \a cell on which the DataValidation will apply to.
270352
*/
271353
void DataValidation::addCell(const QString &cell)
272354
{
@@ -275,14 +357,15 @@ void DataValidation::addCell(const QString &cell)
275357

276358
/*!
277359
\overload
360+
Add the cell(\a row, \a col) on which the DataValidation will apply to.
278361
*/
279362
void DataValidation::addCell(int row, int col)
280363
{
281364
d->ranges.append(CellRange(row, col, row, col));
282365
}
283366

284367
/*!
285-
Add the \a range which the DataValidation will apply to.
368+
Add the \a range on which the DataValidation will apply to.
286369
*/
287370
void DataValidation::addRange(const QString &range)
288371
{
@@ -291,6 +374,8 @@ void DataValidation::addRange(const QString &range)
291374

292375
/*!
293376
\overload
377+
Add the range(\a firstRow, \a firstCol, \a lastRow, \a lastCol) on
378+
which the DataValidation will apply to.
294379
*/
295380
void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastCol)
296381
{
@@ -299,6 +384,7 @@ void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastC
299384

300385
/*!
301386
\overload
387+
Add the \a range on which the DataValidation will apply to.
302388
*/
303389
void DataValidation::addRange(const CellRange &range)
304390
{

0 commit comments

Comments
 (0)