Important: Please read the Qt Code of Conduct -

A question on using QApplication static members

  • I am making a QML-based application, no widgets needed.

    If I need to change some application setting that seems only to be changeable with the QApplication class, such as by using QApplication::setDoubleClickInterval(int), will setting QT += widgets in the .pro file bring all the widget stuff into the application and increase its size in a manner that I might not prefer?

    If this is so, is there any way around this to change such settings? Thanks.

  • I see that there is a QStyleHints object accessible from the QGuiApplication, that can be inquired upon. It seems to be read-only, and contain system settings.

    Should this be taken so that the latest general direction of Qt is to let the application follow the user's system settings always, and not to customize such things?

  • Lifetime Qt Champion


    For setDoubleClickInterval, both macOS and Windows value are taken from the system.

    System settings are read-only because they are system settings and that the user of your application can modify them at system level. Part of this is to ensure a consistant behaviour of your application with the rest of your users system. Imagine that you start using an application that consider a double click after twice the amount of what the system uses, wouldn't it feel strange and uncomfortable ?

  • @SGaist Agreed.

Log in to reply