Exemplo n.º 1
0
void ViewHelpMenu::showLicense()
{  
  QDialog b(this,Qt::Tool);
  b.setModal(true);
  QPixmap logo = ViewerIcon::getPixmap( "gnu.png");
  QLabel * llogo = new QLabel(&b);
  llogo->setGeometry(QRect(QPoint(0,0),logo.size()));
  llogo->setPixmap(logo);
  b.setMinimumSize(QSize(logo.width()*4,logo.height()));
  b.setWindowTitle("License");
  QTextBrowser * lictext = new QTextBrowser(&b);
  QFont f("Courrier", 8);
  lictext->setFont( f );
  lictext->setGeometry(QRect(logo.width(),0,logo.width()*3,logo.height()));
  // lictext->setHScrollBarMode(QScrollView::AlwaysOff);
  lictext->setLineWidth(0);
  /* QPalette pal = lictext->palette();
  QColorGroup c = pal.active();
  c.setColor(QColorGroup::Background,QColor(255,255,255));
  pal.setActive(c);
  lictext->setPalette(pal);*/
  QString copyright((TOOLS(getPlantGLDir())+"/share/plantgl/LICENSE").c_str());
  if(QFileInfo(copyright).exists() ) 
	  lictext->setSource(copyright);
  QSize s = qApp->desktop()->size();
  s = s - b.size();
  s /= 2;
  b.move(s.width(),s.height()); 
  b.exec();
}
Exemplo n.º 2
0
TextDialog::TextDialog(QString t1, QWidget *parent, QString name):
        QDialog(parent)
{
  setObjectName(name);
  setModal(true);
  setWindowTitle( tr("Output") );
  QTextBrowser *te = new QTextBrowser(this);
  te->setObjectName("good label");
  te->setText(t1);
  te->setGeometry(10,10,230,200);
  QPushButton *ok;
  ok = new QPushButton(tr("OK"), this);
  ok->setGeometry(85,250,80,30);
  ok->setPalette(QPalette(Qt::lightGray));
  connect(ok, SIGNAL(clicked()), SLOT(accept()) );
}