@@ -64,6 +64,7 @@ DataValidationPrivate::~DataValidationPrivate()
64
64
* \class DataValidation
65
65
* \brief Data validation for single cell or a range
66
66
* \inmodule QtXlsx
67
+ *
67
68
* The data validation can be applied to a single cell or a range of cells.
68
69
*/
69
70
@@ -110,7 +111,8 @@ DataValidationPrivate::~DataValidationPrivate()
110
111
*/
111
112
112
113
/* !
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.
114
116
*/
115
117
DataValidation::DataValidation (ValidationType type, ValidationOperator op, const QString &formula1, const QString &formula2, bool allowBlank)
116
118
:d(new DataValidationPrivate(type, op, formula1, formula2, allowBlank))
@@ -128,101 +130,162 @@ DataValidation::DataValidation()
128
130
}
129
131
130
132
/* !
131
- \internal
133
+ Constructs a copy of \a other.
132
134
*/
133
135
DataValidation::DataValidation (const DataValidation &other)
134
136
:d(other.d)
135
137
{
136
138
137
139
}
138
140
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
+
139
151
/* !
140
152
* Destroy the object.
141
153
*/
142
154
DataValidation::~DataValidation ()
143
155
{
144
156
}
145
157
158
+ /* !
159
+ Returns the validation type.
160
+ */
146
161
DataValidation::ValidationType DataValidation::validationType () const
147
162
{
148
163
return d->validationType ;
149
164
}
150
165
166
+ /* !
167
+ Returns the validation operator.
168
+ */
151
169
DataValidation::ValidationOperator DataValidation::validationOperator () const
152
170
{
153
171
return d->validationOperator ;
154
172
}
155
173
174
+ /* !
175
+ Returns the validation error style.
176
+ */
156
177
DataValidation::ErrorStyle DataValidation::errorStyle () const
157
178
{
158
179
return d->errorStyle ;
159
180
}
160
181
182
+ /* !
183
+ Returns the formula1.
184
+ */
161
185
QString DataValidation::formula1 () const
162
186
{
163
187
return d->formula1 ;
164
188
}
165
189
190
+ /* !
191
+ Returns the formula2.
192
+ */
166
193
QString DataValidation::formula2 () const
167
194
{
168
195
return d->formula2 ;
169
196
}
170
197
198
+ /* !
199
+ Returns whether blank is allowed.
200
+ */
171
201
bool DataValidation::allowBlank () const
172
202
{
173
203
return d->allowBlank ;
174
204
}
175
205
206
+ /* !
207
+ Returns the error message.
208
+ */
176
209
QString DataValidation::errorMessage () const
177
210
{
178
211
return d->errorMessage ;
179
212
}
180
213
214
+ /* !
215
+ Returns the error message title.
216
+ */
181
217
QString DataValidation::errorMessageTitle () const
182
218
{
183
219
return d->errorMessageTitle ;
184
220
}
185
221
222
+ /* !
223
+ Returns the prompt message.
224
+ */
186
225
QString DataValidation::promptMessage () const
187
226
{
188
227
return d->promptMessage ;
189
228
}
190
229
230
+ /* !
231
+ Returns the prompt message title.
232
+ */
191
233
QString DataValidation::promptMessageTitle () const
192
234
{
193
235
return d->promptMessageTitle ;
194
236
}
195
237
238
+ /* !
239
+ Returns the whether prompt message is shown.
240
+ */
196
241
bool DataValidation::isPromptMessageVisible () const
197
242
{
198
243
return d->isPromptMessageVisible ;
199
244
}
200
245
246
+ /* !
247
+ Returns the whether error message is shown.
248
+ */
201
249
bool DataValidation::isErrorMessageVisible () const
202
250
{
203
251
return d->isErrorMessageVisible ;
204
252
}
205
253
254
+ /* !
255
+ Returns the ranges on which the validation will be applied.
256
+ */
206
257
QList<CellRange> DataValidation::ranges () const
207
258
{
208
259
return d->ranges ;
209
260
}
210
261
262
+ /* !
263
+ Sets the validation type to \a type.
264
+ */
211
265
void DataValidation::setValidationType (DataValidation::ValidationType type)
212
266
{
213
267
d->validationType = type;
214
268
}
215
269
270
+ /* !
271
+ Sets the validation operator to \a op.
272
+ */
216
273
void DataValidation::setValidationOperator (DataValidation::ValidationOperator op)
217
274
{
218
275
d->validationOperator = op;
219
276
}
220
277
278
+ /* !
279
+ Sets the error style to \a es.
280
+ */
221
281
void DataValidation::setErrorStyle (DataValidation::ErrorStyle es)
222
282
{
223
283
d->errorStyle = es;
224
284
}
225
285
286
+ /* !
287
+ Sets the formula1 to \a formula.
288
+ */
226
289
void DataValidation::setFormula1 (const QString &formula)
227
290
{
228
291
if (formula.startsWith (QLatin1Char (' =' )))
@@ -231,42 +294,61 @@ void DataValidation::setFormula1(const QString &formula)
231
294
d->formula1 = formula;
232
295
}
233
296
297
+ /* !
298
+ Sets the formulas to \a formula.
299
+ */
234
300
void DataValidation::setFormula2 (const QString &formula)
235
301
{
236
302
if (formula.startsWith (QLatin1Char (' =' )))
237
303
d->formula2 = formula.mid (1 );
238
304
else
239
- d->formula2 = formula;}
305
+ d->formula2 = formula;
306
+ }
240
307
308
+ /* !
309
+ Sets the error message to \a error with title \a title.
310
+ */
241
311
void DataValidation::setErrorMessage (const QString &error, const QString &title)
242
312
{
243
313
d->errorMessage = error;
244
314
d->errorMessageTitle = title;
245
315
}
246
316
317
+ /* !
318
+ Sets the prompt message to \a prompt with title \a title.
319
+ */
247
320
void DataValidation::setPromptMessage (const QString &prompt, const QString &title)
248
321
{
249
322
d->promptMessage = prompt;
250
323
d->promptMessageTitle = title;
251
324
}
252
325
326
+ /* !
327
+ Enable/disabe blank allow based on \a enable.
328
+ */
253
329
void DataValidation::setAllowBlank (bool enable)
254
330
{
255
331
d->allowBlank = enable;
256
332
}
257
333
334
+ /* !
335
+ Enable/disabe prompt message visible based on \a visible.
336
+ */
258
337
void DataValidation::setPromptMessageVisible (bool visible)
259
338
{
260
339
d->isPromptMessageVisible = visible;
261
340
}
262
341
342
+ /* !
343
+ Enable/disabe error message visible based on \a visible.
344
+ */
263
345
void DataValidation::setErrorMessageVisible (bool visible)
264
346
{
265
347
d->isErrorMessageVisible = visible;
266
348
}
267
349
268
350
/* !
269
- Add the \a cell which the DataValidation will apply to.
351
+ Add the \a cell on which the DataValidation will apply to.
270
352
*/
271
353
void DataValidation::addCell (const QString &cell)
272
354
{
@@ -275,14 +357,15 @@ void DataValidation::addCell(const QString &cell)
275
357
276
358
/* !
277
359
\overload
360
+ Add the cell(\a row, \a col) on which the DataValidation will apply to.
278
361
*/
279
362
void DataValidation::addCell (int row, int col)
280
363
{
281
364
d->ranges .append (CellRange (row, col, row, col));
282
365
}
283
366
284
367
/* !
285
- Add the \a range which the DataValidation will apply to.
368
+ Add the \a range on which the DataValidation will apply to.
286
369
*/
287
370
void DataValidation::addRange (const QString &range)
288
371
{
@@ -291,6 +374,8 @@ void DataValidation::addRange(const QString &range)
291
374
292
375
/* !
293
376
\overload
377
+ Add the range(\a firstRow, \a firstCol, \a lastRow, \a lastCol) on
378
+ which the DataValidation will apply to.
294
379
*/
295
380
void DataValidation::addRange (int firstRow, int firstCol, int lastRow, int lastCol)
296
381
{
@@ -299,6 +384,7 @@ void DataValidation::addRange(int firstRow, int firstCol, int lastRow, int lastC
299
384
300
385
/* !
301
386
\overload
387
+ Add the \a range on which the DataValidation will apply to.
302
388
*/
303
389
void DataValidation::addRange (const CellRange &range)
304
390
{
0 commit comments