[mythtv-commits] Ticket #13069: Fix QObject related compile warnings in trunk
MythTV
noreply at mythtv.org
Thu Nov 2 00:55:35 UTC 2017
#13069: Fix QObject related compile warnings in trunk
--------------------------------------+-----------------------------
Reporter: David Hampton <mythtv@…> | Owner: dhampton
Type: Developer Task | Status: accepted
Priority: minor | Milestone: 29.0
Component: MythTV - General | Version: Master Head
Severity: medium | Resolution:
Keywords: | Ticket locked: 0
--------------------------------------+-----------------------------
Comment (by David Hampton <mythtv@…>):
In [changeset:"030ecdecc5603ba8e583a5ea04e7205efd314175/mythtv"]:
{{{
#!CommitTicketReference repository="mythtv"
revision="030ecdecc5603ba8e583a5ea04e7205efd314175"
Remove public copy constructors from MythSystemLegacy.
The MythSystemLegacy object is based on QObject and therefore
shouldn't have a public copy constructor. Update the code to
properly initialize the parent QObject, and to remove the
unused copy constructor.
General: Instances of QObject (and its subclasses) should be
considered unique items that cannot be copied. Knowing that each
object has only one parent and an arbitrary number of children makes
it easier to understand this. Even if you "clone" the object by
setting all the member variables to the same values, you can't set the
parent and child variables to the same values without screwing up the
one-to-many relationship of parent to children.
See:
http://doc.qt.io/qt-5/qobject.html#Q_DISABLE_COPY
https://www.ics.com/designpatterns/book/qobject.html
Refs #13069
}}}
--
Ticket URL: <https://code.mythtv.org/trac/ticket/13069#comment:4>
MythTV <http://www.mythtv.org>
MythTV Media Center
More information about the mythtv-commits
mailing list