Changeset View
Changeset View
Standalone View
Standalone View
src/KProperty.h
Show First 20 Lines • Show All 366 Lines • ▼ Show 20 Line(s) | 131 | public: | |||
---|---|---|---|---|---|
367 | /*! \return true if the property can be saved to a stream, xml, etc. | 367 | /*! \return true if the property can be saved to a stream, xml, etc. | ||
368 | There is a possibility to use "GUI" properties that aren't | 368 | There is a possibility to use "GUI" properties that aren't | ||
369 | stored but used only in a GUI.*/ | 369 | stored but used only in a GUI.*/ | ||
370 | bool isStorable() const; | 370 | bool isStorable() const; | ||
371 | 371 | | |||
372 | /*! Sets "storable" flag for this property. @see isStorable() */ | 372 | /*! Sets "storable" flag for this property. @see isStorable() */ | ||
373 | void setStorable(bool storable); | 373 | void setStorable(bool storable); | ||
374 | 374 | | |||
375 | /*! \return 1 if the property should be synced automatically in the property editor | 375 | //! Synchronization policy for property values | ||
376 | as soon as editor contents change (e.g. when the user types text). | 376 | //! @since 3.1 | ||
377 | If autoSync() == 0, property value will be updated when the user presses Enter | 377 | enum class ValueSyncPolicy { | ||
378 | or when another editor gets the focus. | 378 | Editor, //!< Allow to synchronize by the property editor using its valueSync setting (default) | ||
379 | Property follows property editor's global rule if autoSync() !=0 and !=1 (the default). | 379 | FocusOut, //!< Synchronize the value when focus is out of the editor widget for this property | ||
380 | */ | 380 | //!< or when the user presses the Enter key | ||
381 | int autoSync() const; | 381 | Auto //!< Synchronize automatically as soon as the editor widget for this property signals | ||
382 | //! (using commitData) that the value has been changed, e.g. when the user types | ||||
383 | //! another letter in a text box | ||||
384 | }; | ||||
382 | 385 | | |||
383 | /*! If \a sync is 1, the property will be synced automatically in the property editor | 386 | //! @return synchronization policy for property values of this property | ||
384 | as soon as editor's contents change (e.g. when the user types text). | 387 | //! @since 3.1 | ||
385 | If \a sync is 0, property value will be updated when the user presses | 388 | ValueSyncPolicy valueSyncPolicy() const; | ||
386 | Enter or when another editor gets the focus. | 389 | | ||
387 | Property follows property editor's global rule if sync !=0 and !=1 (the default). | 390 | //! Sets synchronization policy for property values of this property | ||
388 | */ | 391 | //! See ValueSyncPolicy for details. | ||
389 | void setAutoSync(int sync); | 392 | //! @since 3.1 | ||
393 | void setValueSyncPolicy(ValueSyncPolicy policy); | ||||
390 | 394 | | |||
391 | /*! Sets value \a val for option \a name. | 395 | /*! Sets value \a val for option \a name. | ||
392 | Options are used to override default settings of individual properties. | 396 | Options are used to override default settings of individual properties. | ||
393 | This is most visible in property editor widget. | 397 | This is most visible in property editor widget. | ||
394 | 398 | | |||
395 | Currently supported options are: | 399 | Currently supported options are: | ||
396 | <ul><li> min: integer value describing minimum value for properties of integer and | 400 | <ul><li> min: integer value describing minimum value for properties of integer and | ||
397 | double types. The default is 0.</li> | 401 | double types. The default is 0.</li> | ||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |