D21655: KSelectionOwner usage in ApplicationX11 and Compositor classes

Roman Gilg <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
romangg added inline comments.

INLINE COMMENTS

> zzag wrote in composite.cpp:71-89
> It's perfectly fine to keep declaration of CompositorSelectionOwner class in the header file. It's also worth to point out that KSelectionOwner is a QObject, which means CompositorSelectionOwner needs to have a Q_OBJECT macro.

It's a scope question. CompositorSelectionOwner is only used internally by Compositor class while the header is included in many other source files. When CompositorSelectionOwner in the header this is not obvious, when it's in the source file it is.

In regards to the macro: according to docs <https://doc.qt.io/qt-5/qobject.html#Q_OBJECT> it is only needed when the class uses slots and signals. Well it does so why does it compile? Would it just fail at runtime?

Alternatives are to put the CompositorSelectionOwner class in a separate file or include the moc in the composite.cpp file.

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D21655

To: romangg, #kwin, zzag
Cc: sbergeron, zzag, kwin, LeGast00n, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
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.