如何强制我的应用程序只打开一个exe? qt,linux [英] How to force my application to open one exe only? qt, linux

查看:525
本文介绍了如何强制我的应用程序只打开一个exe? qt,linux的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我的应用程序只打开一个进程,即如果一个进程已经打开,并且用户想要再次打开exe - 它不会打开另一个进程。


$ b $

解决方案 / div>

您要查找的是 QtSingleApplication



如果您启动另一个应用程式执行个体,第一个执行个体(你可以传递任何你想要的数据结构)。



我使用它将现有的应用程序带到另一个实例开始时的前端。


I want my application to open only one process, i.e. if the one process is already opened and the user want to open the exe again - it won't open another process.

how can I do it in Qt - linux?

10x!

解决方案

What you're looking for is QtSingleApplication.

If you start another instance of your application, the first one will even get notified about it (you can pass whatever data structure you want).

I used it to bring the existing application to the front whenever another instance is started.

这篇关于如何强制我的应用程序只打开一个exe? qt,linux的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