Logo Search packages:      
Sourcecode: qantenna version File versions  Download package

bool MainWindow::snapshot ( QPixmap &  pixmap  )  [slot]

Asks for the desired resolution and renders the viewport into a QPixmap

Definition at line 539 of file mainwindow.cpp.

References Camera::limit(), and ui.

Referenced by renderToClipboard(), and renderToFile().

{
      QString text= "";
      QRegExp regExp(tr("([0-9]+) *x *([0-9]+)"));
      bool ok= true;

      while(ok && !regExp.exactMatch(text)) {
      text= QInputDialog::getText(this, tr("Render into file"),
            tr("Enter the desired resolution:"), QLineEdit::Normal,
            tr("%1 x %2").arg(renderWidth).arg(renderHeight), &ok);
    }
      if(!ok) return false;

      // Resolution
      int width= Camera::limit(regExp.cap(1).toInt(), 100, 2048);
      int height= Camera::limit(regExp.cap(2).toInt(), 100, 2048);

      // Store resolution
      renderWidth= width;
      renderHeight= height;

      QSize size(width, height);
      QSize oldSize= ui.widgetGL->size();

      pixmap= ui.widgetGL->snapshot(width, height);

      return true;
}


Generated by  Doxygen 1.6.0   Back to index