Hello, I have some trouble with Qt.
I have a class 'Core'
class Core {
public:
static QString get_file_content(QString filename);
static void setMainwindow(Ui::MainWindow const *w);
private:
static MainWindow *main_window;
};
and class 'MainWindow' in namespace Ui:
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow {
Q_OBJECT
public:
MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
In MainWindow constructor I make
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
Core::setMainwindow(this);
}
and gets error
mainwindow.cpp:8: error: no matching function for call to 'Core::setMainwindow(MainWindow* const)'
Of cource, i include core.h with declaration of 'Core' class.
That's occurs only on setMainwindow method.
So the questions is - why Core class method setMainwindow() is invisible in MainWindow class?