[Interest] Macro to identify desktop(Ubuntu-X86) and embedded Linux(ARM)

Ramakanth Kesireddy rama.kesi at gmail.com
Mon Sep 17 07:09:51 CEST 2018


It works well on target with embedded Linux using default font and setting
font point size..But on Ubuntu, layout alignment is not proper after using
the same font point size..It looks like it needs to be set different point
size on Ubuntu for proper layout using macro as it is a dynamic layout
based on the items from the model.

On Tue 11 Sep, 2018, 07:46 Ramakanth Kesireddy, <rama.kesi at gmail.com> wrote:

>
> ---------- Forwarded message ---------
> From: Allan Sandfeld Jensen <kde at carewolf.com>
> Date: Sun 9 Sep, 2018, 03:35
> Subject: Re: [Interest] Macro to identify desktop(Ubuntu-X86) and embedded
> Linux(ARM)
> To: <interest at qt-project.org>
> Cc: Thiago Macieira <thiago.macieira at intel.com>
>
>
> On Samstag, 8. September 2018 22:56:29 CEST Thiago Macieira wrote:
> > On Saturday, 8 September 2018 11:56:45 PDT Tomasz Olszak wrote:
> > > So as well you can to it in runtime and don't need macro.
> >
> > Better yet, don't do anything. Use the font that the user configured and
> > don't override. If you don't like the font, use your desktop's font
> > changing tool to make the customisation.
>
> And getting the system default fonts can be a bit tricky, but it is done
> like
> this:
>
> QFontDatabase db; // needs to be instantiated at least once first
> QFont defaultFont;
> defaultFont.setStyleHint(QFont::SansSerif);
> defaultFont = QFont(defaultFont.defaultFamily()));
>
> You have to use QFont first as a query to query the default, and then you
> can
> set the default name to get the actual default font. This is because
> QFont::StyleHint generally isn't working well cross-platform, and it is
> also
> not quite clear what it is supposed to do in general font queries, but it
> can
> query default font families like this.
>
> I might have cleaned parts of this up so it is less error-prone, but this
> is at least the old standard incantation for font defaults.
>
> 'Allan
>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20180917/8e97e5d6/attachment.html>


More information about the Interest mailing list