I am trying to read the .pro file of my project and display it on the console window. The reading was done successfully but the displaying was not as expected. The program displays the text as sequential letters:
QT += core\nQT -= gui\nCONFIG += c++11\nTARGET = 13-ResourceFiles\nCONFIG += console\nCONFIG -= app_bundle\nTEMPLATE = app\n\nSOURCES += main.cpp\n\n
QT += core\nQT -= gui\nCONFIG += c++11\nTARGET = 13-ResourceFiles\nCONFIG += console\nCONFIG -= app_bundle\nTEMPLATE = app\n\nSOURCES += main.cpp\n\n
To copy to clipboard, switch view to plain text mode
not as :
QT += core
QT -= gui
CONFIG += c++11
TARGET = 13-ResourceFiles
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
QT += core
QT -= gui
CONFIG += c++11
TARGET = 13-ResourceFiles
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
To copy to clipboard, switch view to plain text mode
Here is the Reading function:
{
if(myfile.exists())
{
my_buffer=myfile.readAll();
qDebug()<<my_buffer;
myfile.flush();
myfile.close();
}
void Read(QString file_name)
{
QFile myfile(file_name);
if(myfile.exists())
{
myfile.open(QIODevice::ReadOnly);
QString my_buffer;
my_buffer=myfile.readAll();
qDebug()<<my_buffer;
myfile.flush();
myfile.close();
}
To copy to clipboard, switch view to plain text mode
Bookmarks