Results 1 to 7 of 7

Thread: Handling multiple web pages in Qt WebKit Browser

  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Post Handling multiple web pages in Qt WebKit Browser

    Hi All,

    I am designing Qt WebKit based custom browser. The client's requirement is that at any point of time there should be 4 web pages should be active in memory. These web pages will actually work as front end for users.

    So if user want to switch from one appliation (i.e. web page) to another it should be instantly.

    My understanding is that browser will handle only one web page at a time. If another page needs to be loaded then it will discard current web page. So in my application I want to keep current web page as it is but new web page should be displayed to user.

    Let me know how these can be done.

    Regards,
    Dipen Patel

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Handling multiple web pages in Qt WebKit Browser

    can't you stack browsers and show only the active one, (4 instance of browsers)

  3. #3
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Handling multiple web pages in Qt WebKit Browser

    Hi Santosh,

    That could be a possible solution but this is for power and memory conservative embedded device. Running 4 browser instances is not a good idea.

    I am thinking of something like to have 4 instances of QWebPage class in side my Browser application and manage them. So if user wants to switch an application (web page) display particular instance of QWebPage.

    Let me know if that could be possible to implement.

    Regards,
    Dipen Patel

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Handling multiple web pages in Qt WebKit Browser

    That could be a possible solution but this is for power and memory conservative embedded device. Running 4 browser instances is not a good idea.
    I meant to have 4 instance of QWebPage

    I am thinking of something like to have 4 instances of QWebPage class in side my Browser application and manage them. So if user wants to switch an application (web page) display particular instance of QWebPage.

    Let me know if that could be possible to implement.
    You already have a solution, just manage 4 pages. You already know how to implement 1 page, just extent to 4 pages, what is the problem in it, I could not understand.

  5. #5
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Handling multiple web pages in Qt WebKit Browser

    Hi Santosh,

    I did following to create and initialize 4 QWebPage objects with 4 different URLs. Each url* is initialized with different URL string.

    gWebView->setPage(qPage1);
    gWebView->load(url1);
    qPage1 = gWebView->page();

    gWebView->setPage(qPage2);
    gWebView->load(url2);
    qPage2 = gWebView->page();

    gWebView->setPage(qPage3);
    gWebView->load(url3);
    qPage3 = gWebView->page();

    gWebView->setPage(qPage4);
    gWebView->load(url4);
    qPage4 = gWebView->page();

    So on start up url4 is loaded. But later when I type below to load qPage2 it does nothing.



    gWebView->setPage(qPage2);


    Let me know is it right way to initialize qPage objects and assign them to gWebView object dynamically at run time?

    Regards,
    Dipen Patel

  6. #6
    Join Date
    Feb 2011
    Posts
    4
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Handling multiple web pages in Qt WebKit Browser

    Hi Santosh,

    Let me know if you have any idea what's going wrong with my code.

    Regards,
    Dipen Patel

  7. #7
    Join Date
    May 2008
    Location
    Melbourne, Australia
    Posts
    136
    Thanks
    9
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Handling multiple web pages in Qt WebKit Browser

    Not sure what the problem is, but perhaps this threading example using pyqt will help.

Similar Threads

  1. Replies: 2
    Last Post: 16th April 2014, 04:26
  2. Handling mouse events in Qt WebKit
    By yakin in forum Qt Programming
    Replies: 6
    Last Post: 21st April 2011, 05:44
  3. Multiple Forms Handling
    By eva2002 in forum Qt Programming
    Replies: 5
    Last Post: 11th November 2010, 06:24
  4. multiple plots on multple pages
    By giusepped in forum Qwt
    Replies: 0
    Last Post: 29th July 2009, 08:38
  5. Handling multiple UDP sockets
    By ecphora in forum Qt Programming
    Replies: 2
    Last Post: 1st April 2006, 20:01

Tags for this Thread

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.