Advertisement
trollixx

Untitled

Mar 2nd, 2017
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <QApplication>
  2. #include <QWebSettings>
  3. #include <QWebView>
  4.  
  5. namespace  {
  6. char CSS[] = "html { filter: invert(); }";
  7. }
  8.  
  9. int main(int argc, char *argv[])
  10. {
  11.     QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
  12.  
  13.     QApplication a(argc, argv);
  14.  
  15.     const QString cssUrl = QLatin1String("data:text/css;charset=utf-8;base64,") + QByteArray(CSS).toBase64();
  16.     QWebSettings::globalSettings()->setUserStyleSheetUrl(QUrl(cssUrl));
  17.  
  18.     QWebView w;
  19.     w.setContent("<html>Test</html>");
  20.     w.show();
  21.  
  22.     return a.exec();
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement