Best way to do private browsing mode

  • Hello everyone,

    I have been trying to figure out a way to give my browser a 'Privacy Mode' with little success. I was thinking about having a slot 'enablePrivacy', when called this slot would set the browser to 'Privacy Mode'. I have a lot of other slots that handle stuff like page loading, application styles, history, etc. I need these slots to be able to check if 'Privacy Mode' has been enabled or not. I am thinking about having enablePrivacy() set the value of a global QString to 'enabled' and then have all the other slots check via if() statements. Is this a good way to do it? is it a wise choice to use a global variable? If not how can I set something to 'enabled' and have all other slots check that?


  • Qt Champions 2017

    one property value as you explained. Otherway is inherit the class and add your own variable. I prefer property way as you explained.

  • Okay how can I declare a global variable and access it in functions of other classes?

Log in to reply