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

  • SEARCH
  • Home
  • 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 9019281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:44:22+00:00 2026-06-16T04:44:22+00:00

I open website with QDeclarativeView and use JavaScript to load next pages in same

  • 0

I open website with QDeclarativeView and use JavaScript to load next pages in same view.

After each website loaded, my program occupy 20mb more of memory. How do i clean the cache or otherwise release the memory after new website is loaded?

I tried:

decView->engine()->rootContext()->setContextProperty(“myEngine”, decView->engine());

and then in qml

myEngine.clearComponentCache()

but i get

TypeError: Result of expression ‘myEngine.clearComponentCache’ [undefined] is not a function.

What i should do?

EDIT: here is what i got sofar:

aws.cpp

void Aws::openQMLWindowSlot(){
   QDeclarativeView *decView= new QDeclarativeView();
   decView->engine()->rootContext()->setContextProperty("myAws",this);
   decView->setSource(QUrl("qrc:/inc/firstqml.qml"));
   decView->show();
}

void Aws::clearCacheQMLSlot(){

//HERE I GOT PROBLEM
}

firstqml.qml

import QtQuick 1.1
import QtWebKit 1.0
WebView {

    id: webView
    objectName: "myWebView"
    url:"http://example.com"
    onLoadFinished: {myAws.clearCacheQMLSlot();}
}
  • 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-06-16T04:44:24+00:00Added an answer on June 16, 2026 at 4:44 am

    There two reasons why your code doesn’t work as intended. First, to be able to access slots and invokable methods of QObject descendants, you have to register them:

    qmlRegisterType<QDeclarativeEngine>("MyApp", 1, 0, "QDeclarativeEngine");
    

    And second, QDeclarativeEngine::clearComponentCache is neither a slot nor an invokable method, so it would still not work. It is simply impossible to call normal C++ methods from QML.

    What you actually have to do is to implement an own QObject based class wrapping the call to QDeclarativeEngine::clearComponentCache in a slot, registering the class like above, set an instance of that class as an context property like you did with the declarative engine and finally call the slot from QML.

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

Sidebar

Related Questions

I want to open a website, change its javascript, then show the website +
I want to be able to open my website and use some kind of
In a setup project i want to automatically open a website directly after the
I use Java Applet like an example. When you open a website which has
If I open a website, how I can view my own computer's contents on
When I run Firefox and open any website, after some time I am getting
I have added a website to the iOS home screen. If a load open
I need to open a website in fullscreen, in this way I use: webSettings.setLoadWithOverviewMode(true);
I have created a facebook website open graph application for my website www.heyngine.com. The
By looking into the Open JPA website i've found that i can log the

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.