错误:'QTabWidget::QTabWidget(const QTabWidget&)'是私有的

error: 'QTabWidget::QTabWidget(const QTabWidget&)' is private

本文关键字:QTabWidget 错误 const      更新时间:2023-10-16

我开发了一个程序,我有10个备份。我在其中添加了一些行,当我编译项目时,现在它出现了以下错误:

C:QtQt5.0.15.0.1mingw47_32includeQtWidgetsqtabwidget.h:173: error: 'QTabWidget::QTabWidget(const QTabWidget&)' is private

错误来自*line

namespace Ui {
  class ContentControl;
}
class ContentControl : public QTabWidget // * from this line
{
    Q_OBJECT
public:
.
.
.
}

所有备份现在都有此错误。知道为什么吗?我重新安装了Qt,但问题仍然存在。

不能创建QTabWidget对象的副本。在代码的某个地方,您正在调用QTabWidget的复制构造函数,这是不允许的,因为它在Qt源代码中被声明为私有的。