Qt : Show Window In Center Screen

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

QT: running a program with arguments

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

Matrix Vandermonde Code

I am very interesting with polyfit code in Matlab. I try to convert this polyfit code in Matlab to C. When I try create code polyfit from Matlab to C, I get a function vander in Matlab. vander is Matlab function to create matrix vandermonde. After searching about matrix vandermonde, I try to create matrix

contextmenu in QTableView

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