[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/formeditor
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2009-03-27 21:40:34
Message-ID: 1238190034.357340.12977.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 945654 by staniek:

Forms
- clean up, add blocks to ifs
- disable antialiasing in grid


 M  +2 -2      container.cpp  
 M  +8 -5      form.cpp  
 M  +2 -2      widgetfactory.cpp  


--- trunk/koffice/kexi/formeditor/container.cpp #945653:945654
@@ -429,7 +429,7 @@
                    && !connecting
             )
         { // draw the selection rect
-            if ((mev->buttons() != Qt::LeftButton) || /*m_inlineEditing*/ d->state \
== Private::InlineEditing) +            if ((mev->buttons() != Qt::LeftButton) || \
d->state == Private::InlineEditing)  return true;
             d->updateSelectionOrInsertingRectangle(mev->pos());
 /* moved
@@ -480,6 +480,7 @@
             return false;
         QPaintEvent* pe = static_cast<QPaintEvent*>(e);
         QPainter p(widget());
+        p.setRenderHint(QPainter::Antialiasing, false);
 #if 1 // grid
 #define DEBUG_PAINTER
 #ifdef DEBUG_PAINTER
@@ -669,7 +670,6 @@
         if (!w)
             return false;
 
-        //m_inlineEditing = true;
         d->state = Private::InlineEditing;
         d->form->library()->startEditing(w->metaObject()->className(), w, this);
         return true;
--- trunk/koffice/kexi/formeditor/form.cpp #945653:945654
@@ -1677,23 +1677,25 @@
             }
         }
 
-        if (property == "objectName")
+        if (property == "objectName") {
             emit widgetNameChanged(d->selected.first()->objectName().toLatin1(), \
p.value().toByteArray()); +        }
         d->selected.first()->setProperty(property, value);
         handleWidgetPropertyChanged(d->selected.first(), property, value);
     }
     else {
-        if (alterLastCommand && !d->isRedoing)
+        if (alterLastCommand && !d->isRedoing) {
             d->lastCommand->setValue(value);
+        }
         else {
             if (d->slotPropertyChanged_addCommandEnabled && !d->isRedoing) {
                 // We store old values for each widget
-                QHash<QByteArray, QVariant> list;
+                QHash<QByteArray, QVariant> oldValues;
                 foreach(QWidget* widget, d->selected) {
-                    list.insert(widget->objectName().toLatin1(), \
widget->property(property)); +                    \
oldValues.insert(widget->objectName().toLatin1(), widget->property(property));  }
 
-                d->lastCommand = new PropertyCommand(*this, list, value, property);
+                d->lastCommand = new PropertyCommand(*this, oldValues, value, \
property);  addCommand(d->lastCommand, false);
             }
         }
@@ -2979,6 +2981,7 @@
     }
 }
 
+//! @todo make it support undo
 void Form::saveEnabledProperty(bool value)
 {
     foreach(QWidget* widget, d->selected) {
--- trunk/koffice/kexi/formeditor/widgetfactory.cpp #945653:945654
@@ -429,7 +429,7 @@
     if (m_widget) {
         ObjectTreeItem *tree = m_container ? \
m_container->form()->objectTree()->lookup(m_widget->objectName()) : 0;  if (!tree) {
-            kDebug() << "error cannot found a tree item ";
+            kWarning() << "error cannot find tree item for name" << \
m_widget->objectName();  return;
         }
         tree->eventEater()->setContainer(m_container);
@@ -441,7 +441,7 @@
             }
         }
 
-        // disable again the widget
+        // disable again the widget if needed
         if (!ed && !tree->isEnabled()) {
 #ifdef __GNUC__
 #warning TODO port to Qt 4 if needed


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic