There is a Qt program I have to modify, the task was to make a screenshot of the window by pressing key "S", with some text on it. The main problem is that I can only screenshot the QImage without the QString.

void FrakAblak::keyPressEvent(QKeyEvent *event)
{
if (event->key() == Qt::Key_N){

    if(szamitasFut)
        return;



         iteraciosHatar *= 2;
    szamitasFut = true;

    delete mandelbrot;

     mandelbrot = new FrakSzal(a, b, c, d, szelesseg, magassag,     iteraciosHatar, this);

   mandelbrot->start();


  }  else if (event->key() == Qt::Key_S) {

 QString str1 =QString::number(a);
 QString str2 =QString::number(b);
 QString str3 =QString::number(c);
 QString str4 =QString::number(d);
 QString str5 =QString::number(iteraciosHatar);
 QString text = QString("a= %1 b= %2 \nc= %3 d= %4\niteraciosHatar: %5").arg(str1,str2,str3,str4,str5);
 QLabel *label = new QLabel(this);

 label->setText(text);
 label->resize(500,60);
 label->show();


  fraktal->save("mandel.png");

 }
 }  

0 Answers