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
AboutDialog::AboutDialog(QWidget *parent)
    : QDialog(parent)
{
    setWindowTitle(tr("Bluecherry Client - About"));
    setFixedSize(500, 400);
    setModal(true);

    QGridLayout *layout = new QGridLayout(this);

    QLabel *logo = new QLabel;
    logo->setPixmap(QPixmap(QLatin1String(":/images/logo.png"))
                    .scaled(130, 130, Qt::KeepAspectRatio, Qt::SmoothTransformation));
    logo->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
    layout->addWidget(logo, 0, 0);

    QLabel *text = new QLabel;
    text->setText(tr("Bluecherry DVR Client<br>Version %1").arg(QApplication::applicationVersion()));
    text->setAlignment(Qt::AlignHCenter | Qt::AlignTop);

    QFont font = text->font();
    font.setPixelSize(15);
    text->setFont(font);

    layout->addWidget(text, 0, 1);
    layout->setColumnStretch(1, 1);

    QTextBrowser *license = new QTextBrowser;
    license->setHtml(getLicenseText());
    license->setStyleSheet(QLatin1String("font-size: 12px"));
    license->setReadOnly(true);
    license->setOpenExternalLinks(true);
    license->setTabChangesFocus(true);
    layout->addWidget(license, 1, 0, 1, 2);

    font = QFont();
    font.setStyleHint(QFont::SansSerif);
    font.setPixelSize(13);
    license->setFont(font);
}