Good evening!
So, i made a class that makes part of my program. I called her "Historic". She does not inherit any other class. I tried to create a QFileDialog and a QMessageBox inside of one of my methods of this class, but i'm having the following error message.
#include <QFileDialog>
#include <QMessageBox>
//...code here
//...code here
#include <QFileDialog>
#include <QMessageBox>
//...code here
filePath = QFileDialog::getOpenFileName(this, QObject::tr("Open File"), "D:/Texts", QObject::tr("Text Files (*.txt)"));
//...code here
QMessageBox::critical(this, QObject::tr("Error"), QObject::tr("Blablablabla."));
To copy to clipboard, switch view to plain text mode
D:\Programming\C-C++\Qt\Windows\historic.cpp:10: error: no matching function for call to 'QFileDialog::getOpenFileName(Historic*, QString, const char [18], QString)'
filePath = QFileDialog::getOpenFileName(this, QObject::tr("Open File"), "D:/Texts", QObject::tr("Text Files (*.txt)"));
D:\Programming\C-C++\Qt\Windows\historic.cpp:33: error: no matching function for call to 'QMessageBox::critical(Historic*, QString, QString)'
QMessageBox::critical(this,QObject::tr("Error."),Q Object::tr("Blablablabla."));
I would like to know if why this is happening and if i really have to make my class inherits some other and which one is it.
Thanks!
Bookmarks