You are not logged in.

Dear visitor, welcome to KDE-Forum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, June 29th 2004, 2:24pm

complete url getter

Hello there.

How can i capture in a string the complete url adress of a link, when the mouse rolls on it?

I used the "completeURL" function, but it's old now, and doesn't work anymore. It's became protected in the new version of qt.

Thanks!

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

2

Tuesday, June 29th 2004, 2:52pm

Can you give a little more information?

Which widget are you talking about?

Cheers,
_
Qt/KDE Developer
Debian User

f_edemar

Beginner

Posts: 14

Location: Sweden

  • Send private message

3

Tuesday, June 29th 2004, 3:03pm

When I search for "completeURL +qt" in Google, I found this:
http://webcvs.kde.org/cgi-bin/cvsweb.cgi….html?rev=1.56.

This thread should be moved to "KDE Development ".

hatulflezet

Beginner

Posts: 14

Location: Germany

Occupation: Programmer

  • Send private message

4

Tuesday, June 29th 2004, 3:15pm

Quoted

This thread should be moved to "KDE Development ".


Why??
Click here! I dare ya'!! :]
Project Archimedes
----------------------------------------------------------
"Don't panic, and thanks for all the fish!"

anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

5

Tuesday, June 29th 2004, 4:18pm

Quoted

Originally posted by hatulflezet

Quoted

This thread should be moved to "KDE Development ".


Why??

If f_edemar is correct, FreeBook's question is about a method of KHTMLPart.

We'll wait for FreeBook to return and clarify that, if it is indeed a question about KHTMLPart, I will move the thread.

Cheers,
_
Qt/KDE Developer
Debian User

6

Wednesday, June 30th 2004, 11:04am

KHTMLPart

My question is about a method of KHTMLPart.
About the Widget... well i don't know how to answer the question.
I've got this:


/*
* We connect the signal onUrl of the new part
* to the slotCursoirOnUrl slot, so that the part can
* acknowledge that laprt is on a url.
*/
connect(khtmlpart,
SIGNAL(onURL(const QString &)),
this,
SLOT(slotCursorOnUrl(const QString &)));



void KGenerator::slotCursorOnUrl(const QString & url) {
cout << "in KGenerator::slotCursorOnUrl, the destination url is: " << urlDestination << "\n"<< endl;
delete urlDestination;
urlDestination = new QString(url);
cout << "It then becomes: " << urlDestination << "\n"<< endl;
statusBar()->changeItem(*urlDestination,0);
}



/**
*
*
*/
void KGenerator::slotForbiddenLink() {
if ( *urlDestination != QString::null) {
KHTMLPart * khtmlpart = NULL;
if ((khtmlpart = returnActiveFrame())) {
forbiddenLinkList->insertItem((completeURL(*urlDestination)).prettyURL());
// khtmlpart->openURL(*urlDestination);
// forbiddenLinkList->insertItem((khtmlpart->url()).prettyURL());
} else {
cout << "mistake with forbidden url" << endl;
}
}
}

The problem is that the completeURL method is protected... so we can't build this code.

What i want to do is manage to insert a complete url into our list. (by complete url, i mean the full url "http:\\www.blabla....\newThing.html" and not only "\newThing.html"

Thanks again!

f_edemar

Beginner

Posts: 14

Location: Sweden

  • Send private message

7

Wednesday, June 30th 2004, 12:32pm

RE: KHTMLPart

maybe something like

Source code

1
QString url = khtmlpart->htmlDocument( )->completeURL(  new QString ( khtmlpart->htmlDocument( )>URL()->string() ) )->string();


Look at the documentation at
http://developer.kde.org/documentation/l…ml/classes.html

This post has been edited 1 times, last edit by "f_edemar" (Jun 30th 2004, 1:18pm)


anda_skoa

Professional

Posts: 1,273

Location: Graz, Austria

Occupation: Software Developer

  • Send private message

8

Wednesday, June 30th 2004, 5:26pm

You could try this

Source code

1
KURL url(khtmlpart->url(), *urlDestination);


Cheers,
_
Qt/KDE Developer
Debian User