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

List:       ktexteditor-devel
Subject:    Re: KTextEditor container extension
From:       Joseph Wenninger <jowenn () kde ! org>
Date:       2007-08-03 13:46:33
Message-ID: 200708031546.33981.jowenn () kde ! org
[Download RAW message or body]

On Friday 03 August 2007 12:53, Philippe Fremy wrote:
> Joseph Wenninger wrote:
[..]
> You mean that we should manage a list of all the container object that
> have been set ?

No, but I don't see another way with your current code

> > This would have the advantage that the developer of the host application
> > could do
> >
> > class MyExtensionClass: public QObject, public
> > KTextEditor::MultiDocMultiViewContainer,public
> > KTextEditor::SomeOtherContainerFeatures{
> > Q_OBJECT
> > Q_INTERFACE("org.kde.KTextEditor.MultiDocMultiViewContainer")
> > Q_INTERFACE("org.kde.KTextEditor.SomeOtherContainerFeatures")
> > }
> >
> > The kpart could check (m_set_container is the internal pointer set by
> > setContainer)
> > KTextEditor::MultiDocMultiViewContainer
> > *mdmvc=qobject_cast<KTextEditor::MultiDocMultiViewContainer*>(this->m_set
> >_container); if (mdmvc) {
> > 	do something with it
> > }
> >
> > KTextEditor::SomeOtherContainerFeatures
> > *socf=qobject_cast<KTextEditor::SomeOtherContainerFeatures*>(this->m_set_
> >container); if (socf) {
> > 	do something with it
> > }
>
> That's exactly the goal I am trying to reach. If the current code
> proposal does not allow this, we should fix it.

If you have:
MultiDocMultiViewContainer  extends Container extends QObject
and
SomeOtherContainerFeatures  extends Container extends QObject

You can't do:
MyImplementation extends MultiDocMultiViewContainer AND 
SomeOtherContainerFeatures

because you can't inherit from QObject __2 times__

If you take out the QObject from the inheritance line of the containers and 
force implementor to use QObject or QWidget or something like that by having 
setContainer(Object*) you can use signals/slots AND have multiple inheritance 
at the same time.

I'd drop the Container class itself all in all

Kind regards
Joseph Wenninger
_______________________________________________
KTextEditor-Devel mailing list
KTextEditor-Devel@kde.org
https://mail.kde.org/mailman/listinfo/ktexteditor-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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