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 "runonlyone.h" //change with your include window application
int main(int argc, char *argv)
QApplication a(argc, argv);
runOnlyOne w; //change with your window application
Qt::AlignCenter, w.size(), qApp->desktop()->availableGeometry()));
You can change runOnlyOne with your window application. I am success to compile this Qt: Show Window In Center Screen program in Ubuntu with Qt 4.6.2.Source: http://developer.qt.nokia.com/forums/viewthread/3386/
My name is Toto Sugito. This is my notes when I try something. Maybe, this is NOT THE BEST SOLUTION for your problems. If you have other method or idea that better with my post, please share in this blog. Thank for visiting my site.