Version: 9.12.0
QtxPagePrefBackgroundItem Class Reference

GUI implementation of the resources item to store background data. More...

#include <QtxPagePrefMgr.h>

Inheritance diagram for QtxPagePrefBackgroundItem:
Inheritance graph

Public Member Functions

 QtxPagePrefBackgroundItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString())
 Constructor. More...
 
virtual ~QtxPagePrefBackgroundItem ()
 Destructor. More...
 
void gradients (QStringList &, QIntList &) const
 Get allowed two-color gradients to the widget. More...
 
void setGradients (const QStringList &, const QIntList &=QIntList())
 Set allowed two-color gradients to the widget. More...
 
bool isModeAllowed (Qtx::BackgroundMode) const
 Check if specific background mode is allowed. More...
 
void setModeAllowed (Qtx::BackgroundMode, bool)
 Enable / disable specific background mode. More...
 
bool isTextureModeAllowed (Qtx::TextureMode) const
 Check if specific texture mode is allowed. More...
 
void setTextureModeAllowed (Qtx::TextureMode, bool)
 Enable / disable specific texture mode. More...
 
bool isTextureAllowed () const
 Check if texture controls are allowed (shown) More...
 
void setTextureAllowed (bool)
 Enable / disable texture controls. More...
 
QString imageFormats () const
 Get allowed image formats. More...
 
void setImageFormats (const QString &)
 Set allowed image formats. More...
 
Qt::Orientation orientation () const
 Get widget editor orientation. More...
 
void setOrientation (Qt::Orientation)
 Set widget editor orientation. More...
 
virtual void store ()
 Store preference item to the resource manager. More...
 
virtual void retrieve ()
 Retrieve preference item from the resource manager. More...
 
- Public Member Functions inherited from QtxPageNamedPrefItem
 QtxPageNamedPrefItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString())
 Constructor. More...
 
virtual ~QtxPageNamedPrefItem ()
 Destructor. More...
 
virtual void setTitle (const QString &)
 Set preference title. More...
 
- Public Member Functions inherited from QtxPagePrefItem
 QtxPagePrefItem (const QString &, QtxPreferenceItem *=0, const QString &=QString(), const QString &=QString())
 Constructor. More...
 
virtual ~QtxPagePrefItem ()
 Destructor. More...
 
QWidgetwidget () const
 Get preference item editor widget. More...
 
virtual void activate ()
 
- Public Member Functions inherited from QtxPreferenceItem
 QtxPreferenceItem (QtxPreferenceItem *=0)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, QtxPreferenceItem *)
 Constructor. More...
 
 QtxPreferenceItem (const QString &, const QString &, const QString &, QtxPreferenceItem *)
 Constructor. More...
 
virtual ~QtxPreferenceItem ()
 Destructor. More...
 
int id () const
 Get unique item identifier. More...
 
virtual int rtti () const
 Get unique item type identifier. More...
 
QtxPreferenceItemrootItem () const
 Get root preference item. More...
 
QtxPreferenceItemparentItem () const
 Get parent preference item. More...
 
QList< QtxPreferenceItem * > childItems (const bool=false) const
 Get all child preference items. More...
 
int depth () const
 Get preference item depth. More...
 
int count () const
 Get child preference items number. More...
 
virtual bool isEmpty () const
 Check if the item has children. More...
 
void appendItem (QtxPreferenceItem *)
 Append child preference item. More...
 
void removeItem (QtxPreferenceItem *)
 Remove child preference item. More...
 
void insertItem (QtxPreferenceItem *, QtxPreferenceItem *=0)
 Insert child preference item before specified item. If the before item is 0 then new item is appended. More...
 
QIcon icon () const
 Get preference item icon. More...
 
QString title () const
 Get preference item title. More...
 
void resource (QString &, QString &) const
 Get resource file settings associated to the preference item. More...
 
virtual void setIcon (const QIcon &)
 Set prefence item icon. More...
 
virtual void setResource (const QString &, const QString &)
 Assign resource file settings to the preference item. More...
 
virtual void updateContents ()
 Update preference item. More...
 
QVariant option (const QString &) const
 Get preference item option value. More...
 
void setOption (const QString &, const QVariant &)
 Set preference item option value. More...
 
bool isEvaluateValues () const
 Get variables auto-conversion option value. More...
 
void setEvaluateValues (const bool)
 Switch variables auto-conversion option on/off. More...
 
bool isRestartRequired () const
 Get restart needed option value. More...
 
void setRestartRequired (const bool)
 Switch restart needed option on/off. More...
 
QString resourceValue () const
 Get the value of the associated resource file setting. More...
 
void setResourceValue (const QString &)
 Get the value of the associated resource file setting. More...
 
QtxPreferenceItemfindItem (const int, const bool=false) const
 Find the item by the specified identifier. More...
 
QtxPreferenceItemfindItem (const QString &, const bool=false) const
 Find the item by the specified title. More...
 
QtxPreferenceItemfindItem (const QString &, const int, const bool=false) const
 Find the item by the specified title and identifier. More...
 
