CVS commit by segfault: Added a new replacement for QLabels in Form Designer. This special label is capable of placing a drop shadow below the text. This shadow can be toggled on or off. Together with the new background gradients very nice effects are possible. CCMAIL: dkite@shaw.ca FEATURE A plugins/forms/kexilabel.cpp 1.1 [LGPL (v2+)] A plugins/forms/kexilabel.h 1.1 [LGPL (v2+)] M +1 -1 data/kexiformpartinstui.rc 1.13 M +1 -1 plugins/forms/Makefile.am 1.18 M +20 -1 plugins/forms/kexidbfactory.cpp 1.17 --- koffice/kexi/data/kexiformpartinstui.rc #1.12:1.13 @@ -38,5 +38,5 @@ - + --- koffice/kexi/plugins/forms/Makefile.am #1.17:1.18 @@ -15,5 +15,5 @@ kexidbwidgets_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module -kexidbwidgets_la_SOURCES = kexidbfactory.cpp +kexidbwidgets_la_SOURCES = kexidbfactory.cpp kexilabel.cpp kexidbwidgets_la_LIBADD = $(top_builddir)/kexi/formeditor/libkformdesigner.la --- koffice/kexi/plugins/forms/kexidbfactory.cpp #1.16:1.17 @@ -35,10 +35,11 @@ #include #include +#include #include "kexidbform.h" #include "kexiformview.h" +#include "kexilabel.h" #include "kexidbfactory.h" -#include "formmanager.h" KexiSubForm::KexiSubForm(KFormDesigner::FormManager *manager, QWidget *parent, const char *name) @@ -153,4 +154,15 @@ KexiDBFactory::KexiDBFactory(QObject *pa m_classes.append(wLineEdit); + /* @todo allow to inherit from stdwidgets' KLineEdit */ + KFormDesigner::WidgetInfo *wLabel = new KFormDesigner::WidgetInfo(this); + wLabel->setPixmap("label"); + wLabel->setClassName("KexiLabel"); + wLabel->addAlternateClassName("QLabel", true/*override*/); + wLabel->setIncludeFileName("qlabel.h"); + wLabel->setName(i18n("Text Label")); + wLabel->setNamePrefix(i18n("Widget name (see above)", "Label")); + wLabel->setDescription(i18n("A widget to display text")); + m_classes.append(wLabel); + m_propDesc["dataSource"] = i18n("Data source"); m_propDesc["formName"] = i18n("Form name"); @@ -173,4 +185,5 @@ KexiDBFactory::create(const QCString &c, QWidget *w=0; + QString text = container->form()->manager()->lib()->textForWidgetName(n, c); if(c == "KexiSubForm") @@ -183,4 +196,8 @@ KexiDBFactory::create(const QCString &c, w->setCursor(QCursor(Qt::ArrowCursor)); } + else if(c == "KexiLabel") + { + w = new KexiLabel(text, p, n); + } return w; @@ -217,4 +234,6 @@ KexiDBFactory::clearWidgetContent(const if(classname == "KexiDBLineEdit") static_cast(w)->clear(); + if(classname == "KexiLabel") + static_cast(w)->clear(); }