1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| int main(int argc, char *argv[])
{
QApplication a(argc, argv);
string chaine = "coco";
string test = "test";
chaine = argv[0];
//chaine = argv[1];
if(argv[0]==0){
//MessageBox(NULL,"message","ok",MB_OK);
//QMessageBox::warning("",L"Message", L"Information",MB_OK);
}
QWidget fenetre;
QPixmap pixels(1024,768);
pixels.fill() ;
QPainter crayon(&pixels) ;
crayon.drawRect(0,0,1000,400) ;
//crayon.drawRect(120,150,200,100) ;
crayon.end() ;
QLabel *label2 = new QLabel(&fenetre);
label2->setPixmap(pixels);
label2->show();
fenetre.show();
QLabel *label = new QLabel(&fenetre);
label->setMinimumSize(100,100);
label ->setText(QString::fromStdString(chaine));
label->show();
label->setAcceptDrops(true);
return a.exec();
} |
Partager