【问题标题】:error: 'QTabWidget::QTabWidget(const QTabWidget&)' is private错误:'QTabWidget::QTabWidget(const QTabWidget&)' 是私有的
【发布时间】:2013-06-23 05:17:55
【问题描述】:

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

C:\Qt\Qt5.0.1\5.0.1\mingw47_32\include\QtWidgets\qtabwidget.h:173: error: 'QTabWidget::QTabWidget(const QTabWidget&)' is private

错误来自*行

namespace Ui {
  class ContentControl;
}

class ContentControl : public QTabWidget // * from this line
{
    Q_OBJECT

public:
.
.
.
}

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

【问题讨论】:

    标签: c++ qt qt4 qt5 qtabwidget


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-09-14
      • 2012-01-22
      • 2019-12-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-06-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多