Eneboo - Documentación para desarrolladores
|
Base class for all property items. Más...
#include <propertyeditor.h>
Métodos públicos | |
PropertyItem (PropertyList *l, PropertyItem *after, PropertyItem *prop, const QString &propName) | |
~PropertyItem () | |
void | paintCell (QPainter *p, const QColorGroup &cg, int column, int width, int align) |
void | paintBranches (QPainter *p, const QColorGroup &cg, int w, int y, int h) |
void | paintFocus (QPainter *p, const QColorGroup &cg, const QRect &r) |
virtual bool | hasSubItems () const |
virtual void | createChildren () |
virtual void | initChildren () |
bool | isOpen () const |
void | setOpen (bool b) |
virtual void | showEditor () |
virtual void | hideEditor () |
virtual void | setValue (const QVariant &v) |
QVariant | value () const |
QString | name () const |
virtual void | notifyValueChange () |
virtual void | setChanged (bool b, bool updateDb=TRUE) |
bool | isChanged () const |
virtual void | placeEditor (QWidget *w) |
virtual PropertyItem * | propertyParent () const |
virtual void | childValueChanged (PropertyItem *child) |
void | addChild (PropertyItem *i) |
int | childCount () const |
PropertyItem * | child (int i) const |
virtual bool | hasCustomContents () const |
virtual void | drawCustomContents (QPainter *p, const QRect &r) |
void | updateBackColor () |
void | setup () |
virtual QString | currentItem () const |
virtual int | currentIntItem () const |
virtual void | setCurrentItem (const QString &s) |
virtual void | setCurrentItem (int i) |
virtual int | currentIntItemFromObject () const |
virtual QString | currentItemFromObject () const |
void | setFocus (QWidget *w) |
virtual void | toggle () |
void | setText (int col, const QString &txt) |
Atributos protegidos | |
PropertyList * | listview |
QVariant | val |
Base class for all property items.
This is the base class for each property item for the PropertyList. A simple property item has just a name and a value to provide an editor for a datatype. But more complex datatypes might provide an expandable item for editing single parts of the datatype. See hasSubItems(), initChildren() for that.
PropertyItem::PropertyItem | ( | PropertyList * | l, |
PropertyItem * | after, | ||
PropertyItem * | prop, | ||
const QString & | propName | ||
) |
If this item should be a child of another property item, specify prop as the parent item.
PropertyItem::~PropertyItem | ( | ) |
void PropertyItem::addChild | ( | PropertyItem * | i | ) |
When adding a child item, call this (normally from addChildren()
PropertyItem * PropertyItem::child | ( | int | i | ) | const |
int PropertyItem::childCount | ( | ) | const |
Returns how many children this item has. The count only includes the item's immediate children.
Reimplementado de QListViewItem.
void PropertyItem::childValueChanged | ( | PropertyItem * | child | ) | [virtual] |
If a subclass is a expandable item reimplement this as this is always called if a child item changed its value. So update the display of the item here then.
Reimplementado en PropertyTextItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertySizePolicyItem y PropertyDatabaseItem.
void PropertyItem::createChildren | ( | ) | [virtual] |
If a subclass is a expandable item, this is called when the child items should be created.
Reimplementado en PropertyTextItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertySizePolicyItem y PropertyDatabaseItem.
int PropertyItem::currentIntItem | ( | ) | const [virtual] |
Reimplementado en PropertyListItem.
int PropertyItem::currentIntItemFromObject | ( | ) | const [virtual] |
Reimplementado en PropertyListItem.
QString PropertyItem::currentItem | ( | ) | const [virtual] |
Reimplementado en PropertyListItem y PropertyEnumItem.
QString PropertyItem::currentItemFromObject | ( | ) | const [virtual] |
Reimplementado en PropertyListItem y PropertyEnumItem.
Reimplementado en PropertyColorItem, PropertyPixmapItem y PropertyPaletteItem.
bool PropertyItem::hasCustomContents | ( | ) | const [virtual] |
If the contents of the item is not displayable with a text, but you want to draw it yourself (using drawCustomContents()), return TRUE here.
Reimplementado en PropertyColorItem, PropertyPixmapItem y PropertyPaletteItem.
bool PropertyItem::hasSubItems | ( | ) | const [virtual] |
Subclasses which are expandable items have to return TRUE here. Default is FALSE.
Reimplementado en PropertyTextItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertySizePolicyItem y PropertyDatabaseItem.
void PropertyItem::hideEditor | ( | ) | [virtual] |
Subclasses have to hide the editor of the item here
Reimplementado en PropertyTextItem, PropertyBoolItem, PropertyIntItem, PropertyLayoutItem, PropertyDoubleItem, PropertyListItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertyPixmapItem, PropertySizePolicyItem, PropertyPaletteItem, PropertyCursorItem, PropertyKeysequenceItem, PropertyDatabaseItem, PropertyEnumItem, PropertyDateItem, PropertyTimeItem y PropertyDateTimeItem.
void PropertyItem::initChildren | ( | ) | [virtual] |
If a subclass is a expandable item, this is called when the child items should be initialized.
Reimplementado en PropertyTextItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertySizePolicyItem y PropertyDatabaseItem.
bool PropertyItem::isChanged | ( | ) | const |
bool PropertyItem::isOpen | ( | ) | const |
Returns TRUE if this list view item has children and they are not explicitly hidden; otherwise returns FALSE.
Reimplementado de QListViewItem.
QString PropertyItem::name | ( | ) | const |
void PropertyItem::notifyValueChange | ( | ) | [virtual] |
This should be called by subclasses if the user changed the value of the property and this value should be applied to the widget property
void PropertyItem::paintBranches | ( | QPainter * | p, |
const QColorGroup & | cg, | ||
int | w, | ||
int | y, | ||
int | h | ||
) | [virtual] |
Paints a set of branches from this item to (some of) its children.
Painter p is set up with clipping and translation so that you can only draw in the rectangle that needs redrawing; cg is the color group to use; the update rectangle is at (0, 0) and has size width w by height h. The top of the rectangle you own is at y (which is never greater than 0 but can be outside the window system's allowed coordinate range).
The update rectangle is in an undefined state when this function is called; this function must draw on all of the pixels.
Reimplementado de QListViewItem.
void PropertyItem::paintCell | ( | QPainter * | p, |
const QColorGroup & | cg, | ||
int | column, | ||
int | width, | ||
int | align | ||
) | [virtual] |
This virtual function paints the contents of one column of an item and aligns it as described by align.
p is a QPainter open on the relevant paint device. p is translated so (0, 0) is the top-left pixel in the cell and width-1, height()-1 is the bottom-right pixel in the cell. The other properties of p (pen, brush, etc) are undefined. cg is the color group to use. column is the logical column number within the item that is to be painted; 0 is the column which may contain a tree.
This function may use QListView::itemMargin() for readability spacing on the left and right sides of data such as text, and should honor isSelected() and QListView::allColumnsShowFocus().
If you reimplement this function, you should also reimplement width().
The rectangle to be painted is in an undefined state when this function is called, so you must draw on all the pixels. The painter p has the right font on entry.
Reimplementado de QListViewItem.
void PropertyItem::paintFocus | ( | QPainter * | p, |
const QColorGroup & | cg, | ||
const QRect & | r | ||
) | [virtual] |
Paints a focus indicator on the rectangle r using painter p and colors cg.
p is already clipped.
Reimplementado de QListViewItem.
void PropertyItem::placeEditor | ( | QWidget * | w | ) | [virtual] |
Call this to place/resize the item editor correctly (normally call it from showEditor())
PropertyItem * PropertyItem::propertyParent | ( | ) | const [virtual] |
Returns the parent property item here if this is a child or 0 otherwise.
Reimplementado en PropertyTextItem.
void PropertyItem::setCurrentItem | ( | int | i | ) | [virtual] |
Reimplementado en PropertyListItem.
void PropertyItem::setCurrentItem | ( | const QString & | s | ) | [virtual] |
Reimplementado en PropertyListItem.
void PropertyItem::setFocus | ( | QWidget * | w | ) |
void PropertyItem::setOpen | ( | bool | o | ) | [virtual] |
Opens or closes an item, i.e. shows or hides an item's children.
If o is TRUE all child items are shown initially. The user can hide them by clicking the - icon to the left of the item. If o is FALSE, the children of this item are initially hidden. The user can show them by clicking the + icon to the left of the item.
Reimplementado de QListViewItem.
Sets the text in column column to text, if column is a valid column number and text is different from the existing text.
If text() has been reimplemented, this function may be a no-op.
Reimplementado de QListViewItem.
void PropertyItem::setup | ( | void | ) | [inline, virtual] |
This virtual function is called before the first time QListView needs to know the height or any other graphical attribute of this object, and whenever the font, GUI style, or colors of the list view change.
The default calls widthChanged() and sets the item's height to the height of a single line of text in the list view's font. (If you use icons, multi-line text, etc., you will probably need to call setHeight() yourself or reimplement it.)
Reimplementado de QListViewItem.
void PropertyItem::setValue | ( | const QVariant & | v | ) | [virtual] |
This is called to init the value of the item. Reimplement in subclasses to init the editor
Reimplementado en PropertyTextItem, PropertyBoolItem, PropertyIntItem, PropertyLayoutItem, PropertyDoubleItem, PropertyListItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertyPixmapItem, PropertySizePolicyItem, PropertyPaletteItem, PropertyCursorItem, PropertyKeysequenceItem, PropertyDatabaseItem, PropertyEnumItem, PropertyDateItem, PropertyTimeItem y PropertyDateTimeItem.
void PropertyItem::showEditor | ( | ) | [virtual] |
Subclasses have to show the editor of the item here
Reimplementado en PropertyTextItem, PropertyBoolItem, PropertyIntItem, PropertyLayoutItem, PropertyDoubleItem, PropertyListItem, PropertyFontItem, PropertyCoordItem, PropertyColorItem, PropertyPixmapItem, PropertySizePolicyItem, PropertyPaletteItem, PropertyCursorItem, PropertyKeysequenceItem, PropertyDatabaseItem, PropertyEnumItem, PropertyDateItem, PropertyTimeItem y PropertyDateTimeItem.
void PropertyItem::toggle | ( | ) | [virtual] |
Reimplementado en PropertyBoolItem.
void PropertyItem::updateBackColor | ( | ) |
QVariant PropertyItem::value | ( | ) | const |
PropertyList* PropertyItem::listview [protected] |
QVariant PropertyItem::val [protected] |