Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7413471
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:54:59+00:00 2026-05-29T06:54:59+00:00

I have a QWebView, and it loads a certain page, the user logs in

  • 0

I have a QWebView, and it loads a certain page, the user logs in and goes about his business. This all works fine.

What I would like to do is have a second frame/pae open, that uses the logged in users session and all that jazz to load a reports page that it will render to an image file for display on a little USB screen.

Right now, I accomplish this with a completely different webView, which can’t access protected pages, which is a bit of a security risk.

Here is some pseudo code for what I am thinking of:

webView->mainFrame->loadNormalUrl
secretFrame = webView->createSecretFrame
secretFrame->useSessionOf(webView->mainFrame)
secretFrame->loadReportUrl
secretFrame->doStuffThatAlreadyWorks

Any help, pointers, links would be super helpful! Thanks 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:55:00+00:00Added an answer on May 29, 2026 at 6:55 am

    Well,

    This question didn’t receive and answer, so I pattered off to the qtwebkit mailing list, and they were very helpful.

    The essential thing is to subclass QNetworkCookieJar, the most important method being the loading from disk, which you call in your constructor.

    QList<QNetworkCookie> cookies;
    if (m_file.open(QIODevice::ReadOnly | QIODevice::Text)) {
        QTextStream in(&m_file);
        QString txt = in.readAll();
        QStringList lines = txt.split("\n");
       foreach (QString c, lines) {
        cookies.append(QNetworkCookie::parseCookies(c.toUtf8()));
       }
        m_file.close();
    } 
    setAllCookies(cookies);
    

    Of Course, you’ll also need a writing function, like so:

    QTextStream out(&m_file);
            foreach (const QByteArray &cookie, m_rawCookies)
                out << cookie + "\n";
            m_file.close();
    

    And your raw cookies like so:

    QList<QNetworkCookie> cookies = allCookies();
    m_rawCookies.clear();
    
    foreach (const QNetworkCookie &cookie, cookies) {
      m_rawCookies.append(cookie.toRawForm());
    }
    

    If you download the webkit source, you can take a look at the testbrowser code for a more complete example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to hide the scrollbars on a QWebView have tried this: webView.page()->mainFrame()->setScrollBarPolicy(
I have a problem with QWebView. It doesn't load http://mail.bigmir.net/signin/ this page on Windows.
I'm having some difficulty with this, but basically load a page into a QWebView
I have a QWebView object loading a web page. I need to save a
I have a start page on my application that is just a QWebView widget
I have a QWebView in my app which renders a html page stored in
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have a simple Qt application that launches a window with a QWebView. I
Have not done this before, so obviously I suck at it. Here 64 pixels
Have not done this before ( except in java , look how Steve McLeod

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.