Я создаю QTableView, состоящий из 6 столбцов, который вставляет определенные значения, вызывая диалог. Когда я компилирую проект, я получаю следующие ошибки в файле itemcameracalibrationdata.h:
примечание: кандидат ожидает 6 аргументов, при условии 0
примечание: кандидат ожидает 6 аргументов, 1 при условии
Для полноты излагаю ниже 6 переменных и файл диалога:
Ниже itemcalibrationdata.h
#ifndef ITEMCAMERACALIBRATIONDATA_H
#define ITEMCAMERACALIBRATIONDATA_H
#include <QObject>
#include <QString>
class itemCameraCalibrationData
{
public:
itemCameraCalibrationData(const QString &cameraName, const double fovx, const double fovy,
int version, const double focalLenghth,
const double reprojectionerror);
QString cameraName() const { return mCameraName;}
int version() const { return mVersion; }
double fovx() const { return mFovx; }
double fovy() const { return mFovy; }
double focalLenghth() const { return mFocalLenghth; }
double reprojectionerror() const { return mReprojectionError; }
private:
QString mCameraName;
int mVersion;
double mFovx;
double mFovy;
double mFocalLenghth;
double mReprojectionError;
};
#endif // ITEMCAMERACALIBRATIONDATA_H
Ниже itemcalibrationdata.cpp
#include "itemcameracalibrationdata.h"
itemCameraCalibrationData::itemCameraCalibrationData(const QString &cameraName, const double fovx, const double fovy,
int version, const double focalLenghth,
const double reprojectionerror)
{
mCameraName = cameraName;
mFovx = fovx;
mFovy = fovy;
mVersion = version;
mFocalLenghth = focalLenghth;
mReprojectionError = reprojectionerror;
}
Затем посмотрите cameracaldialog.cpp , и ошибка находится в этом файле в строке ui (новый Ui :: cameraCalDialog)
#include "cameracaldialog.h"
#include "ui_cameracaldialog.h"
#include "itemcameracalibrationdata.h"
#include <QFile>
#include <QMessageBox>
#include <QFileDialog>
#include <QCompleter>
#include <QFileSystemModel>
cameraCalDialog::cameraCalDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::cameraCalDialog)
{
ui->setupUi(this);
}
cameraCalDialog::~cameraCalDialog()
{
delete ui;
}
void cameraCalDialog::on_buttonBox_accepted()
{
mItemCamCal = itemCameraCalibrationData(ui->camName_lineEdit->text(),
ui->ver_lineEdit->text().toInt(),
ui->fovx_lineEdit->text().toDouble(),
ui->fovy_lineEdit->text().toDouble(),
ui->focal_lineEdit->text().toDouble(),
ui->rep_lineEdit->text().toDouble());
accept();
}
void cameraCalDialog::on_buttonBox_rejected()
{
rejected();
}
в качестве последнего файла cameracaldialog.h
#ifndef CAMERACALDIALOG_H
#define CAMERACALDIALOG_H
#include <QDialog>
#include "itemcameracalibrationdata.h"
namespace Ui {
class cameraCalDialog;
}
class cameraCalDialog : public QDialog
{
Q_OBJECT
public:
explicit cameraCalDialog(QWidget *parent = nullptr);
~cameraCalDialog();
itemCameraCalibrationData itemCamCal() const { return mItemCamCal; }
private slots:
void on_buttonBox_accepted();
void on_buttonBox_rejected();
private:
Ui::cameraCalDialog *ui;
itemCameraCalibrationData mItemCamCal;
};
#endif // CAMERACALDIALOG_H
Большое спасибо за любую информацию, которую вы можете предоставить по этому вопросу