On Tue, Jul 15, 2014 at 6:23 PM, Jean-Marc Lasgouttes
<lasgout...@lyx.org> wrote:
> Le 15/07/14 02:03, Marcelo Galvão Póvoa a écrit :
>
>>> This is excellent work. I am surprised that so many parts of the code
>>> need
>>> to be changed, the way the blog entry is written made me think that the
>>> changes could be smaller.
>>>
>>
>> Thanks. I tried to change the least amount of code but maybe someone
>> can suggest how to simplify my approach.
>
>
> OK, some remarks in no particuar order:
>
> * adding a fake variable to lyxrc is bad :)
>

Is there a better alternative? The variable can be made customizable
like the others but I don't know if it makes sense.

> * is it really necessary to set devicePixelRatio for QImage objects? I would
> think that they are set automatically.
>

AFAIK, yes. Otherwise it would understand as low resolution content
and stretch it.

> * are you sure about the two different paths that depend on is_transformed_
> in QImage::width/height?
>

What do you mean? If the original_ is always treated as HiDPI, I think
the transformed_ would be the same.

> * In GuiPainter::image, you can get the devicePixelRatio from the QImage to
> scale the dimensions.
>

Yes, I guess that would be nicer.

> * as discussed in the sections "Widgets and QPainter" of the blog entry [2]
> in your post, some magic happens when using
>   qApp->setAttribute(Qt::AA_UseHighDpiPixmaps);
> Is there a reason why you do not use it? They seems to say that everything
> is (almost) automatic after that.
>

That flag only makes QIcon::pixmap() generate HiDPI pixmaps
automatically, but LyX pixmaps are not generated this way. So it
wouldn't make any difference here.

> In general, this blog post gives a lot of interesting comments. I suspect
> that you understand them better then I do and that life is less easy than I
> would like but your code does not really look like the what the post
> describes.
>

I think this extra work is needed because LyX's workarea is drawn as
raster graphics instead of using only Qt's native widgets. However,
it's my first attempt on implementing any "HiDPI support", so I am
open to suggestions.

Marcelo

Reply via email to