Find root cause of “cannot access private member declared in class 'QObject'”

前端 未结 2 1313
说谎
说谎 2021-01-24 13:34

I understand why I get a C2248: \'QObject::QObject\' : cannot access private member declared in class \'QObject\' . Qt objects are not copyable, as explained here:<

2条回答
  •  孤街浪徒
    2021-01-24 13:43

    The easiest solution to detect the root cause is by making your copy ctor also private. (Or deleted, but that's not possible in VS2010 yet). This will suppress the automatically-generated copy ctor, which was the source of the error.

提交回复
热议问题