switch (i){
case 0: image.load(":/quatroestacoes/primavera");
break;
case 1: image.load(":/quatroestacoes/verao");
break;
case 2: image.load(":/quatroestacoes/outono");
break;
case 3: image.load(":/quatroestacoes/inverno");
break;
case 4: image.load(":/quatroestacoes/as4estacoes");
}
return image;
}
QPixmap Sender::selectImg(int i){
QPixmap image;
switch (i){
case 0: image.load(":/quatroestacoes/primavera");
break;
case 1: image.load(":/quatroestacoes/verao");
break;
case 2: image.load(":/quatroestacoes/outono");
break;
case 3: image.load(":/quatroestacoes/inverno");
break;
case 4: image.load(":/quatroestacoes/as4estacoes");
}
return image;
}
To copy to clipboard, switch view to plain text mode
In this function i select an imagem, load it into a QPixmap object, and the return it to the call point.
You must replace ...
image.load(":/quatroestacoes/as4estacoes");
image.load(":/quatroestacoes/as4estacoes");
To copy to clipboard, switch view to plain text mode
... by something like ...
image.load("yourpath/imagename.png");
image.load("yourpath/imagename.png");
To copy to clipboard, switch view to plain text mode
... if you have not created the resource file.
...but there are many other ways to do it
Bookmarks