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

List:       kde-devel
Subject:    Re: KTabWidget, KParts, autoconf
From:       Mario <tweakBSD () gmx ! net>
Date:       2004-08-04 9:38:37
Message-ID: 200408041138.37103.tweakBSD () gmx ! net
[Download RAW message or body]

Am Mittwoch, 4. August 2004 11:15 schrieb ben:
> Hi,
> I'm new to the kde API and I'm trying to do something simple: a tabbed
> text editor with KParts.
> Here is what I do:
> 1)derive my main window class from KParts::MainWindow
>
> 2)In the constructor of my main class, I create:
>   -a factory for the text editor(kate)
>   -a KTabWidget as the centralWidget
>   -an instance of PartManager with the KTabWidget as parent
> Then I do a addMyActions/setXMLFile/createGui(0).
>
> 3)Each time an user wants to open a file, I:
>   -create a ReadWritePart with my factory
>   -add part->widget() to a tab with addTab
>   -active the tab with tabWidget->setCurrentPage(tabWidget->count()-1)
>   -call createGUI(part);
>   -add the new part to my PartManager
>   -open the file with part->openURL
>
> Everything seems to work but I have some questions:
> 1)First, do I misuse something?
> 2)How to add a close button to a tab(like in kdevelop) or to the
> TabWidget(like in konqueror, the close button on the right)?
> tabWidget->setHoverCloseButton(true) doesn't seem to work for me.

You can use Mdi classes to let your app show everything in tabs, like kdevelop
or kmldonkey and those tabs have a close button, it is possible to select 
several Mdi Modes which is great. I do this in tweakBSD. Have a look at the 
KMdi Documentation.

> 3)I use the kde autoconf system, I have set METASOURCE to auto, but
> instead of producing mainwindow.moc the system output mainwindow.moc.cc
> so I don't put an #include "mainwindow.moc" in my mainwindow.cc and
> everything compile and link. I don't know if it's the good behaviour...
>
> I have probably forgotten a lot of questions, but it should be enough
> for a first post :)
>
> Thank you for reading.
> --
> Ben
>
> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

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