[solved]url recognition in qt
-
Hi,
You cannot compare whole QUrl class to string, but you can use following comparison.
If you would like to have just whole URL you could use "QUrl:toString":http://doc.qt.digia.com/stable/qurl.html#toString
If you are interested only in domain you could use "QUrl:host":http://doc.qt.digia.com/stable/qurl.html#hostHope it help.
-
Your code is syntactically incorrect:
@ void MyClass::trigger(QUrl*url)
{
if(url == "http://myurl.com")
myapp.load();
}
@Besides, if you are trying to load any gui component, it is only possibly through mainwindow class. Non-gui classes can't display any gui components. You need to send a signal to main gui class to display any gui component.
-
Comparing pointer with a string is just sick, bro (sintatically correct and can even return true though).