Results 1 to 7 of 7

Thread: Warning when cancel download file?

  1. #1
    Join Date
    May 2018
    Posts
    19
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Warning when cancel download file?

    Qt Code:
    1. QCoreApplication::postEvent: Unexpected null receiver
    To copy to clipboard, switch view to plain text mode 

    I don't know call what.
    I make a downloader into a app, when I cancel download, I waning on console.
    I don't know how to debug with problem.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Warning when cancel download file?

    Well, with all the detailed information you have provided, I think the correct answer is that your program has a bug in it. If you find the bug and fix it, the warning should go away.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    May 2018
    Posts
    19
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Warning when cancel download file?

    QNetworkReply *reply = QNetAccessMananger::get(request);
    ....
    if (reply != nullptr)
    {
    reply->disconnect();
    reply->abort();
    reply->deleteLater();
    reply = nullptr;
    }
    I used above code to stop download file.
    Last edited by madawg; 26th June 2018 at 07:20.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Warning when cancel download file?

    That's very useful. What's "reply"? A pointer to something which you don't consider important enough to identify.

    Come on. If you want help to try to solve your problem, you have to provide some information that actually tells us something about what you are doing. Otherwise, you're just wasting your time and ours. We don't have a copy of your code sitting on our desk. So how are we supposed to understand from 4 lines of meaningless code what you might be doing right or wrong?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    May 2018
    Posts
    19
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Warning when cancel download file?

    I updated it:
    QNetworkReply *reply = QNetAccessMananger::get(request);

  6. #6
    Join Date
    Jan 2017
    Posts
    58
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Warning when cancel download file?

    I am afraid the get function is not static, so thus you will probably need something like this:
    Qt Code:
    1. QNetworkAccessManager *manager = new QNetworkAccessManager(this);
    2. QNetworkReply *reply = manager->get(request);
    To copy to clipboard, switch view to plain text mode 

    http://doc.qt.io/qt-4.8/qnetworkaccessmanager.html#details

  7. #7
    Join Date
    May 2018
    Posts
    19
    Thanks
    1
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Warning when cancel download file?

    sorry. It is not static, I only show it as detail more.

Similar Threads

  1. QWebEngine file chooser return value on cancel
    By RolandHughes in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2015, 08:35
  2. Warning:GeneralWaitEvents() ->Cancel Event
    By DoomerDan in forum Qt Programming
    Replies: 0
    Last Post: 7th October 2014, 12:26
  3. Replies: 5
    Last Post: 11th March 2013, 19:32
  4. Download File
    By BalaQT in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2010, 09:53
  5. warning while processing ui file
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 5th July 2008, 19:33

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.