Re: setWindowIcon for QDialog

Aleix Pol <[email protected]>
Newsgroups gmane.comp.kde.devel.general,gmane.comp.kde.devel.kwin
Message-ID <CACcA1RoV4iv2_69RDrRrJFmj8P75nMRqKxRGDK1Oet6fsTEpnw@mail.gmail.com>
On Sun, Mar 3, 2019 at 11:00 AM Alexander Semke <[email protected]> wrote:
>
> Hi,
>
> in LabPlot we have couple of modal dialogs, created on the heap and shown with
> dlg->exec().  The dialog icon is set in the constructor of the dialog via
> QDialog::setWindowIcon(), e.g.
> setWindowIcon(QIcon::fromTheme(QLatin1String("labplot-worksheet")));
>
> The icon is set/handled by the window manager if I understand this correctly.
> With kwin, the specified icons are not shown and I always get the default
> application's icon shown. On windows, this seems to work and I see the proper
> icons in the dialogs.
>
> I tried to quit the event loop with
>
> QTimer::singleShot(0, this, [=] () {
>     setWindowIcon(QIcon::fromTheme(QLatin1String("labplot-worksheet")));
> });
>
> in order to call QDialog::setWindowIcon() after QDialog::show() but this
> doesn't help.
>
> So, what is the proper way to set the icon that would work everywhere?

Adding kwin in case they know.

Aleix
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.