Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. QWebEngineView closing
Forum Updated to NodeBB v4.3 + New Features

QWebEngineView closing

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qwebengineviewoauthurlrequest
1 Posts 1 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GDamiano
    wrote on last edited by
    #1

    Hello,

    I'm using a QWebEngineView inside a dylib library, to display an HTML page. Here a code extraction I used to create my View:

    QWebEngineView *pView = new QWebEngineView();
    
    OAuthUrlRequestInterceptor oauthInt(this, (clientSecret.size() > 0 ? code : implicit), "", pView);
    
    pView->setWindowFlags(Qt::Window | Qt::WindowCloseButtonHint);
    pView->setWindowModality(Qt::ApplicationModal);
    pView->setAttribute(Qt::WA_DeleteOnClose);
    
    pView->page()->profile()->setRequestInterceptor(&oauthInt);
    
    pView->resize(800, 600);
    
    pView->load(QUrl(str));
    pView->show();
    
    while (true)
    {
        if (oauthInt.isFinished() || !pView->isVisible())
            break;
    
        QApplication::processEvents(QEventLoop::AllEvents, 250);
    }
    
    pView->hide();
    pView->close();
    delete pView;
    

    If the user close the View with close button, I have no problems. If I want to close the View programmatically, the window is closed too. I cannot close the application which is calling my dylib. Inside the OAuthUrlRequestInterceptor I recognize a specific URL, then the isFinished() method returns TRUE value, and I exit from the while loop. It seems that something is not correctly closed, or some events are not correctly catch and the application cannot be closed (the File Exit menu item is grayed). In both cases the QtWebEngineProcess is closed, but if the View is not closed with the Close system button I cannot close my application. I'm using QT 5.13 under MAC OS High Sierra.

    Thanks
    Giuseppe

    1 Reply Last reply
    1

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved