Fatihul Ulum Community of Knowledge
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Menengahkan applikasi

Go down

Menengahkan applikasi Empty Menengahkan applikasi

Post  zz Sun Jul 12, 2009 12:03 am

Code Dibawah ini akan membuat applikasi muncul di tengah-tengah Desktop
bagi yang mau donload applicasinya silahkan klik link dibawah ini
http://www.ziddu.com/download/5566178/popo.zip.html
dan dibawah ini adalah source codenya
Code:

#include <QtGui>
#include <QApplication>
int main (int argc, char *argv [] )
{
   QApplication app (argc,argv);
   QDesktopWidget wid;
    int dw = wid.width();
    int dh = wid.height();
 
   QDialog dia;
   dia.setGeometry (
                QRect
                   (
                     int((dw - (dw - (dw / 2)) * 1.5) / 2 ),
                       int((dh - (dh - (dh / 2)) * 1.5) / 2 ),
                       int((dw - (dw / 2)) * 1.5 ),
                       int((dh - (dh / 2)) * 1.5 )
                    )
                 );
   dia.show();
   return app.exec();
}                 
              
Semoga bisa membantu
zz
zz
Panglima
Panglima

Jumlah posting : 121
Age : 78
Lokasi : france
Registration date : 13.02.09

Kembali Ke Atas Go down

Kembali Ke Atas

- Similar topics

 
Permissions in this forum:
Anda tidak dapat menjawab topik