Пример #1
0
QucsHelp::QucsHelp(const QString& page,QWidget *parent) : QMainWindow(parent)
{
  currentIndex = 0;
  dataFetcher = new HtmlDataFetcher();
  links = dataFetcher->fetchLinksToFiles(QucsHelpDir.filePath("index.html"));
  // set application icon
  setWindowIcon (QPixmap(QucsSettings.BitmapDir + "big.qucs.xpm"));
  setWindowTitle(tr("Qucs Help System"));

  textBrowser = new QTextBrowser(this);
  textBrowser->setMinimumSize(400,200);
  setCentralWidget(textBrowser);
  createSidebar();//beware of order : may crash if changed
  setupActions(); // "     "   "      "    "    "  "
  

  textBrowser->setSource(QUrl(QucsHelpDir.filePath(links[0])));

  if(!page.isEmpty())
    textBrowser->setSource(QUrl(QucsHelpDir.filePath(page)));
}
Пример #2
0
QucsHelp::QucsHelp(const QString& page)
{
  currentIndex = 0;
  dataFetcher = new HtmlDataFetcher();
  links = dataFetcher->fetchLinksToFiles(QucsHelpDir.filePath("index.html"));
  // set application icon
  setIcon (QPixmap(":/bitmaps/big.qucs.xpm"));
  setCaption(tr("Qucs Help System"));

  textBrowser = new TextBrowser(this);
  textBrowser->setMinimumSize(400,200);
  setCentralWidget(textBrowser);
  setupActions();
  createSidebar();

  textBrowser->setSource(QucsHelpDir.filePath(links[0]));

  // .......................................
  if(!page.isEmpty())
    textBrowser->setSource(QucsHelpDir.filePath(page));
}
Пример #3
0
QucsHelp::QucsHelp(const QString& page)
{
  currentIndex = 0;
  dataFetcher = new HtmlDataFetcher();

  // set application icon
  // APPLE sets the QApplication icon with Info.plist
#ifndef __APPLE__
  setWindowIcon (QPixmap(":/bitmaps/big.qucs.xpm"));
#endif
  setWindowTitle(tr("Qucs Help System"));

  textBrowser = new TextBrowser(this);
  textBrowser->setMinimumSize(400,200);
  setCentralWidget(textBrowser);
  setupActions();
  createSidebar();

  QString index = "index.html";
  if (QucsHelpDir.exists(index)) {
    links = dataFetcher->fetchLinksToFiles(QucsHelpDir.filePath(index));
    qDebug() << links;
  }
  else {
    QString missing = QString(QDir::cleanPath(QucsHelpDir.absolutePath() + QDir::separator() + index));
    qWarning() << "Cannot load" << missing;
    QMessageBox::critical(this, tr("Cannot load Help files."),
                                tr("Cannot find:\n") + missing + "\n\n" +
                                tr("Setting QUCSDIR variable might be necessary."));
  }

  if (!links.empty())
    textBrowser->setSource(QUrl::fromLocalFile(QucsHelpDir.filePath(links[0])));

  // .......................................
  if(!page.isEmpty())
    textBrowser->setSource(QUrl::fromLocalFile(QucsHelpDir.filePath(page)));
}