This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Some questions about KParts

Tags: None
(comma "," separated)
jiveaxe
Registered Member
Posts
8
Karma
0

Some questions about KParts

Tue Feb 23, 2010 5:29 pm
Hi,
I'm just new to KDE programming but have some experience with qt. Now, I'm just learning more about KDE api trying to create some extensions for konqueror to make it more attractive respect firefox/chrome. But I have to start from the basic... With my first attempt I have added a new entry in tools menu and a new button in toolbar; clicking on them an url is opened: all very simple!

Now, my questions:

1) to show the button in the toolbar I have used the customization dialog; is it possibible to show it automatically with plugin installation (like for menu)?

2)opening konqueror we got the welcome page (i don't know if this is its name) with an empty address line; if I click my new button konqueror doesn't open the url; if instead I first open a webpage (say a bookmark) than clicking on the new button opens the url. Why?

3) how can I open the url in a new tab or window? Maybe I have missed something in docs.

Here a little piece of my code (partly "stolen" from autorefresh plugin)

Code: Select all
void FirstPlugin::slotOpenLink()
{
    KParts::ReadOnlyPart *part = qobject_cast< KParts::ReadOnlyPart * >( parent() );
    if ( !part ) {
        QString title = i18n( "Cannot open url" );
        QString text = i18n( "<qt>This plugin cannot open the url.</qt>" );

        KMessageBox::error( 0, text, title );
    }
    else
    {
        part->openUrl(KUrl("http://www.kde.org"));
    }
}


Very thanks
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Some questions about KParts

Thu Feb 25, 2010 5:38 am
If you do not get a response, I would recommend asking in #kde-devel on IRC.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
jiveaxe
Registered Member
Posts
8
Karma
0

Re: Some questions about KParts

Thu Feb 25, 2010 7:49 am
Ok, I will try.

Thanks


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]