• QAutoStart
  • QAutoStart
  • QAutoStart Class

    The QAutoStart class provides Qt cross-platform application auto start on user login. More...

    Header: #include <QAutoStart>

    Public Functions

    virtual bool isEnabled()
    virtual bool setEnabled(bool enabled)

    Static Public Members

    QAutoStart &Get()

    Detailed Description

    The following platforms are supported:

    The autostart artifact names are derived from QCoreApplication::organizationDomain() and QCoreApplication::applicationName(). These properties must be set before QAutoStart can be used.

    Example

    QCoreApplication::setApplicationName("MyApp");
    QCoreApplication::setOrganizationDomain("com.example");
    
    QAutoStart &autoStart = QAutoStart::Get();
    autoStart.setEnabled(true);

    See also QCoreApplication::setApplicationName() and QCoreApplication::setOrganizationDomain().

    Member Function Documentation

    [static] QAutoStart &QAutoStart::Get()

    Returns a reference to the singleton.

    On unsupported platforms the returned instance will do nothing.

    [virtual] bool QAutoStart::isEnabled()

    Returns true if the application is currently registered to start on user login.

    On unsupported platforms, this will always return false.

    [virtual] bool QAutoStart::setEnabled(bool enabled)

    Sets or unsets the application to auto start on user login.

    When enabled is true the platform-specific entry is created. When enabled is false the entry is removed.

    Returns true on success, false if the operation failed.

    See also isEnabled().