Topic: HiDPI mode

Hi,

I have a HP Spectre and run a resolution of 1920 x 1080, however QElectrotech doesn't display according to the resolution.  Is it a QT error or possible to change via a conf file.

I have the latest version from the Fedora COPR, and am running Fedora 23.  I've attached a screenshot.

Thanks,



Jon

Post's attachments

Attachment icon Screenshot from 2016-07-18 19-25-01.png 187.1 kb, 190 downloads since 2016-07-18 

Re: HiDPI mode

Hi Jon,

for me your problem is you use a oldest Fedora version released in ....  november 2015.
What is your Desktop environment, Gnome 3.18 ... KDE, Xfce, LXDE, Mate-Compiz, etc ?
Please upgrade to Fedora 24 if you can.

Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

Laurent,

I am using Gnome 3.18.

I will upgrade to Fedora 24 in the next week or so.  I'm just in the middle of some important projects so need to do it at a non critical time.

I don't normally use QElectrotech on my laptop so it's no big issue for now.

Thanks for the reply,


Jon

Re: HiDPI mode

jonnie_r wrote:

Hi,

I have a HP Spectre and run a resolution of 1920 x 1080, however QElectrotech doesn't display according to the resolution.  

Your laptop run in normal mode into a resolution mode 1920 x 1080 or in HDPI? 
1920 x 1080 is a normal resolution.
What your HP Spectre specification?

If you want to use HDPI for your laptop you need to upgrade Qt 5 version to Qt 5.6.
In code, I was added a control for verify if Qt version >= 5.6 for enable HDPI support for QET or not.

http://rpms.remirepo.net/rpmphp/zoom.php?rpm=qt5-qtbase

Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

Laurent,

You are indeed correct, I am running 1920 x 1080 not HiDPI.

I have Qt 5.6.1 running, and have upgraded to FC24 but it still displays incorrectly.


Jon

Post's attachments

Attachment icon Screenshot from 2016-07-23 21-55-55.png 201.7 kb, 172 downloads since 2016-07-23 

Re: HiDPI mode

Jon,

I think you must reporting to mainstream Remi Collet this bug.
It 's very strange, I've never heard about this problem recently on Ubuntu or Debian with latest Gnome shell !

Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

Jon,

mainstream Remi send me QET screen captures on Fedora 24 gnome gnome wayland, plasma and Fedora 23:

https://server.famillecollet.com/ownclo … 75Ifm8vJFd

Now, for me I think is a config or driver's video problem.

Your menu icons are too small and the icons are too large in docks.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

8 (edited by cubero 2017-05-17 16:15:18)

Re: HiDPI mode

Hello guys,

I've bought a 4K display and I've realised that HDPI auto scale doesn't work properly, at least for me. I suggest you to disable this feature in .desktop file modifying the Exec line like this.

Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=0 qelectrotech %F

Perhaps you can release the next version with two desktop files, a normal one and HDPI disabled one.

I've created a desktop file like this:

[Desktop Entry]
Version=1.0
Name=QElectroTech 
TryExec=qelectrotech
Exec=env QT_AUTO_SCREEN_SCALE_FACTOR=0 qelectrotech %F
Icon=qelectrotech
Terminal=false
Type=Application
MimeType=application/x-qet-project;application/x-qet-element;application/x-qet-titleblock;
Categories=Graphics;Qt;VectorGraphics;Science;Electricity;Engineering;
Keywords=Graphics;Science;Electricity;Engineering;
Comment=Edit electrical diagrams.
GenericName=Electrical diagram editor

Best regards

Re: HiDPI mode

Hi Cubero,

thank you for your report and quick fix.
What is your OS, Ubuntu? DE and Qt version?
Could you send pictures when auto scale doesn't work properly?

Me and Joshua have only full HD screens, and we think it is not worth replacing them for now.

Best regards,
Laurent

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

https://vicrucann.github.io/tutorials/osg-qt-high-dpi/
But :

An experimental implementation of high-DPI scaling was introduced in Qt 5.4. It was enabled by the environment variable QT_DEVICE_PIXEL_RATIO, which could be set to a numerical scale factor or "auto". This variable is deprecated in Qt 5.6.


http://doc.qt.io/qt-5/highdpi.html


In order to get an application designed for low DPI values running on a high resolution monitors quickly, consider one of the scaling options (let the application run as DPI Unaware on Windows or set the environment variable QT_AUTO_SCREEN_SCALE_FACTOR to "1". These options may incur some scaling or painting artifacts, though.

In the longer term, the application should be adapted to run unmodified:

Always use the qreal versions of the QPainter drawing API.
Size windows and dialogs in relation to the screen size.
Replace hard-coded sizes in layouts and drawing code by values calculated from font metrics or screen size.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

Hello Scorpio,
I am using Unity and QT 5.7.1 under Ubuntu 17.04
The main problem is that text are shown smaller under 4K in relation with other elements of the schematic.
Attached you can see the same schematic opened with and without the flag [size=1][font=Verdana, Helvetica, Arial, sans-serif]QT_AUTO_SCREEN_SCALE_FACTOR=0[/font]

Post's attachments

Attachment icon Screenshot.jpg 1.29 mb, 198 downloads since 2017-05-18 

Re: HiDPI mode

You could try latest svn ubuntu packages?
https://launchpad.net/~scorpio/+archive/ubuntu/ppa
0.60.r4962

I reverted it after. nomicons/smiley-green


-#if (QT_VERSION >= QT_VERSION_CHECK(5, 6, 0))
-QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
-#endif
+#if QT_VERSION >= QT_VERSION_CHECK(5,6,0)
+    QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
+#else
+    qputenv("QT_DEVICE_PIXEL_RATIO", QByteArray("1"));
+#endif // QT_VERSION
     return(QETApp(argc, argv).exec());
 }

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."

Re: HiDPI mode

I've upgraded right now and version 0.60.r4962 works properly.
Thanks

Re: HiDPI mode

cubero wrote:

I've upgraded right now and version 0.60.r4962 works properly.
Thanks

Ok, thank you.
I 'll commit changes and build Windows packages, for Windows users can try.

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."