|
|
Source code |
1 2 3 4 5 6 7 |
QString url = "http://www.trolltech.com" #ifdef WIN32 HWND mainwndw = winId(); HINSTANCE status =::ShellExecute( mainwndw, NULL, ( TCHAR * ) qt_winTchar( url, true ), NULL, NULL, SW_SHOW ); #endif |
This post has been edited 1 times, last edit by "bisserke" (Mar 22nd 2005, 9:42am)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
bool open_browser(QWidget* parent, const QString& rUrl)
{
bool result = false;
QApplication::setOverrideCursor(Qt::BusyCursor);
#ifdef Q_WS_WIN
result = int(ShellExecuteW(parent->winId(),
0,
rUrl.ucs2(),
0,
0,
SW_SHOWNORMAL)) > 32;
#else
Q_UNUSED(parent);
// Try a range of browsers available on UNIX, until we (hopefully)
// find one that works. Start with the most popular first.
QProcess process;
bool process_started = false;
process.setArguments(QStringList() << "netscape" << rUrl);
process_started = process.start();
if (!process_started)
{
process.setArguments(QStringList() << "mozilla" << rUrl);
process_started = process.start();
}
if (!process_started)
{
process.setArguments(QStringList() << "firefox" << rUrl);
process_started = process.start();
}
if (!process_started)
{
process.setArguments(QStringList() << "konqueror" << rUrl);
process_started = process.start();
}
result = process_started;
#endif
QApplication::restoreOverrideCursor();
return result;
}
|
This post has been edited 1 times, last edit by "Latem" (Jun 15th 2005, 9:58pm)
This post has been edited 1 times, last edit by "Barney`" (Jun 19th 2005, 8:18pm)
Quoted
Originally posted by Barney`
via_mainwindow.ui.h:258: error: `BusyCursor' is not a member of type `Qt'
via_mainwindow.ui.h:294: error: return-statement with a value, in function declared with a void return type
:/
I don't (really) understand the function so I paste it in my file and modified it to adapt it with my project but there are still these 2 errors.
) This post has been edited 1 times, last edit by "Barney`" (Jun 20th 2005, 10:11pm)
Quoted
Originally posted by Barney`
It compiled with WaitCursor but I've these 2 errors while excecuting :
QObject::connect: No such slot VIA::helpContents(this,"/home/donkey/Desktop/via_project/help/help_general.htm")
QObject::connect: (sender name: 'helpContentsAction')
QObject::connect: (receiver name: 'VIA')
and of course, nothing happens.
Quoted
What does correspond to the parameter "parent"? (I put 'this')
|
|
Source code |
1 2 3 4 |
#ifdef _WIN32
//openPage.startDetached( "cmd", QStringList() << "/c" << "start" << url.toString() );
//openPage.waitForFinished();
openPage.execute( QString( "rundll32 url.dll,FileProtocolHandler \"%1\"" ).arg( url.toString() ) );
|
This post has been edited 3 times, last edit by "DanielHutchison" (Dec 10th 2005, 2:16am)