I have been battling with an issue on Qt for a while now and figured I'd come by here to see if anyone had any solutions.
I've created a GUI using the QT tools and have programmed all of the functions for each respective thing. However, I can't seem to successfully rectify the following issue:
C:\Python34\2SprayCoater\mainwindow.cpp:11: error: no 'int mainwindow::MainWindow(QWidget*)' member function declared in class 'mainwindow' mainwindow::MainWindow(QWidget *parent):QMainWindow(parent)
The part of code from the library in question is:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
namespace Ui {
class MainWindow;
}
class mainwindow : public QMainWindow
{
Q_OBJECT
public:
explicit mainwindow(QWidget *parent = 0);
~mainwindow();
And the reference to this code in the cpp file is:
#include "mainwindow.h"
#include <QApplication>
#include "main.cpp"
#include <QtSerialPort/QSerialPort>
#include <QtCore/QCoreApplication>
#include <QtCore/QDebug>
mainwindow::MainWindow(QWidget *parent):QMainWindow(parent)
{
ui.setupUi(this);
}
I tried to fix this by simply changing explicit
mainwindow(QWidget *parent = 0);
in the header file to
explicit mainwindow(QWidget *parent = 0):QMainWindow(parent);
Which just ends up creating a slough of different issues, but fixes the original. What am I missing? Thanks in advance.