Esempio n. 1
0
 Q_SLOT void acceptsT() {
    RefList<QString> rList;
    auto &ref = rList << a << qAsConst(b);
    rList.append(b);
    rList.append(qAsConst(a));
    QVERIFY(checkList(rList, list_abba));
    QVERIFY((is_same_dec<decltype(ref), decltype(rList)>::value));
 }
Esempio n. 2
0
void PageDef::writeTagFile(FTextStream &tagFile)
{
  bool found = name()=="citelist";
  QDictIterator<RefList> rli(*Doxygen::xrefLists);
  RefList *rl;
  for (rli.toFirst();(rl=rli.current()) && !found;++rli)
  {
    if (rl->listName()==name())
    {
      found=TRUE;
      break;
    }
  }
  if (!found) // not one of the generated related pages
  {
    tagFile << "  <compound kind=\"page\">" << endl;
    tagFile << "    <name>" << name() << "</name>" << endl;
    tagFile << "    <title>" << convertToXML(title()) << "</title>" << endl;
    tagFile << "    <filename>" << convertToXML(getOutputFileBase()) << "</filename>" << endl;
    writeDocAnchorsToTagFile(tagFile);
    tagFile << "  </compound>" << endl;
  }
}
// Refresh plugins (filters) combo
void FileSelectorWidget::refreshPlugins(const RefList<FilePluginInterface,KVMap>& filePlugins)
{
	ui.FilterCombo->clear();

	for (RefListItem<FilePluginInterface,KVMap>* ri = filePlugins.first(); ri != NULL; ri = ri->next)
	{
		FilePluginInterface* plugin = ri->item;

		// The mode_ of the file selector determines which type of plugin we display
		if (mode_ == FileSelectorWidget::SaveSingleMode)
		{
			if (!plugin->canExport()) continue;
		}
		else if (!plugin->canImport()) continue;
		ui.FilterCombo->addItem(plugin->filterString(), VariantPointer< RefListItem<FilePluginInterface,KVMap> >(ri));
	}
	ui.FilterCombo->addItem("All Files (*)");
}
Esempio n. 4
0
void PageDef::writeDocumentation(OutputList &ol)
{
  static bool generateTreeView = Config_getBool("GENERATE_TREEVIEW");

  //outputList->disable(OutputGenerator::Man);
  QCString pageName,manPageName;
  pageName    = escapeCharsInString(name(),FALSE,TRUE);
  manPageName = escapeCharsInString(name(),TRUE,TRUE);

  //printf("PageDef::writeDocumentation: %s\n",getOutputFileBase().data());

  ol.pushGeneratorState();
  //1.{ 

  if (m_nestingLevel>0 
      //&& // a sub page
      //(Doxygen::mainPage==0 || getOuterScope()!=Doxygen::mainPage) // and not a subpage of the mainpage
     )
  {
    // do not generate sub page output for RTF and LaTeX, as these are
    // part of their parent page
    ol.disableAll();
    ol.enable(OutputGenerator::Man);
    ol.enable(OutputGenerator::Html);
  }

  ol.pushGeneratorState();
  //2.{ 
  ol.disableAllBut(OutputGenerator::Man);
  startFile(ol,getOutputFileBase(),manPageName,title(),HLI_Pages,!generateTreeView);
  ol.enableAll();
  ol.disable(OutputGenerator::Man);
  startFile(ol,getOutputFileBase(),pageName,title(),HLI_Pages,!generateTreeView);
  ol.popGeneratorState();
  //2.} 

  if (!generateTreeView)
  {
    if (getOuterScope()!=Doxygen::globalScope && !Config_getBool("DISABLE_INDEX"))
    {
      getOuterScope()->writeNavigationPath(ol);
    }
    ol.endQuickIndices();
  }
  SectionInfo *si=Doxygen::sectionDict->find(name());

  // save old generator state and write title only to Man generator
  ol.pushGeneratorState();
  //2.{
  ol.disableAllBut(OutputGenerator::Man);
  ol.startTitleHead(manPageName);
  ol.endTitleHead(manPageName, manPageName);
  if (si)
  {
    ol.generateDoc(docFile(),docLine(),this,0,si->title,TRUE,FALSE,0,TRUE,FALSE);
    ol.endSection(si->label,si->type);
  }
  ol.popGeneratorState();
  //2.}

  // for Latex the section is already generated as a chapter in the index!
  ol.pushGeneratorState();
  //2.{
  ol.disable(OutputGenerator::Latex);
  ol.disable(OutputGenerator::RTF);
  ol.disable(OutputGenerator::Man);
  if (!title().isEmpty() && !name().isEmpty() && si!=0)
  {
    //ol.startSection(si->label,si->title,si->type);
    startTitle(ol,getOutputFileBase(),this);
    ol.generateDoc(docFile(),docLine(),this,0,si->title,TRUE,FALSE,0,TRUE,FALSE);
    //stringToSearchIndex(getOutputFileBase(),
    //                    theTranslator->trPage(TRUE,TRUE)+" "+si->title,
    //                    si->title);
    //ol.endSection(si->label,si->type);
    endTitle(ol,getOutputFileBase(),name());
  }
  ol.startContents();
  ol.popGeneratorState();
  //2.}

  if (m_showToc && hasSections())
  {
    writeToc(ol);
  }

  writePageDocumentation(ol);

  if (generateTreeView && getOuterScope()!=Doxygen::globalScope && !Config_getBool("DISABLE_INDEX"))
  {
    ol.endContents();
    endFileWithNavPath(getOuterScope(),ol);
  }
  else
  {
    endFile(ol);
  }

  ol.popGeneratorState();
  //1.}

  if (!Config_getString("GENERATE_TAGFILE").isEmpty())
  {
    bool found = name()=="citelist";
    QDictIterator<RefList> rli(*Doxygen::xrefLists);
    RefList *rl;
    for (rli.toFirst();(rl=rli.current()) && !found;++rli)
    {
      if (rl->listName()==name())
      {
        found=TRUE;
        break;
      }
    }
    if (!found) // not one of the generated related pages
    {
      Doxygen::tagFile << "  <compound kind=\"page\">" << endl;
      Doxygen::tagFile << "    <name>" << name() << "</name>" << endl;
      Doxygen::tagFile << "    <title>" << convertToXML(title()) << "</title>" << endl;
      Doxygen::tagFile << "    <filename>" << getOutputFileBase() << "</filename>" << endl;
      writeDocAnchorsToTagFile();
      Doxygen::tagFile << "  </compound>" << endl;
    }
  }

  Doxygen::indexList->addIndexItem(this,0,0,filterTitle(title()));
}
Esempio n. 5
0
// Context menu requested for CollectionTree
void UChromaWindow::collectionTreeContextMenuRequested(const QPoint& point)
{
	// Build the context menu to display
	QMenu contextMenu;
	QAction* action;
	// -- Main 'edit' functions
	QAction* deleteAction = contextMenu.addAction("&Delete");
	QAction* duplicateAction = contextMenu.addAction("Du&plicate");
	// -- "Display..." pane menu
	contextMenu.addSeparator();
	QMenu paneMenu, removeFromPaneMenu, addToPaneMenu;
	RefList<ViewPane,bool> displayPanes = UChromaSession::viewLayout().panes(ViewPane::StandardRole);
	RefList<ViewPane,bool> currentPanes = UChromaSession::viewLayout().panes(UChromaSession::currentCollection(), ViewPane::StandardRole);
	QList<QAction*> addToPaneActions, removeFromPaneActions;
	// -- ... Populate removeFromPaneMenu first...
	for (RefListItem<ViewPane,bool>* ri = currentPanes.first(); ri != NULL; ri = ri->next)
	{
		action = removeFromPaneMenu.addAction(ri->item->name());
		action->setData(VariantPointer<ViewPane>(ri->item));
		removeFromPaneActions << action;
	}
	// -- ... Now populate addToPaneMenu...
	for (RefListItem<ViewPane,bool>* ri = displayPanes.first(); ri != NULL; ri = ri->next)
	{
		if (currentPanes.contains(ri->item)) continue;
		action = addToPaneMenu.addAction(ri->item->name());
		action->setData(VariantPointer<ViewPane>(ri->item));
		addToPaneActions << action;
	}
	// -- Construct parent paneMenu for these submenus, and add them to it
	action = paneMenu.addMenu(&addToPaneMenu);
	action->setText("Add to pane...");
	action = paneMenu.addMenu(&removeFromPaneMenu);
	action->setText("Remove from pane...");
	action = contextMenu.addMenu(&paneMenu);
	action->setText("Display...");
	// -- Analysis
	contextMenu.addSeparator();
	QAction* fitAction = contextMenu.addAction("New &Fit Equation...");
	QAction* editFitAction = contextMenu.addAction("&Edit Fit E&quation...");
	QAction* updateFitAction = contextMenu.addAction("&Update/Continue Fit");

	// Show it
	QAction* menuResult = contextMenu.exec(QCursor::pos());

	// What was clicked?
	if (menuResult == deleteAction) on_actionCollectionDelete_triggered(false);
	else if (menuResult == duplicateAction) on_actionCollectionDuplicate_triggered(false);
	else if (removeFromPaneActions.contains(menuResult))
	{
		ViewPane* pane = VariantPointer<ViewPane>(menuResult->data());
		if (pane) pane->removeCollectionTarget(UChromaSession::currentCollection());

		// Update the item
		updateCollectionTreeItem(ui.CollectionTree->currentItem());

		updateDisplay();
	}
	else if (addToPaneActions.contains(menuResult))
	{
		ViewPane* pane = VariantPointer<ViewPane>(menuResult->data());
		if (pane) pane->addCollectionTarget(UChromaSession::currentCollection());

		// Update the item
		updateCollectionTreeItem(ui.CollectionTree->currentItem());

		updateDisplay();
	}
	else if (menuResult == fitAction) on_actionAnalyseNewFit_triggered(false);
	else if (menuResult == editFitAction) on_actionAnalyseEditFit_triggered(false);
	else if (menuResult == updateFitAction) on_actionAnalyseUpdateFit_triggered(false);
}