Anonim / 7 years, 8 months ago | Download | Plaintext | Odpowiedz |

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <QtGui>
#include <QPicture>
#include "troll.h"

TrollFace::TrollFace(QWidget *parent) : QWidget(parent)
{
    QPushButton *problemButton = new QPushButton(
            QApplication::translate("problemButton", "Problem, officer?"));
    problemButton->show();
    connect(problemButton, SIGNAL(clicked()), this, SLOT(Troll()));
    QPicture *image = new QPicture;
    image->load(":/img/troll.png");
    QLabel *trollImage = new QLabel("Troll");
    trollImage->setPicture(*image);
    trollImage->hide();
}

void TrollFace::Troll()
{
    problemButton->hide();
    trollImage->show();
}