The QAutoStart class provides Qt cross-platform application auto start on user login. More...
| Header: | #include <QAutoStart> |
| virtual bool | isEnabled() |
| virtual bool | setEnabled(bool enabled) |
| QAutoStart & | Get() |
The following platforms are supported:
HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run.~/Library/LaunchAgents/..desktop file in ~/.config/autostart/.The autostart artifact names are derived from QCoreApplication::organizationDomain() and QCoreApplication::applicationName(). These properties must be set before QAutoStart can be used.
QCoreApplication::setApplicationName("MyApp"); QCoreApplication::setOrganizationDomain("com.example"); QAutoStart &autoStart = QAutoStart::Get(); autoStart.setEnabled(true);
See also QCoreApplication::setApplicationName() and QCoreApplication::setOrganizationDomain().
[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().