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

List:       ktexteditor-devel
Subject:    Re: KTextEditor container extension
From:       Philippe Fremy <phil () freehackers ! org>
Date:       2007-08-03 10:53:11
Message-ID: 46B30917.8040201 () freehackers ! org
[Download RAW message or body]

Joseph Wenninger wrote:
> Hi !
> 
> Is it really needed to have a 	Containerbaseclass, which inherits QObject ?
> 
> I'd drop the base class and change the signature to setContainer(QObject*)
> Don't derive the interfaces from one base class Container.

Good idea. I prefer that to having an empty QObject.


> If yes than I think it would be better to name the Method addContainer. 
> Otherwise you can only set one extension with one interface.

You mean that we should manage a list of all the container object that
have been set ?

> 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.


	Philippe

_______________________________________________
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