0

First look at the difference:

enter image description here

The top's been created in WPF and the bottom with Qt. All Path Data has been taken from materialdesignicons. For WPF I've taken XAML and for QtQuick SVG. For DropShadow I've specified a value for samples property BUT for svg and rotated Text there's no such property.

Is this the difference between OpenGL/CL/etc. and DirectX or something else? The machine I'm working on has both Intel and NVIDIA! I want my QtQuick app to use NVIDIA to compute efficiently and render properly BUT don't know yet how to set that as well as other necessary options application wide to improve quality.

Here is my QtQuick project. Here I'd added a sample qmlfile earlier, that shows the way I integrated SVGs in my app.

EDIT

This actually improves the quality BUT it still is blurry and not as good as it is in WPF. The rotated text has some pointy edges as well.

enter image description here

With that QSurfaceFormat in main.cpp

int main(int argc, char *argv[])
{
    ...
    QSurfaceFormat format;
    format.setSamples(15);
    QSurfaceFormat::setDefaultFormat(format);

    QQmlApplicationEngine engine;
    ...
}

I don't have to set samples for DropShadow. How to enable NVIDIA globally?

EDIT

In addition to that I've tried with QSurfaceFormat::OpenVG BUT it complains about the driver and wants 3 DLLs in executable folder as an alternative so I've downloaded those 3 DLL and put those in the output directory BUT it still doesn't work! Here's the error I get:

enter image description here

  • Please do not resize the image in QML. The quality will drop. If you need 30x30 image then use 30x30. Don't resize in qml – Chilarai Jul 03 '20 at 05:54
  • it's 24x24 and I'm using same width and height in my custom component –  Jul 03 '20 at 06:39
  • I have never used SVG in Qml. But png always worked fine for me – Chilarai Jul 03 '20 at 06:41
  • 1
    Add the code how you integrate the SVGs. It shouldn't be that pixelated, tweaking should not be necessary. Which platform are you testing on? – Frank Osterfeld Jul 03 '20 at 06:45
  • @FrankOsterfeld, I've uploaded the project as a `.zip` file, link in the EDIT section. I'm on Windows 10. –  Jul 03 '20 at 06:47
  • Probably you should post a sample qml file and a sample image resource to check – Chilarai Jul 03 '20 at 06:53
  • As I mentioned earlier, to make the icons crisp, instead of hardcoding it, you have to make it relative to the screen size. Check this link here https://stackoverflow.com/questions/37976644/how-to-make-svg-icons-crisp-again-in-qt-5-6-on-high-dpi-screens if it helps – Chilarai Jul 03 '20 at 08:28
  • @Chilarai, it's string not image. –  Jul 03 '20 at 13:13
  • I have tried to scale your svg paths. It seems a little pixelated. Can you fix that `path: "M 240 40 C 350.457031 40 440 129.542969 440 240 C 440 350.457031 350.457031 440 240 440 C 129.542969 440 40 350.457031 40 240 C 40 129.542969 129.542969 40 240 40 M 220 140 C 197.910156 140 180 157.910156 180 180 L 180 340 L 220 340 L 220 260 L 260 260 L 260 340 L 300 340 L 300 180 C 300 157.910156 282.089844 140 260 140 L 220 140 M 220 180 L 260 180 L 260 220 L 220 220 Z M 220 180` – Chilarai Jul 04 '20 at 03:48
  • @Chilarai, yes it is without any transformation, scaling up will make it obvious. I'm new to QtQuick world, don't know that much, just exploring the Qt way of doing things. Right now I am trying to understand Qt way of two way binding. –  Jul 04 '20 at 04:00

0 Answers0