Bonjour à tous,
j'ai un petit souçi si quelqu'un peut m'aider s'il vous plait, merci.
voici ce que j'aimerai faire : j'ai 2 QGridLayout, j'insère mon 2ème QGridLayout à l'intérieure du premier.Mon 2ème QGridLayout contient des images qui doivent être coller, c'est à dire pas d'espace vertical ni horizontal.
en gros ça donne cela:
le résultat que j'obtiens:
Voici mon code :
Merci de m'aider s'il vous plait.,
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 QGridLayout *layout = new QGridLayout(); QGridLayout *temp = new QGridLayout(); temp->setHorizontalSpacing(0); temp->setVerticalSpacing(0); QImage *myImage = new QImage(); myImage->load("C:/Users/carre-blanc.jpg"); QLabel *label = new QLabel(); label->setPixmap(QPixmap::fromImage(*myImage)); for(int i=0; i<5; i++) { for(int j=0; j<5;j++) { QLabel *label = new QLabel(); label->setPixmap(QPixmap::fromImage(*myImage)); temp->addWidget(label,i,j); } } layout->addLayout(temp,0,0);
Ps:petit question y-a-t'il moyen de "traçer" les lignes et colonnes du QGridLayout genre
une méthode du style SetLineVisible(true), j'ai cherché mais rien trouvé.
Partager