Skip to content
  • 1 Votes
    7 Posts
    5k Views
    Chris KawaC

    It's a stream. Once you read data the subsequent reads don't "go back".

    ui->textBrowserHTML->setText(in.readAll()); //you read all so the stream is "empty" now ... myString = in.readLine(); //there's nothing in the stream at this point

    Btw. If you just want to read the file as a whole without any parsing or chunking you can skip the stream and readAll() directly from the QFile.

  • 0 Votes
    12 Posts
    3k Views
    M

    @mcosta :it is not very big, so if you can see this code and just say what can I do or what is better to do, I have been very grateful to you for all your help.

  • 0 Votes
    2 Posts
    2k Views
    JKSHJ

    Hi @pthinks,

    I highly recommend you proofread your post.

    It contains false advertising (you are not the top 2nd contributor in the forum) It contains outdated information (qt-project.org is now offline) It's full of formatting errors ("list listItem")
  • 0 Votes
    1 Posts
    2k Views
    No one has replied
  • 0 Votes
    7 Posts
    3k Views
    J

    @sierdzio said:

    Thanks a lot for the clarification.

  • 0 Votes
    5 Posts
    4k Views
    T

    @alexvplay I have used V-play plugins with QML application and all works good, but i want somehow to have oportunity user to disable receiving notification on his mobile when he install my application, i have try with Parse property:

    enabled : bool

    to be false, but user still received notifications...

    So please can you give advice how i can make receiving of notification on mobile device where my app is installed to be configurable, i.e. user to have option to turn On or Off receiving notifications.

    Thanks in advance

  • 0 Votes
    8 Posts
    3k Views
    mistralegnaM

    You can first retrieve the getSelectedTabAsWidget() as a QWidget, check that it's not null, and if qobject_cast<QMdiArea*>() doesn't return NULL.

    Snippet 1:

    QWidget* selectedWidget = getSelectedTabAsWidget(); if ( selectedWidget == NULL ) { return; } QMdiArea* mdiArea = qobject_cast<QMdiArea*>(selectedWidget); if ( mdiArea == NULL ) { return; } // Here, we know that mdiArea is indeed a QMdiArea.

    Snippet 2:

    QWidget* selectedWidget = getSelectedTabAsWidget(); if ( selectedWidget == NULL ) { return; } if ( ! selectedWidget->inherits(QMdiArea::staticMetaObject.classname()) return; // Here, we know that mdiArea is indeed a QMdiArea. QMdiArea* mdiArea = qobject_cast<QMdiArea*>(selectedWidget);
  • 0 Votes
    3 Posts
    2k Views
    J

    Hello svyatoslav,
    Yes I had already referred this URL, that is not enough
    Thanks you very much for responding

  • 0 Votes
    3 Posts
    3k Views
    MehmetM

    https://coab.wordpress.com/2009/10/15/calling-wcf-services-from-a-linux-c-client-using-gsoap/

  • 0 Votes
    4 Posts
    2k Views
    SGaistS

    Then have a look at the Same game tutorial, the Storing High Score online part

  • 0 Votes
    2 Posts
    886 Views
    M

    @raghaw said:

    I could use QSettings way , but the problem is the file extension of QSettings file will be either .ini or .conf, as compared to my project file extension which will be let say .amu.

    You can set the QSettings filename and also extension,

    BTW if you want use a text format suggest to use JSON (I hate XML)

  • 0 Votes
    8 Posts
    4k Views
    F

    So, I recompile Qt for Linux and Windows to be sure, and there is definitively a difference in the behaviour of QSettings. I tracked the crash in qsettings.cpp and I found the responsible line.

    In the file, there is the class function QConfFile::fromName(const QString &fileName, bool _userPerms) on line 190. In this function, we try to get a ConfFileHash* on line 194. On Windows, the return value is valid, whereas on Linux, the value is null, that's why my application crash. However, I don't have any ideas to solve it.

    I think the difference is on which order are resources destroyed. On Linux, after main ends, a resource has to be destroyed, whereas on Windows it isn't.

    I post here the complete stack trace:

    Thread 1 (Thread 0x7f5094b3c780 (LWP 7527)): #0 0x00007f50945be5cc in QHash<QString, QConfFile*>::value (this=0x0, akey=...) at ../../include/QtCore/../../src/corelib/tools/qhash.h:618 node = 0x7fff71651dd0 #1 0x00007f50945b49d6 in QConfFile::fromName (fileName=..., _userPerms=true) at io/qsettings.cpp:200 absPath = {static null = {<No data fields>}, d = 0x2209520} confFile = 0x0 locker = {val = 139984066867721} usedHash = 0x0 unusedCache = 0x0 #2 0x00007f50945b8739 in QConfFileSettingsPrivate::QConfFileSettingsPrivate (this=0x2208da0, fileName=..., format=QSettings::IniFormat) at io/qsettings.cpp:1156 No locals. #3 0x00007f50945b50cb in QSettingsPrivate::create (fileName=..., format=QSettings::IniFormat) at io/qsettings.cpp:294 No locals. #4 0x00007f50945bbdfc in QSettings::QSettings (this=0x7fff71651ee0, fileName=..., format=QSettings::IniFormat, parent=0x0) at io/qsettings.cpp:2575 No locals. #5 0x000000000040148d in endMain () at main.cpp:30 settings = {<QObject> = {_vptr.QObject = 0x7fff71651f00, static staticMetaObject = {d = {superdata = 0x0, stringdata = 0x7f50947ed240 <qt_meta_stringdata_QObject>, data = 0x7f50947ed360 <qt_meta_data_QObject>, static_metacall = 0x7f509468f702 <QObject::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}, d_ptr = {d = 0x7f50945d1d1c <(anonymous namespace)::Q_QGS_qtLoggingRegistry::Holder::~Holder()+36>}, static staticQtMetaObject = {d = {superdata = 0x0, stringdata = 0x7f509483a740 <qt_meta_stringdata_Qt>, data = 0x7f5094844ac0 <qt_meta_data_Qt>, static_metacall = 0x0, relatedMetaObjects = 0x0, extradata = 0x0}}}, static staticMetaObject = {d = {superdata = 0x7f509493fb40 <QObject::staticMetaObject>, stringdata = 0x7f509484f900 <qt_meta_stringdata_QSettings>, data = 0x7f509484f940 <qt_meta_data_QSettings>, static_metacall = 0x7f5094718e20 <QSettings::qt_static_metacall(QObject*, QMetaObject::Call, int, void**)>, relatedMetaObjects = 0x0, extradata = 0x0}}} #6 0x00007f5093a7d259 in __run_exit_handlers (status=0, listp=0x7f5093dff6c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82 atfct = <optimized out> onfct = <optimized out> cxafct = <optimized out> f = <optimized out> #7 0x00007f5093a7d2a5 in __GI_exit (status=<optimized out>) at exit.c:104 No locals. #8 0x00007f5093a62ecc in __libc_start_main (main=0x40153c <main(int, char**)>, argc=1, argv=0x7fff71652028, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff71652018) at libc-start.c:321 result = <optimized out> unwind_buf = {cancel_jmp_buf = {{jmp_buf = {0, -6701343962190558468, 4199168, 140735095840800, 0, 0, 6701050451662228220, 6746722540675549948}, mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x403b20 <__libc_csu_init>, 0x7fff71652028}, data = {prev = 0x0, cleanup = 0x0, canceltype = 4209440}}} not_first_call = <optimized out> #9 0x0000000000401329 in _start () No symbol table info available.

    @msms said:

    I see some QCoreApplication event calls in that file. Those could crash your program for example (but maybe not).

    Indeed, there are some QCoreApplication event calls. I haven't got into this calls, but these calls are static, so maybe the QCoreApplication isn't needed. The above stack trace seems exclude this theory.

    In all case, thanks for your help

    Cheers

  • 0 Votes
    2 Posts
    2k Views
    A

    I was able to resolve this problem. The issue was, I had run "nmake install" instead of "nmake".
    refer to : https://bugreports.qt.io/browse/QTBUG-44862.