virtual QtxResourceMgrresourceMgr () const
 Get the resources manager. More...
 
virtual QtxPreferenceMgrpreferenceMgr () const
 Get the parent preferences manager. More...
 
void ensureVisible ()
 

Protected Member Functions

virtual QVariant optionValue (const QString &) const
 Get preference item option value. More...
 
virtual void setOptionValue (const QString &, const QVariant &)
 Set preference item option value. More...
 
- Protected Member Functions inherited from QtxPageNamedPrefItem
QLabellabel () const
 Get label widget corresponding to the preference item. More...
 
QWidgetcontrol () const
 Get control widget corresponding to the preference item. More...
 
void setControl (QWidget *)
 Set control widget corresponding to the preference item. More...
 
- Protected Member Functions inherited from QtxPagePrefItem
void setWidget (QWidget *)
 Set preference item editor widget. More...
 
virtual void itemAdded (QtxPreferenceItem *)
 Callback function which is called when the child preference item is added. More...
 
virtual void itemRemoved (QtxPreferenceItem *)
 Callback function which is called when the child preference item is removed. More...
 
virtual void itemChanged (QtxPreferenceItem *)
 Callback function which is called when the child preference item is modified. More...
 
void pageChildItems (QList< QtxPagePrefItem * > &, const bool=false) const
 Find all child items of the QtxPagePrefItem type. More...
 
virtual void widgetShown ()
 Invoked when preference item widget is shown. More...
 
virtual void widgetHided ()
 Invoked when preference item widget is hided. More...
 
virtual void ensureVisible (QtxPreferenceItem *)
 
- Protected Member Functions inherited from QtxPreferenceItem
int getInteger (const int=0) const
 Get integer resources value corresponding to the item. More...
 
double getDouble (const double=0.0) const
 Get double resources value corresponding to the item. More...
 
bool getBoolean (const bool=false) const
 Get boolean resources value corresponding to the item. More...
 
QColor getColor (const QColor &=QColor()) const
 Get color resources value corresponding to the item. More...
 
QFont getFont (const QFont &=QFont()) const
 Get font resources value corresponding to the item. More...
 
QString getString (const QString &=QString()) const
 Get string resources value corresponding to the item. More...
 
void setInteger (const int)
 Set integer resources value corresponding to the item. More...
 
void setDouble (const double)
 Set double resources value corresponding to the item. More...
 
void setBoolean (const bool)
 Set boolean resources value corresponding to the item. More...
 
void setColor (const QColor &)
 Set color resources value corresponding to the item. More...
 
void setFont (const QFont &)
 Set font resources value corresponding to the item. More...
 
void setString (const QString &)
 Set string resources value corresponding to the item. More...
 
void sendItemChanges ()
 Initiate item changing call back operation. More...
 
virtual void triggerUpdate ()
 Initiate item updating. More...
 

Private Attributes

QtxBackgroundToolmyBgTool
 

Additional Inherited Members

- Static Public Member Functions inherited from QtxPageNamedPrefItem
static void adjustLabels (QtxPagePrefItem *)
 
- Static Public Member Functions inherited from QtxPreferenceItem
static int RTTI ()
 Specify unique item class identifier. More...
 
- Protected Types inherited from QtxPreferenceItem
typedef QList< QtxPreferenceItem * > ItemList
 

Detailed Description

GUI implementation of the resources item to store background data.

Preference item allows specifying background data in different ways:

  • solid color
  • texture image file
  • simple two-color gradient
  • complex custom gradient (NOT IMPLEMENTED YET)

Allowed background modes can be specified using setModeAllowed() method. Texture modes can be enabled/disabled using setTextureModeAllowed() method. Also, showing texture controls can be enabled/disabled by means of setTextureAllowed() method. Verical or horizontal orientation of the widget can be chosen via setOrientation() method (default orientation is horizontal).

Simple gradient types can be specified using setGradients() method.

See also
Qtx::BackgroundData, QtxBackgroundTool

Constructor & Destructor Documentation

◆ QtxPagePrefBackgroundItem()

QtxPagePrefBackgroundItem::QtxPagePrefBackgroundItem ( const QString &  title,
QtxPreferenceItem parent = 0,
const QString &  sect = QString(),
const QString &  param = QString() 
)

Constructor.

Parameters
titlepreference item title
parentparent preference item
sectresource file section associated with the preference item
paramresource file parameter associated with the preference item

References myBgTool, and QtxPageNamedPrefItem::setControl().

◆ ~QtxPagePrefBackgroundItem()

QtxPagePrefBackgroundItem::~QtxPagePrefBackgroundItem ( )
virtual

Destructor.

Member Function Documentation

◆ gradients()

void QtxPagePrefBackgroundItem::gradients ( QStringList &  gradList,
QIntList idList 
) const

Get allowed two-color gradients to the widget.

Parameters
gradientsgradients names are returned via this parameter
idsgradients identifiers are returned via this parameter (empty list can be returned)

References QtxBackgroundTool::gradients(), and myBgTool.

◆ imageFormats()

QString QtxPagePrefBackgroundItem::imageFormats ( ) const

