A
A
Alexander2019-07-23 15:22:58
Qt
Alexander, 2019-07-23 15:22:58

How to get rid of soapy fonts in QtQuick?

I always noticed that when using QtQuick , fonts are rendered terribly poorly - everything is blurry and unreadable, it strains both eyes and nerves.
Now it was necessary to use the QtWebEngineWidgets module in the widgets , and it, the infection, pulls Quick along with it, apparently cef is drawn through QML. Well, to hell with it, let it be drawn like this, but only when QtWebEngine is activated, the entire application turns into a blurry mass.
Here are 2 screenshots:
1. Before creating the QWebEngineView instance
5d36fbd094b15872919207.png
2. After creating the QWebEngineView instance Is
5d36fcbb61277536652175.png
there a cure for this blurriness?
Project code:

#include <QApplication>
#include <QWebEngineView>
#include <QBoxLayout>
#include <QPushButton>
#include <QLineEdit>
#include <QLabel>
#include <QTimer>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QWidget *window = new QWidget;
    window->setLayout(new QVBoxLayout);
    window->resize(800,600);

    QWidget *bar = new QWidget(window);
    bar->setLayout(new QHBoxLayout);
    bar->layout()->addWidget(new QLabel("Это QLabel"));
    bar->layout()->addWidget(new QLineEdit("Это QLineEdit"));
    bar->layout()->addWidget(new QPushButton("Это QPushButton"));
    bar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);

    QWidget *centralWidget = new QWidget(window);
    centralWidget->setLayout(new QVBoxLayout);

    window->layout()->addWidget(bar);
    window->layout()->addWidget(centralWidget);

    QTimer::singleShot(5000, centralWidget, [=](){
        QWebEngineView *view = new QWebEngineView(centralWidget);
        view->load(QUrl("https://toster.ru/q/650932"));
        centralWidget->layout()->addWidget(view);
        view->show();
    });

    window->show();

    return a.exec();
}

P.S. It seems that the toaster cuts the image quality, if suddenly the screenshots do not show what my pain is, then here is the image without compression: https://pp.userapi.com/c854020/v854020539/9fce4/16...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
Jacob E, 2019-07-23
@wxmaper

https://stackoverflow.com/questions/43369016/can-i...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question