Getting absolute path to file is simple:
QUrl("file://<path>/<filename>")
But I want to get QUrl representation of file in the current directory. Something like QUrl("file://stylesheet.css") but this doesn't work.
How to do this?
Getting absolute path to file is simple:
QUrl("file://<path>/<filename>")
But I want to get QUrl representation of file in the current directory. Something like QUrl("file://stylesheet.css") but this doesn't work.
How to do this?
Cupidvogel (25th February 2016)
I tried but unsuccessful. I want to apply my own css file to QWebFrame object.
This works:
Qt Code:
QWebSettings *settings = QWebSettings::globalSettings();To copy to clipboard, switch view to plain text mode
But this doesn't:
Qt Code:
QWebSettings *settings = QWebSettings::globalSettings();To copy to clipboard, switch view to plain text mode
Use an absolute path to the file, not relative one - file:///style.css and file:///home/lirq/.../style.css are two different paths.
In case of absolute path it's needed to get path to my application. How to do this?
QCoreApplication::applicationDirPath() or you can probably simply use QFile::absolutePath() to get absolute path from relative one.
Cupidvogel (25th February 2016), lirq (6th January 2009)
Bookmarks