SVN commit 1110344 by staniek: Forms *make the Spring element transparent and like antialiased *hide Spring element and autofield widget (will be back in 2.3) M +2 -0 CMakeLists.txt M +1 -1 formeditor/CMakeLists.txt M +13 -3 formeditor/factories/stdwidgetfactory.cpp M +1 -1 formeditor/form.cpp M +5 -2 formeditor/formIO.cpp M +6 -2 formeditor/spring.cpp --- trunk/koffice/kexi/CMakeLists.txt #1110343:1110344 @@ -16,6 +16,8 @@ -DKEXI_SCRIPTS_SUPPORT # temporary for 2.2: -DKEXI_NO_AUTOFIELD_WIDGET + -DKEXI_NO_FORM_SPRING_ELEMENT + -DKEXI_NO_OBJECTTREEVIEW ) #no default: add_definitions(-DKDE_DEFAULT_DEBUG_AREA=44010) --- trunk/koffice/kexi/formeditor/CMakeLists.txt #1110343:1110344 @@ -24,7 +24,7 @@ FormWidget.cpp FormWidgetInterface.cpp objecttreeview.cpp - spring.cpp +#todo spring.cpp commands.cpp events.cpp richtextdialog.cpp --- trunk/koffice/kexi/formeditor/factories/stdwidgetfactory.cpp #1110343:1110344 @@ -54,7 +54,9 @@ #include #include -#include "spring.h" +#ifndef KEXI_NO_FORM_SPRING_ELEMENT +# include "spring.h" +#endif #include "formIO.h" #include "form.h" #include "widgetlibrary.h" @@ -230,6 +232,7 @@ wLineEdit->setDescription(i18n("A widget to input text")); addClass(wLineEdit); +#ifndef KEXI_NO_FORM_SPRING_ELEMENT KFormDesigner::WidgetInfo *wSpring = new KFormDesigner::WidgetInfo(this); wSpring->setPixmap("spring"); wSpring->setClassName("Spring"); @@ -244,6 +247,7 @@ wSpring->setInternalProperty("orientationSelectionPopup:horizontalText", i18n("Insert &Horizontal Spring")); wSpring->setInternalProperty("orientationSelectionPopup:verticalText", i18n("Insert &Vertical Spring")); addClass(wSpring); +#endif KFormDesigner::WidgetInfo *wPushButton = new KFormDesigner::WidgetInfo(this); wPushButton->setPixmap("button"); @@ -540,6 +544,7 @@ w = new Line(options & WidgetFactory::VerticalOrientation ? Qt::Vertical : Qt::Horizontal, p); +#ifndef KEXI_NO_FORM_SPRING_ELEMENT else if (c == "Spring") { w = new Spring(p); if (0 == (options & WidgetFactory::AnyOrientation)) @@ -547,6 +552,7 @@ (options & WidgetFactory::VerticalOrientation) ? Qt::Vertical : Qt::Horizontal); } +#endif if (w) { w->setObjectName(n); @@ -958,9 +964,13 @@ || property == "geometry" /*nonsense for toplevel widget*/) return false; } else if (classname == "CustomWidget") { - } else if (classname == "Spring") { + } +#ifndef KEXI_NO_FORM_SPRING_ELEMENT + else if (classname == "Spring") { return Spring::isPropertyVisible(property); - } else if (classname == "KexiPictureLabel") { + } +#endif + else if (classname == "KexiPictureLabel") { if ((property == "text") || (property == "indent") || (property == "textFormat") || (property == "font") || (property == "alignment")) return false; } else if (classname == "QLabel") { --- trunk/koffice/kexi/formeditor/form.cpp #1110343:1110344 @@ -45,9 +45,9 @@ #include "objecttree.h" //unused #include "widgetpropertyset.h" #include "formIO.h" +#include "FormWidgetInterface.h" //unused #include "formmanager.h" #include "widgetlibrary.h" -#include "spring.h" #include "events.h" #include "utils.h" #include "form.h" --- trunk/koffice/kexi/formeditor/formIO.cpp #1110343:1110344 @@ -50,7 +50,9 @@ #include "objecttree.h" //unused #include "formmanager.h" #include "widgetlibrary.h" -#include "spring.h" +#ifndef KEXI_NO_FORM_SPRING_ELEMENT +# include "spring.h" +#endif #include "events.h" #include "utils.h" #include "widgetwithsubpropertiesinterface.h" @@ -927,12 +929,13 @@ return; kDebug() << item->className() << item->widget()->objectName(); bool savedAlignment = false; +#ifndef KEXI_NO_FORM_SPRING_ELEMENT // we let Spring class handle saving itself if (item->className() == "Spring") { Spring::saveSpring(item, parent, domDoc, insideGridLayout); return; } - +#endif bool resetCurrentForm = false; m_currentItem = item; if (!m_currentForm) { // copying widget --- trunk/koffice/kexi/formeditor/spring.cpp #1110343:1110344 @@ -40,6 +40,9 @@ { m_orient = Qt::Horizontal; setSizeType(QSizePolicy::Expanding); + QPalette pal(palette()); + pal.setColor(backgroundRole(), Qt::transparent); + setPalette(pal); } Spring::~Spring() @@ -80,8 +83,9 @@ return; QPainter p(this); - if (!ev->erased()) - p.eraseRect(0, 0, width(), height()); + p.setRenderHint(QPainter::Antialiasing, true); +//2.x if (!ev->erased()) +//2.x p.eraseRect(0, 0, width(), height()); //todo? p.setPen(QPen(Qt::white, 1)); //todo? p.setCompositionMode(QPainter::CompositionMode_Xor); if (m_orient == Qt::Vertical) {