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?
Printable View
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?
I tried but unsuccessful. I want to apply my own css file to QWebFrame object.
This works:
Code:
QWebSettings *settings = QWebSettings::globalSettings();
But this doesn't:
Code:
QWebSettings *settings = QWebSettings::globalSettings();
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.