Changeset View
Changeset View
Standalone View
Standalone View
src/KProperty.h
Show First 20 Lines • Show All 402 Lines • ▼ Show 20 Line(s) | 131 | public: | |||
---|---|---|---|---|---|
403 | //! @since 3.1 | 403 | //! @since 3.1 | ||
404 | void setValueSyncPolicy(ValueSyncPolicy policy); | 404 | void setValueSyncPolicy(ValueSyncPolicy policy); | ||
405 | 405 | | |||
406 | /*! Sets value \a val for option \a name. | 406 | /*! Sets value \a val for option \a name. | ||
407 | Options are used to override default settings of individual properties. | 407 | Options are used to override default settings of individual properties. | ||
408 | This is most visible in property editor widget. | 408 | This is most visible in property editor widget. | ||
409 | 409 | | |||
410 | Currently supported options are: | 410 | Currently supported options are: | ||
411 | <ul><li> min: integer value describing minimum value for properties of integer and | 411 | <ul> | ||
412 | double types. The default is 0.</li> | 412 | <li> min: value describing minimum value for properties of integer, double, | ||
413 | <li> minValueText: user-visible translated string to be displayed in editor for integer | 413 | date, date/time and time types. Default is 0 for double and unsigned integer types, | ||
414 | type when minimum is set for the property. | 414 | -INT_MAX for signed integer type. Defaults for date, date/time and time types are | ||
415 | specified in documentation of QDateEdit::minimumDate, | ||||
416 | QDateTimeEdit::minimumDateTime and QTime::minimumTime, respectively. | ||||
417 | The value is ignored if it is larger than the value of "max" option. </li> | ||||
418 | <li> minValueText: user-visible translated string to be displayed in editor for integer, | ||||
419 | double, date, date/time and time types when the value is equal to the value of | ||||
420 | "min" option. | ||||
415 | @see QAbstractSpinBox::specialValueText</li> | 421 | @see QAbstractSpinBox::specialValueText</li> | ||
416 | <li> max: integer describing minimum value for properties of integer type. Default is 0xffff.</li> | 422 | <li> max: value describing minimum value for properties of integer type. | ||
423 | Default is pow(2, std::numeric_limits<double>::digits) for double type (2^53 on 64-bit | ||||
424 | systems -- maximum precise value), and INT_MAX for integer type. | ||||
425 | Defaults for date, date/time and time types are specified in documentation | ||||
426 | of QDateEdit::maximumDate, QDateTimeEdit::maximumDateTime and QTime::maximumTime, respectively. | ||||
427 | The value is ignored if it is smaller than the value of "min" option. </li> | ||||
417 | <li> precision: integer value >= 0 describing the number of decimals after the decimal | 428 | <li> precision: integer value >= 0 describing the number of decimals after the decimal | ||
418 | point for double type. Default value is 2. | 429 | point for double type. Default value is 2. | ||
419 | @see QDoubleSpinBox::decimals</li> | 430 | @see QDoubleSpinBox::decimals</li> | ||
420 | <li> step: double value > 0.0 describing the size of the step that is taken when | 431 | <li> step: double value > 0.0 describing the size of the step that is taken when | ||
421 | the user hits the up or down button of editor for double type. Default value is 0.01. | 432 | the user hits the up or down button of editor for double type. Default value is 0.01. | ||
422 | @see QDoubleSpinBox::singleStep</li> | 433 | @see QDoubleSpinBox::singleStep</li> | ||
423 | <li> 3State: boolean value used for boolean type; if @c true, the editor becomes a combobox | 434 | <li> 3State: boolean value used for boolean type; if @c true, the editor becomes a combobox | ||
424 | (instead of checkable button) and accepts the third "null" state.</li> | 435 | (instead of checkable button) and accepts the third "null" state.</li> | ||
Show All 21 Lines | 448 | <li> fileMode: string value that describes what objects may select in the file dialog | |||
446 | </ul> | 457 | </ul> | ||
447 | </li> | 458 | </li> | ||
448 | <li> confirmOverwrites: boolean value, if @c true, user will be asked for confirmation | 459 | <li> confirmOverwrites: boolean value, if @c true, user will be asked for confirmation | ||
449 | of file overwriting in the url editor. @c false by default. | 460 | of file overwriting in the url editor. @c false by default. | ||
450 | @note The line edit does not validate the content.</li> | 461 | @note The line edit does not validate the content.</li> | ||
451 | <li> multiLine: boolean value used for string type. If @c true, a multi-line | 462 | <li> multiLine: boolean value used for string type. If @c true, a multi-line | ||
452 | QPlainTextEdit-based widget is used for editor; otherwise a single-line QLineEdit | 463 | QPlainTextEdit-based widget is used for editor; otherwise a single-line QLineEdit | ||
453 | widget is used. @c false by default. Added in version 3.1.</li> | 464 | widget is used. @c false by default. Added in version 3.1.</li> | ||
465 | <li>prefix: string to display before the value, e.g. '$'. Supported for double and integer | ||||
466 | types and composed types based on double and integer types (Point*, Size*, Rect*). | ||||
467 | @see QDoubleSpinBox::prefix QSpinBox::prefix</li> | ||||
468 | <li>suffix: string to display after the value, e.g. unit such as 'mm'. | ||||
469 | Supported for double and integer types and composed types based on double and | ||||
470 | integer types (Point*, Size*, Rect*). Note that only display is affected, value | ||||
471 | is not converted to any unit. | ||||
472 | @see QDoubleSpinBox::suffix QSpinBox::suffix</li> | ||||
454 | </ul>*/ | 473 | </ul>*/ | ||
455 | void setOption(const char* name, const QVariant& val); | 474 | void setOption(const char* name, const QVariant& val); | ||
456 | 475 | | |||
457 | /*! @brief Returns value of given option | 476 | /*! @brief Returns value of given option | ||
458 | * If the option @a name is missing and parent property is present (see parent()), | 477 | * If the option @a name is missing and parent property is present (see parent()), | ||
459 | * parent property is checked. If the parent property offers the option, the value | 478 | * parent property is checked. If the parent property offers the option, the value | ||
460 | * is returned. If it is not present there, @a defaultValue value is returned. | 479 | * is returned. If it is not present there, @a defaultValue value is returned. | ||
461 | * Looking at parent property is available since 3.1. | 480 | * Looking at parent property is available since 3.1. | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |