Beispiel #1
0
int main()
{
  Browser browser = Browser();

  browser.displaySize();
  
  int newRows;
  int newCols;

  cout << "Enter new # of rows: ";
  cin >> newRows;
  cout << "Enter new # of columns: ";
  cin >> newCols;

  browser.resize(newRows, newCols);

  browser.displaySize();
  
  return 0;
  
}
Beispiel #2
0
int main( int argc, char ** argv )
{
  QApplication* app = new QApplication( argc, argv );
  Browser* w = new Browser;

#if defined(_WS_QWS) || defined(Q_WS_QWS)
  w->showFullScreen();
  int ww = w->width();
  int wh = w->height();
  int dim = (ww > wh) ? wh : ww;
  dim = dim * 3 / 4;
  w->setSlideSize(QSize(3*dim/5, dim));
#else  
  w->setSlideSize(QSize(3*40, 5*40));
  w->resize(750, 270);
#endif

  QStringList files = (argc > 1) ? findFiles(QString(argv[1])) : findFiles();

  QImage img;
  for(int i = 0; i < (int)files.count(); i++)
    if(img.load(files[i]))
      w->addSlide(img);

  w->setCenterIndex(w->slideCount()/2);
  w->setBackgroundColor(Qt::white);
  w->show();

  app->connect( app, SIGNAL(lastWindowClosed()), app, SLOT(quit()) );
  int result = app->exec();

  delete w;
  delete app;

  return result;
}