I am creating a QTableView formed of 6 columns that inserts specific values by calling a dialog. When I compile the project I receive the following errors in the file 'itemcameracalibrationdata.h':
note: candidate expects 6 arguments, 0 provided
note: candidate expects 6 arguments, 1 provided
For completeness I am including below both the 6 variables and the dialog file: Below the 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
Below the 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;
}
Then see the cameracaldialog.cpp and the error is in this file at the line ui(new 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();
}
as last file the 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
Thank you very much for any insight you can provide on this matter