Get allowed image formats.

Returns
image formats

References QtxBackgroundTool::imageFormats(), and myBgTool.

◆ isModeAllowed()

bool QtxPagePrefBackgroundItem::isModeAllowed ( Qtx::BackgroundMode  mode) const

Check if specific background mode is allowed.

Parameters
modebackground mode
Returns
true if specified background mode is enabled or false otherwise
See also
setModeAllowed()

References QtxBackgroundTool::isModeAllowed(), and myBgTool.

◆ isTextureAllowed()

bool QtxPagePrefBackgroundItem::isTextureAllowed ( ) const

Check if texture controls are allowed (shown)

Returns
true if texture controls are enabled or false otherwise
See also
setTextureAllowed(), setTextureModeAllowed()

References QtxBackgroundTool::isTextureAllowed(), and myBgTool.

◆ isTextureModeAllowed()

bool QtxPagePrefBackgroundItem::isTextureModeAllowed ( Qtx::TextureMode  mode) const

Check if specific texture mode is allowed.

Parameters
modetexture mode
Returns
true if specified texture mode is enabled or false otherwise
See also
setTextureModeAllowed(), setTextureAllowed()

References QtxBackgroundTool::isTextureModeAllowed(), and myBgTool.

◆ optionValue()

QVariant QtxPagePrefBackgroundItem::optionValue ( const QString &  name) const
protectedvirtual

Get preference item option value.

Parameters
nameoption name
Returns
property value or null QVariant if option is not set
See also
setOptionValue()

Reimplemented from QtxPreferenceItem.

References Qtx::CenterTexture, Qtx::ColorBackground, Qtx::CustomGradientBackground, gradients(), imageFormats(), isModeAllowed(), isTextureAllowed(), isTextureModeAllowed(), QtxPreferenceItem::optionValue(), orientation(), Qtx::SimpleGradientBackground, Qtx::StretchTexture, and Qtx::TileTexture.

◆ orientation()

Qt::Orientation QtxPagePrefBackgroundItem::orientation ( ) const

Get widget editor orientation.

Returns
orientation

References myBgTool, and QtxBackgroundTool::orientation().

◆ retrieve()

void QtxPagePrefBackgroundItem::retrieve ( )
virtual

Retrieve preference item from the resource manager.

See also
store()

Reimplemented from QtxPagePrefItem.

References QtxPreferenceItem::getString(), myBgTool, QtxBackgroundTool::setData(), and Qtx::stringToBackground().

◆ setGradients()

void QtxPagePrefBackgroundItem::setGradients ( const QStringList &  gradients,
const QIntList ids = QIntList() 
)

Set allowed two-color gradients to the widget.

Parameters
gradientsgradients names
idsoptional gradients identifiers; if not specified, gradients are automatically numbered starting from 0

References gradients(), myBgTool, and QtxBackgroundTool::setGradients().

◆ setImageFormats()

void QtxPagePrefBackgroundItem::setImageFormats ( const QString &  formats)

Set allowed image formats.

Parameters
formatsimage formats

References myBgTool, and QtxBackgroundTool::setImageFormats().

◆ setModeAllowed()

void QtxPagePrefBackgroundItem::setModeAllowed ( Qtx::BackgroundMode  mode,
bool  on 
)

Enable / disable specific background mode.

Parameters
modebackground mode
onenable / disable flag
See also
isModeAllowed()

References myBgTool, and QtxBackgroundTool::setModeAllowed().

◆ setOptionValue()

void QtxPagePrefBackgroundItem::setOptionValue ( const QString &  name,
const QVariant &  val 
)
protectedvirtual

◆ setOrientation()

void QtxPagePrefBackgroundItem::setOrientation ( Qt::Orientation  o)

Set widget editor orientation.

Parameters
oorientation

References myBgTool, and QtxBackgroundTool::setOrientation().

◆ setTextureAllowed()

void QtxPagePrefBackgroundItem::setTextureAllowed ( bool  on)

Enable / disable texture controls.

Parameters
onenable / disable flag (true by default)
See also
isTextureAllowed(), setTextureModeAllowed()

References myBgTool, and QtxBackgroundTool::setTextureAllowed().

◆ setTextureModeAllowed()

void QtxPagePrefBackgroundItem::setTextureModeAllowed ( Qtx::TextureMode  mode,
bool  on 
)

Enable / disable specific texture mode.

Parameters
modetexture mode
onenable / disable flag (true by default)
See also
isTextureModeAllowed(), setTextureAllowed()

References myBgTool, and QtxBackgroundTool::setTextureModeAllowed().

◆ store()

void QtxPagePrefBackgroundItem::store ( )
virtual

Store preference item to the resource manager.

See also
retrieve()

Reimplemented from QtxPagePrefItem.

References Qtx::backgroundToString(), QtxBackgroundTool::data(), myBgTool, and QtxPreferenceItem::setString().

Member Data Documentation

◆ myBgTool

QtxBackgroundTool* QtxPagePrefBackgroundItem::myBgTool
private

The documentation for this class was generated from the following files: