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. If multiple instances launched for Browser application, stucks at :m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
Forum Updated to NodeBB v4.3 + New Features

If multiple instances launched for Browser application, stucks at :m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);

Scheduled Pinned Locked Moved Unsolved QtWebEngine
1 Posts 1 Posters 198 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.
  • S Offline
    S Offline
    Sheela
    wrote on last edited by Sheela
    #1

    I am using QT 6.6.3 library to build Browser Application:

    Browser Application developed from SimpleBrowser sample app:
    If I launch single instance of this app by passing url in command line it works fine.

    If I launch multiple instances(around 15) with different url's at the same time, Some browser instances get stuck in at statement ```
    m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);

    in createHiddenWindow() shared below :
    
    
    BrowserWindow *Browser::createHiddenWindow(const QString pageName, bool offTheRecord)
    {
        qInfo("Inside Browser::createHiddenWindow()");
    
        if (!offTheRecord && !m_profile) {
            //const QString name = u"simplebrowser."_s + QLatin1StringView(qWebEngineChromiumVersion());
            const QString name = pageName;
            m_profile.reset(new QWebEngineProfile(name));
            m_profile->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);
            m_profile->settings()->setAttribute(QWebEngineSettings::DnsPrefetchEnabled, true);
            m_profile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessRemoteUrls, true);
            m_profile->settings()->setAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls, false);
    
            QObject::connect(m_profile.get(), &QWebEngineProfile::downloadRequested,
                &m_downloadManagerWidget, [name](QWebEngineDownloadRequest* download) {
                    QString path = QStringLiteral("c:\\XXX\\downloads\\");
                    path.append(name);
                    path.append("\\");
                    download->setDownloadDirectory(QFileInfo(path).path());
                    download->setDownloadFileName(QFileInfo(path).fileName());
                    download->accept();
                });
            /*QObject::connect(m_profile.get(), &QWebEngineProfile::downloadRequested,
                             &m_downloadManagerWidget, &DownloadManagerWidget::downloadRequested);*/
        }
        auto profile = !offTheRecord ? m_profile.get() : QWebEngineProfile::defaultProfile();
        auto mainWindow = new BrowserWindow(this, profile, false);
        m_windows.append(mainWindow);
        QObject::connect(mainWindow, &QObject::destroyed, [this, mainWindow]() {
            m_windows.removeOne(mainWindow);
        });
        return mainWindow;
    }
    
    What should be the issue? How to handle this issue?
    1 Reply Last reply
    0

    • Login

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