如果使用qmlRegisterType注册类型时,报这个错误,八成是写的类,有一个构造函数,并且这个构造函数有一个参数,而且这个参数没有默认值。

要角色这个问题,就把构造函数弄一个默认值吧

class MySortFilterProxyModel : public QSortFilterProxyModel
{
     Q_OBJECT

public:
     MySortFilterProxyModel(QObject *parent = nullptr);
     ~MySortFilterProxyModel();

    int indexToSourceIndex(int index);
};

相关文章:

  • 2021-06-24
  • 2021-07-10
  • 2022-12-23
  • 2022-01-14
  • 2021-12-07
  • 2022-12-23
  • 2021-06-24
  • 2021-09-01
猜你喜欢
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-08-11
  • 2021-10-05
  • 2022-12-23
  • 2022-01-14
相关资源
相似解决方案