DCOP and slots

Ravi ravi at kde.org
Mon Jan 12 23:14:51 GMT 2004


Hello,
  How do I create DCOP functions (without inheritance) which are also slots? 
Here is a short example of what I want to do:

class MyClass : public QObject, virtual public DCOPObject
{
  Q_OBJECT
  K_DCOP
  [constructors, etc. omitted]
  // k_dcop: ???
public slots:
  void changeName(const QString &name) { doChangeName( name ); }
protected:
  virtual void doChangeName(const QString &name);
};

This is an example of a nonvirtual interface (referred to in a recent thread 
in this mailing list: http://www.gotw.ca/publications/mill18.htm was quoted 
as an exposition). I would like changeName() to not only be a slot, but also 
be a DCOP function. In this case, I cannot make an abstract class with a pure 
virtual changeName() function as it would defeat the purpose of the 
nonvirtual interface. How do I combine slots and k_dcop?

Regards,
Ravi





More information about the kde-core-devel mailing list