kwayland fix QMetaEnum
Damian Ivanov <[email protected]>
| Newsgroups | gmane.comp.kde.devel.kwin |
|---|---|
| Message-ID | <CAPVS_cf6CRk9HHeBu8zwEaXRiCM11PKuYTRLjRwA_2W4p=w-_A@mail.gmail.com> |
Hello,
the enums declared are not marked with Q_ENUM
example from plasmashell.h:
enum class PanelBehavior {
AlwaysVisible,
AutoHide,
WindowsCanCover,
WindowsGoBelow
};
enums not marked with Q_ENUM are not usable by few Qt convenience
classes like QMetaEnum which allows you to do:
QMetaEnum metaEnum =
QMetaEnum::fromType<KWayland::Client::PlasmaShellSurface::PanelBehavior>();
int value = metaEnum.keyToValue("AutoHide");
auto m_type =
static_cast<KWayland::Client::PlasmaShellSurface::PanelBehavior>(value);
m_plasmaShellSurface->setPanelBehavior(m_type);
declaring them with Q_ENUM(PanelBehavior) or respective would fix
that without any side-effects I know of.
Hope you see it the same way and mark the enums with Q_ENUM
Best Regards
Damian