In many cases you may want to ensure that only one program or instance is running. In another word, if an instance of program is running and the user tries to run a new instance, you want to found that and exit second program and maybe show an appropriate message. You can implementated Qt only
I want to create a program in Qt when running show window in center screen. We must include header QStyle and QDesktopWidget to show window in center screen. This is a simple method how to create a program in Qt when running show window in center of screen : #include <QtGui/QApplication> #include "runonlyone.h" //change with
Continue from my post about how to passing argument in C/C++, now I try to create a tutorial in Qt about how to running program with argument (command line argument in Qt / Qt passing argument). In Qt, we can use class QApplication::arguments() to get argument from program. From this command, we get QStringList with
Continue with my last post about QtableView tutorial (fill Qtableview with value), I try to create another post about how to create contextmenu in QtableView. With this tutorial, you can implementated contextmenu in other Widget in Qt like QtableWidget, QlistWidget and other. The basic idea how to create contextmenu in QtableView is like with contextmenu