且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何运行Qt应用程序在启动时运行?

更新时间:2023-01-30 08:35:34

QSettings与此零相关,QService适用于Symbian设备。事实上,你的问题与Qt无关。

QSettings has zero relevance to this and QService is for Symbian devices. In fact, your question has nothing to do with Qt.

你需要做的是在用户的启动文件夹中放置一个* .desktop快捷方式或链接到应用程序。请参阅:

What you need to do is place a *.desktop shortcut or link to the application in the user's startup folder. See:

http://标准.freedesktop.org / autostart-spec / autostart-spec-latest.html

例如,如果我要启动应用程序 / opt / myapp / myapp_executable 在登录时,我将创建一个 myapp.desktop 文件,包含以下内容:

For example, if I want to start the application /opt/myapp/myapp_executable at login, I would create a myapp.desktop file with the following contents:


[Desktop Entry]
Exec=/opt/myapp/myapp_executable


$ b b

并将其放在我的〜/ .config / autostart目录中。

and put it in my ~/.config/autostart directory.

如果你想要在登录时为每个用户执行,它在/ etc / xdg / autostart /中。但是,再次检查XDG网站,因为如果设置了覆盖默认值的XDG环境变量,目录可能不同。

If you want it to be executed for every user at login, then you'd put it in /etc/xdg/autostart/. But again, check the XDG site because the directory can be different if an XDG environment variable is set that overrides the default.

您的问题真的属于 http://superuser.com