Results 1 to 4 of 4

Thread: QHttp cpu usage

  1. #1
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default QHttp cpu usage

    Hello, I was recently using QHttp and a QTextBrowser to load up a wikipedia web page based on a query, and with some queries it takes forever, and hogs the cpu; presumably this is because their are alot of images or something on the page and the text browser needs time to think. This brings me to my question, is there anyway to tell the Qhttp or the browser that it isn't particularly important to do it as fast as possible, it can do it slow as long as it doesn't use 80 percent cpu.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHttp cpu usage

    Can we see the actual code?

  3. #3
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QHttp cpu usage

    Sure, but I think that I fixed it, I had to re-implement loadResource in order to have images appear, and I was just returning a new QString if it wasn't an image; yet if I just used QTextBrowser::loadResource(...) instead, then the program no longer shows the problem.

  4. #4
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QHttp cpu usage

    Also I had some unexpected recursion going on in another widget's paintEvent, causing even more lag, so it wasn't even necessarily the Http. Basically, it fetched the http fine but when updating the widget it would enter paintEvent loops (because I was invoking paintEvent through setBackgroundRole unintentionally within the paintEvent). But, it's all fixed now :-).

Similar Threads

  1. new QHttp() Error
    By fengtian.we in forum Qt Programming
    Replies: 7
    Last Post: 6th October 2010, 17:56
  2. From QHttp to QHttp over SSL
    By Nyphel in forum Newbie
    Replies: 1
    Last Post: 3rd July 2007, 10:41
  3. QHttp with localhost.
    By William Wilson in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2007, 20:26
  4. QHttp download file problem.
    By fengtian.we in forum Qt Programming
    Replies: 12
    Last Post: 12th June 2007, 09:39
  5. how to use QHttp inside QThread in Qt3
    By alusuel in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2006, 11:19

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.