mirror of
https://gitlab.com/Syping/luaengineapp.git
synced 2025-09-10 10:46:28 +02:00
fix reading
This commit is contained in:
parent
536ca5e539
commit
0fd63c62e3
2 changed files with 34 additions and 3 deletions
|
@ -100,7 +100,7 @@ int LuaEngineIO::eIORead(lua_State *L_p)
|
|||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QIODevice")) {
|
||||
const QByteArray readData = ((QIODevice*)pointer)->read(getVariant(L_p, 2).toLongLong());
|
||||
pushVariant(L_p, readData);
|
||||
pushVariant(L_p, QString::fromUtf8(readData));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ int LuaEngineIO::eIOReadAll(lua_State *L_p)
|
|||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QIODevice")) {
|
||||
const QByteArray readData = ((QIODevice*)pointer)->readAll();
|
||||
pushVariant(L_p, readData);
|
||||
pushVariant(L_p, QString::fromUtf8(readData));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ int LuaEngineIO::eIOReadLine(lua_State *L_p)
|
|||
if (pointer != NULL) {
|
||||
if (((QObject*)pointer)->inherits("QIODevice")) {
|
||||
const QByteArray readData = ((QIODevice*)pointer)->readLine();
|
||||
pushVariant(L_p, readData);
|
||||
pushVariant(L_p, QString::fromUtf8(readData));
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue