Portál AbcLinuxu, 8. května 2025 13:26
void BrowserMainWindow::readStringsFromFile() { QFile filef("pokus.txt"); if (filef.exists() && (filef.size() > 0)) { if (filef.open(QIODevice::ReadOnly | QIODevice::Text)) { QTextStream in(&filef); while (!in.atEnd()) { QString line = in.readLine(); titleStrings.append(line); } filef.close(); } } }kompilátor ale vypíše chybu
no matching function for call to 'QFile::QFile(const char[10])'můžete mě někdo nakopnout kde můžu dělat chybu?
QFile filef(QString("pokus.txt"));
QFile filef(QString("pokus.txt"));conversion from 'const char [10]' to 'QChar' is ambiguous
void MainWindow::pokus() { QFile::exists("pokus.txt"); }vše funguje jak má, proč mi to tedy nejde v té "Aroře"?
bool pok = QFile::exists(QString::fromAscii("C:/Excel/pokus.txt"));chybu už to nehlásí ale ten soubor existuje a přesto to vrátí false
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.