Hi I am trying to write a simple function where I load a text file to a QComboBox, I am very new to QT and C++. Here is what i have right now:
void frmVerification::openTextFile(QComboBox* qCombo, string filename) {
using namespace std;
string line;
ifstream myfile(filename.c_str());
if (myfile.is_open())
{
while (! myfile.eof() )
{
getline (myfile,line);
qCombo.addItem(line, "0");
}
myfile.close();
}
}
.. i get this complile time error
error: request for member 'addItem' in 'qCombo', which is of non-class type 'QComboBox*'
Any help would be great!