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

List:       koffice
Subject:    once again: diffs for kpresenter
From:       Vojtech Bubnik <bubnikv () suse ! cz>
Date:       2000-09-06 13:07:10
[Download RAW message or body]

On Wed, Sep 06, 2000 at 11:50:58AM +0200, Simon Hausmann wrote:
> Just one comment: I think making KPObject inherit from QObject is too expensive
> (think of a huge presentation with lots of objects) , just for one slot..
> 
> I rather would make KPPartObject multiply inherit from KPObject and
> from QObject. Should work like a charm and save resources :-)

Done this way. 

-- 

Regards, 

Vojtech Bubnik
developer
---------------------------------------------------------------------
SuSE CR, s.r.o.                               e-mail: bubnikv@suse.cz
Pod Pekarnami 338/12                          tel:+420 2 6603 2619
190 00 Praha 9 - Vysocany                     fax:+420 2 6603 2620
Czech Republic                                http://www.suse.cz


["kpresenter-0906.dif" (text/plain)]

Index: koffice/kpresenter//kppartobject.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kppartobject.cc,v
retrieving revision 1.29
diff -b -u -p -r1.29 kppartobject.cc
--- koffice/kpresenter//kppartobject.cc	2000/08/26 09:53:37	1.29
+++ koffice/kpresenter//kppartobject.cc	2000/09/06 13:02:42
@@ -225,6 +225,16 @@ void KPPartObject::draw( QPainter *_pain
 }
 
 /*================================================================*/
+void KPPartObject::slot_changed(KoChild *child)
+{
+    QRect g = child->geometry();
+    KPObject::setOrig( g.x(), g.y() );
+    KPObject::setSize( g.width(), g.height() );
+    if ( fillType == FT_GRADIENT && gradient )
+        gradient->setSize( g.size() );
+}
+
+/*================================================================*/
 void KPPartObject::paint( QPainter *_painter )
 {
     if ( !_enableDrawing ) return;
@@ -495,3 +505,5 @@ void KPPartObject::load( KOMLParser& par
         }
     }
 }
+
+#include "kppartobject.moc"
Index: koffice/kpresenter//kppartobject.h
===================================================================
RCS file: /home/kde/koffice/kpresenter/kppartobject.h,v
retrieving revision 1.16
diff -b -u -p -r1.16 kppartobject.h
--- koffice/kpresenter//kppartobject.h	2000/08/26 09:53:37	1.16
+++ koffice/kpresenter//kppartobject.h	2000/09/06 13:02:43
@@ -21,6 +21,7 @@
 #define kppartobject_h
 
 #include <koMainWindow.h>
+#include <koChild.h>
 
 #include "kpobject.h"
 
@@ -34,8 +35,9 @@ class KPGradient;
 /* Class: KPPartObject                                            */
 /******************************************************************/
 
-class KPPartObject : public KPObject
+class KPPartObject : public QObject, public KPObject
 {
+    Q_OBJECT
 public:
     KPPartObject( KPresenterChild *_child );
     virtual ~KPPartObject();
@@ -100,6 +102,9 @@ public:
     KPresenterChild *getChild() { return child; }
 
     void enableDrawing( bool f ) { _enableDrawing = f; }
+
+public slots:
+    void slot_changed(KoChild *child);
 
 protected:
     void paint( QPainter *_painter );
Index: koffice/kpresenter//kpresenter_doc.cc
===================================================================
RCS file: /home/kde/koffice/kpresenter/kpresenter_doc.cc,v
retrieving revision 1.236
diff -b -u -p -r1.236 kpresenter_doc.cc
--- koffice/kpresenter//kpresenter_doc.cc	2000/08/31 07:04:00	1.236
+++ koffice/kpresenter//kpresenter_doc.cc	2000/09/06 13:02:50
@@ -267,7 +267,7 @@ KPresenterDoc::KPresenterDoc( QWidget *p
 
     saveOnlyPage = -1;
 
-    QObject::connect( &_commands, SIGNAL( undoRedoChanged( QString, QString ) ),
+    QWidget::connect( &_commands, SIGNAL( undoRedoChanged( QString, QString ) ),
                       this, SLOT( slotUndoRedoChanged( QString, QString ) ) );
 
 
@@ -1368,6 +1368,7 @@ void KPresenterDoc::insertObject( const 
     kppartobject->setOrig( _rect.x() + _diffx, _rect.y() + _diffy );
     kppartobject->setSize( _rect.width(), _rect.height() );
     kppartobject->setSelected( true );
+    QWidget::connect(ch, SIGNAL(changed(KoChild *)), kppartobject, SLOT(slot_changed(KoChild *)) );
 
     InsertCmd *insertCmd = new InsertCmd( i18n( "Embed Object" ), kppartobject, this );
     insertCmd->execute();


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

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