20#include "kexicustompropertyfactory_p.h"
22#include <tqlineedit.h>
24#include <koproperty/property.h>
25#include <kexiutils/identifier.h>
27using namespace KoProperty;
29KexiImagePropertyEdit::KexiImagePropertyEdit(
30 Property *property, TQWidget *parent,
const char *name)
31 : PixmapEdit(property, parent, name)
36KexiImagePropertyEdit::~KexiImagePropertyEdit()
40void KexiImagePropertyEdit::selectPixmap()
42 TQString fileName( PixmapEdit::selectPixmapFileName() );
43 if (fileName.isEmpty())
46 setValue((uint)h.id());
48 if(!m_manager->activeForm() || !property())
51 ObjectTreeItem *item = m_manager->activeForm()->objectTree()->lookup(m_manager->activeForm()->selectedWidget()->name());
52 TQString name = item ? item->pixmapName(property()->name()) :
"";
54 if(dialog.exec() == TQDialog::Accepted) {
55 setValue(dialog.pixmap(),
true);
56 item->setPixmapName(property()->name(), dialog.pixmapName());
61TQVariant KexiImagePropertyEdit::value()
const
66void KexiImagePropertyEdit::setValue(
const TQVariant &value,
bool emitChange)
72void KexiImagePropertyEdit::drawViewer(TQPainter *p,
const TQColorGroup &cg,
const TQRect &r,
73 const TQVariant &value)
76 PixmapEdit::drawViewer(p, cg, r, h.pixmap());
81KexiIdentifierPropertyEdit::KexiIdentifierPropertyEdit(
82 Property *property, TQWidget *parent,
const char *name)
83 : StringEdit(property, parent, name)
89KexiIdentifierPropertyEdit::~KexiIdentifierPropertyEdit()
93void KexiIdentifierPropertyEdit::setValue(
const TQVariant &value,
bool emitChange)
95 TQString string(value.toString());
96 if (
string.isEmpty()) {
97 kdWarning() <<
"KexiIdentifierPropertyEdit::setValue(): "
98 "Value cannot be empty. This call has no effect." << endl;
102 if (identifier!=
string)
103 kdDebug() << TQString(
"KexiIdentifierPropertyEdit::setValue(): "
104 "String \"%1\" converted to identifier \"%2\".").arg(
string).arg(identifier) << endl;
105 StringEdit::setValue( identifier, emitChange );
108#include "kexicustompropertyfactory_p.moc"
Object handle used by KexiBLOBBuffer.
static KexiBLOBBuffer * self()
Access to KexiBLOBBuffer singleton.
Validates input for identifier name.
A dialog to choose an icon in a PixmapCollection.
KEXIUTILS_EXPORT TQString string2Identifier(const TQString &s)