23#include "editoritem.h"
29#include <tdelistview.h>
41 , leaveTheSpaceForRevertButton(false)
51 bool leaveTheSpaceForRevertButton : 1;
58Widget::Widget(
Property *property, TQWidget *parent,
const char *name)
59 : TQWidget(parent,
name)
61 d =
new WidgetPrivate();
62 d->property = property;
74 return d ? d->property : 0;
92 rect.setLeft(rect.left()+KPROPEDITOR_ITEM_MARGIN);
97 p->drawText(rect, TQt::AlignLeft | TQt::AlignVCenter | TQt::SingleLine,
value.toString());
104 d->property->resetValue();
110 if(e->type() == TQEvent::KeyPress)
112 TQKeyEvent* ev =
static_cast<TQKeyEvent*
>(e);
113 if(ev->key() == Key_Escape)
115 emit rejectInput(
this);
118 else if((ev->key() == Key_Return) || (ev->key() == Key_Enter))
121 emit acceptInput(
this);
128 return list->handleKeyPress(ev);
155 if (focusProxy->focusPolicy() != TQWidget::NoFocus)
156 setFocusProxy(focusProxy);
157 focusProxy->installEventFilter(
this);
159 else if (this->focusProxy()) {
160 this->focusProxy()->removeEventFilter(
this);
168 return d->leaveTheSpaceForRevertButton;
172Widget::setLeavesTheSpaceForRevertButton(
bool set)
174 d->leaveTheSpaceForRevertButton = set;
178Widget::setHasBorders(
bool set)
186 return d->hasBorders;
190Widget::setEditor(TQWidget* editor)
195 d->editor->setSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Fixed);
196 d->editor->move(0,0);
200Widget::resizeEvent(TQResizeEvent *e)
202 TQWidget::resizeEvent(e);
204 d->editor->resize(size());
216 d->readOnly = readOnly;
221Widget::visibleFlag()
const
223 return d->visibleFlag;
229 d->visibleFlag = visible;
A listview to edit properties Editor widgets use property options using Property::option(const char *...
The base class representing a single property.
const char * name(StdAction id)
Namespace for a set of classes implementing generic properties framework.