这篇教程C++ uDebug函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中uDebug函数的典型用法代码示例。如果您正苦于以下问题:C++ uDebug函数的具体用法?C++ uDebug怎么用?C++ uDebug使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了uDebug函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: uDebug/** * Deletes a pair from the list. */void UMLForeignKeyConstraintDialog::slotDeletePair(){ // get the index of the selected pair in the view QTreeWidgetItem* twi = m_ColumnWidgets.mappingTW->currentItem(); int indexP = m_ColumnWidgets.mappingTW->indexOfTopLevelItem(twi); if (indexP == -1) { return; } //find pair in local cache EntityAttributePair pair = m_pAttributeMapList.at(indexP); // remove them from the view and the list m_ColumnWidgets.mappingTW->takeTopLevelItem(indexP); m_pAttributeMapList.removeAt(indexP); // add the attributes to the local caches m_pLocalAttributeList.append(pair.first); m_pReferencedAttributeList.append(pair.second); // add them to the view ( combo boxes ) uDebug() << (pair.first) << (pair.second); m_ColumnWidgets.localColumnCB->addItem((pair.first)->toString(Uml::st_SigNoVis)); m_ColumnWidgets.referencedColumnCB->addItem((pair.second)->toString(Uml::st_SigNoVis)); foreach(const EntityAttributePair& p, m_pAttributeMapList) { uDebug() << (p.first)->name() << " " << (p.first)->baseType() << " " << (p.second)->name() << " " << (p.second)->baseType(); } slotResetWidgetState();}
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:35,
示例2: switchvoid AssocTab::slotPopupMenuSel(QAction* action){ int currentItemIndex = m_pAssocTW->currentRow(); if ( currentItemIndex == -1 ) { return; } AssociationWidget * a = m_List.at(currentItemIndex); ListPopupMenu::Menu_Type id = m_pMenu->getMenuType(action); switch (id) { case ListPopupMenu::mt_Delete: m_pView->removeAssocInViewAndDoc(a); fillListBox(); break; case ListPopupMenu::mt_Line_Color: //:TODO: uDebug() << "Menu_Type mt_Line_Color not yet implemented!"; break; case ListPopupMenu::mt_Properties: slotDoubleClick(m_pAssocTW->currentItem()); break; default: uDebug() << "Menu_Type " << id << " not implemented"; }}
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:27,
示例3: uDebugvoid CppTree2Uml::parseElaboratedTypeSpecifier(ElaboratedTypeSpecifierAST* typeSpec){ // This is invoked for forward declarations. /// @todo Refine - Currently only handles class forward declarations. /// - Using typeSpec->text() is probably not good, decode /// the kind() instead. QString text = typeSpec->text(); uDebug() << "forward declaration of " << text; if (m_thread) { m_thread->emitMessageToLog(QString(), QLatin1String("forward declaration of ") + text); } text.remove(QRegExp(QLatin1String("^class//s+")));#if 0 if (m_thread) { //:TODO: for testing only int answer; m_thread->emitAskQuestion("Soll CppTree2Uml::parseElaboratedTypeSpecifier ausgeführt werden?"); uDebug() << "Antwort: " << answer; }#endif UMLObject *o = Import_Utils::createUMLObject(UMLObject::ot_Class, text, m_currentNamespace[m_nsCnt]);#if 0 if (m_thread) { //:TODO: for testing only m_thread->emitAskQuestion("Soll nach CppTree2Uml::parseElaboratedTypeSpecifier weiter gemacht werden?"); }#endif flushTemplateParams(static_cast<UMLClassifier*>(o));}
开发者ID:evaldobarbosa,项目名称:umbrello-1,代码行数:27,
示例4: read /** * Iterate over the attributes of the given PetalNode and for each recognized * attribute do the following: * - invoke createListItem() * - fill common properties such as name, unique ID, visibility, etc. into * the new UMLClassifierListItem * - invoke insertAtParent() with the new classifier list item as the argument * This is the user entry point. */ void read(const PetalNode *node, const QString& name) { PetalNode *attributes = node->findAttribute(m_attributeTag).node; if (attributes == NULL) {#ifdef VERBOSE_DEBUGGING uDebug() << "read(" << name << "): no " << m_attributeTag << " found";#endif return; } PetalNode::NameValueList attributeList = attributes->attributes(); for (int i = 0; i < attributeList.count(); ++i) { PetalNode *attNode = attributeList[i].second.node; QStringList initialArgs = attNode->initialArgs(); if (attNode->name() != m_elementName) { uDebug() << "read(" << name << "): expecting " << m_elementName << ", " << "found " << initialArgs[0]; continue; } UMLObject *item = createListItem(); if (initialArgs.count() > 1) item->setName(clean(initialArgs[1])); item->setID(quid(attNode)); QString quidref = quidu(attNode); QString type = clean(attNode->findAttribute(m_itemTypeDesignator).string); setTypeReferences(item, quidref, type); transferVisibility(attNode, item); QString doc = attNode->findAttribute("documentation").string; if (! doc.isEmpty()) item->setDoc(doc); insertAtParent(attNode, item); } }
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:41,
示例5: switchvoid ClassAssociationsPage::slotMenuSelection(QAction* action){ int currentItemIndex = m_pAssocLW->currentRow(); if (currentItemIndex == -1) { return; } AssociationWidget * a = m_List.at(currentItemIndex); ListPopupMenu::MenuType id = ListPopupMenu::typeFromAction(action); switch (id) { case ListPopupMenu::mt_Delete: m_pScene->removeAssocInViewAndDoc(a); fillListBox(); break; case ListPopupMenu::mt_Line_Color: //:TODO: uDebug() << "MenuType mt_Line_Color not yet implemented!"; break; case ListPopupMenu::mt_Properties: slotDoubleClick(m_pAssocLW->currentItem()); break; default: uDebug() << "MenuType " << ListPopupMenu::toString(id) << " not implemented"; }}
开发者ID:Nephos,项目名称:umbrello,代码行数:27,
示例6: uDebug/** * Exports the current model to XHTML in the given directory * @param destDir the directory where the XHTML file and the figures will * be written * @todo better handling of error conditions * @return true if saving is successful and false otherwise. */bool XhtmlGenerator::generateXhtmlForProjectInto(const KUrl& destDir){ uDebug() << "First convert to docbook"; m_destDir = destDir;// KUrl url(QString("file://")+m_tmpDir.name()); DocbookGenerator* docbookGenerator = new DocbookGenerator; docbookGenerator->generateDocbookForProjectInto(destDir); uDebug() << "Connecting..."; connect(docbookGenerator, SIGNAL(finished(bool)), this, SLOT(slotDocbookToXhtml(bool))); return true;}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:19,
示例7: parseFunctionDeclarationvoid CppTree2Uml::parseDeclaration2(GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST* typeSpec, InitDeclaratorAST* decl){ if (m_inStorageSpec) return; DeclaratorAST* d = decl->declarator(); if (!d) return; if (!d->subDeclarator() && d->parameterDeclarationClause()) return parseFunctionDeclaration(funSpec, storageSpec, typeSpec, decl); DeclaratorAST* t = d; while (t && t->subDeclarator()) t = t->subDeclarator(); QString id; if (t && t->declaratorId() && t->declaratorId()->unqualifiedName()) id = t->declaratorId()->unqualifiedName()->text(); if (!scopeOfDeclarator(d, QStringList()).isEmpty()){ uDebug() << id << ": skipping."; return; } UMLClassifier *c = m_currentClass[m_clsCnt]; if (c == NULL) { uDebug() << id << ": need a surrounding class."; return; } QString typeName = typeOfDeclaration(typeSpec, d);//:unused: bool isFriend = false; bool isStatic = false;//:unused: bool isInitialized = decl->initializer() != 0; if (storageSpec){ QList<AST*> l = storageSpec->nodeList(); for (int i = 0; i < l.size(); ++i) { QString text = l.at(i)->text(); if (text == QLatin1String("static")) isStatic = true;//:unused: else if (text == QLatin1String("friend")) isFriend = true; } } Import_Utils::insertAttribute(c, m_currentAccess, id, typeName, m_comment, isStatic); m_comment = QString();}
开发者ID:evaldobarbosa,项目名称:umbrello-1,代码行数:51,
示例8: uDebug/** * Remove a parameter from the operation. * * @param a the parameter to remove * @param emitModifiedSignal whether to emit the "modified" signal * which creates an entry in the Undo stack for the * removal, default: true */void UMLOperation::removeParm(UMLAttribute * a, bool emitModifiedSignal /* =true */){ if (a == NULL) { uDebug() << "called on NULL attribute"; return; } uDebug() << "called for " << a->name(); disconnect(a, SIGNAL(modified()), this, SIGNAL(modified())); if(!m_List.removeAll(a)) uDebug() << "Error removing parm " << a->name(); if (emitModifiedSignal) emit modified();}
开发者ID:Nephos,项目名称:umbrello,代码行数:22,
示例9: iconSet/** * Return the icon corresponding to the given Diagram_Type. * @param dt the diagram type * @return the wanted icon */QPixmap iconSet(Uml::DiagramType::Enum dt){ switch (dt) { case Uml::DiagramType::UseCase: return DesktopIcon(it_Diagram_Usecase); case Uml::DiagramType::Collaboration: return DesktopIcon(it_Diagram_Collaboration); case Uml::DiagramType::Class: return DesktopIcon(it_Diagram_Class); case Uml::DiagramType::Sequence: return DesktopIcon(it_Diagram_Sequence); case Uml::DiagramType::State: return DesktopIcon(it_Diagram_State); case Uml::DiagramType::Activity: return DesktopIcon(it_Diagram_Activity); case Uml::DiagramType::Component: return DesktopIcon(it_Diagram_Component); case Uml::DiagramType::Deployment: return DesktopIcon(it_Diagram_Deployment); case Uml::DiagramType::EntityRelationship: return DesktopIcon(it_Diagram_EntityRelationship); default: uDebug() << "Widget_Utils::iconSet: unknown diagram type " << Uml::DiagramType::toString(dt); return QPixmap(); }}
开发者ID:Nephos,项目名称:umbrello,代码行数:32,
示例10: uDebug void CmdSetTxt::undo() { m_ftw->setName(QLatin1String("balbalbalbalbla")); m_ftw->setTextcmd(m_oldstring); uDebug() << "string after undo: " << m_ftw->text() << "oldstring: "<< m_oldstring << "newstring: "<< m_newstring; }
开发者ID:KDE,项目名称:umbrello,代码行数:7,
示例11: uDebug/** * Call this method to generate sql code for a UMLClassifier. * @param c the class to generate code for */void SQLWriter::writeClass(UMLClassifier *c){ UMLEntity* e = static_cast<UMLEntity*>(c); if(!e) { uDebug()<<"Cannot write entity of NULL concept!"; return; } m_pEntity = e; QString entityname = cleanName(m_pEntity->name()); //find an appropriate name for our file QString fileName = findFileName(m_pEntity, ".sql"); if (fileName.isEmpty()) { emit codeGenerated(m_pEntity, false); return; } QFile file; if( !openFile(file, fileName) ) { emit codeGenerated(m_pEntity, false); return; } //Start generating the code!! QTextStream sql(&file); //try to find a heading file (license, coments, etc) QString str; str = getHeadingFile(".sql"); if(!str.isEmpty()) { str.replace(QRegExp("%filename%"),fileName); str.replace(QRegExp("%filepath%"),file.fileName()); sql<<str<<m_endl; } //Write class Documentation if there is somthing or if force option if(forceDoc() || !m_pEntity->doc().isEmpty()) { sql << m_endl << "--" << m_endl; sql<<"-- TABLE: "<<entityname<<m_endl; sql<<formatDoc(m_pEntity->doc(),"-- "); sql << "-- " << m_endl << m_endl; } // write all entity attributes UMLEntityAttributeList entAttList = m_pEntity->getEntityAttributes(); sql << "CREATE TABLE "<< entityname << " ("; printEntityAttributes(sql, entAttList); sql << m_endl << ");" << m_endl; // auto increments UMLEntityAttributeList autoIncrementList; foreach( UMLEntityAttribute* entAtt, entAttList ) { autoIncrementList.append(entAtt); }
开发者ID:jpleclerc,项目名称:Umbrello-ng2,代码行数:64,
示例12: uDebug/** * Call this method to generate C++ code for a UMLClassifier. * @param c the class you want to generate code for */void PythonWriter::writeClass(UMLClassifier *c){ if (!c) { uDebug() << "Cannot write class of NULL concept!"; return; } QString classname = cleanName(c->name()); UMLClassifierList superclasses = c->getSuperClasses(); UMLAssociationList aggregations = c->getAggregations(); UMLAssociationList compositions = c->getCompositions(); m_bNeedPass = true; //find an appropriate name for our file QString fileName = findFileName(c, QLatin1String(".py")); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } QFile fileh; if (!openFile(fileh, fileName)) { emit codeGenerated(c, false); return; } QTextStream h(&fileh); ////////////////////////////// //Start generating the code!! ///////////////////////////// //try to find a heading file (license, coments, etc) QString str; str = getHeadingFile(QLatin1String(".py")); if (!str.isEmpty()) { str.replace(QRegExp(QLatin1String("%filename%")), fileName); str.replace(QRegExp(QLatin1String("%filepath%")), fileh.fileName()); h<<str<<m_endl; } h << "# coding=" << h.codec()->name() << m_endl; // generate import statement for superclasses and take packages into account str = cleanName(c->name()); QString pkg = cleanName(c->package()); if (!pkg.isEmpty()) str.prepend(pkg + QLatin1Char('.')); QStringList includesList = QStringList(str); //save imported classes int i = superclasses.count(); foreach (UMLClassifier *classifier, superclasses) { str = cleanName(classifier->name()); pkg = cleanName(classifier->package()); if (!pkg.isEmpty()) str.prepend(pkg + QLatin1Char('.')); includesList.append(str); h << "from " << str << " import *" << m_endl; i--; }
开发者ID:Salmista-94,项目名称:umbrello,代码行数:64,
示例13: uError/** * Auxiliary method for recursively traversing the #include dependencies * in order to feed innermost includes to the model before dependent * includes. It is important that includefiles are fed to the model * in proper order so that references between UML objects are created * properly. * @param fileName the file to import */void CppImport::feedTheModel(const QString& fileName){ if (ms_seenFiles.indexOf(fileName) != -1) return; ms_seenFiles.append(fileName); QMap<QString, Dependence> deps = ms_driver->dependences(fileName); if (! deps.empty()) { QMap<QString, Dependence>::Iterator it; for (it = deps.begin(); it != deps.end(); ++it) { if (it.value().second == Dep_Global) // don't want these continue; QString includeFile = it.key(); if (includeFile.isEmpty()) { uError() << fileName << ": " << it.value().first << " not found"; continue; } uDebug() << fileName << ": " << includeFile << " => " << it.value().first; if (ms_seenFiles.indexOf(includeFile) == -1) feedTheModel(includeFile); } } TranslationUnitAST *ast = ms_driver->translationUnit( fileName ); if (ast == NULL) { uError() << fileName << " not found"; return; } CppTree2Uml modelFeeder( fileName ); modelFeeder.parseTranslationUnit( ast );}
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:37,
示例14: m_ftw CmdSetTxt::CmdSetTxt(FloatingTextWidget* ftw, const QString& txt) : m_ftw(ftw), m_newstring(txt) { setText(i18n("Set text : %1 to %2", ftw->name(), txt)); m_oldstring = ftw->text(); uDebug() << "oldstring: "<< m_oldstring << ", newstring: "<< m_newstring; }
开发者ID:KDE,项目名称:umbrello,代码行数:7,
示例15: uDebugvoid DocbookGenerator::slotDocbookGenerationFinished(const QString& tmpFileName){ uDebug() << "Generation Finished" << tmpFileName; KUrl url = umlDoc->url(); QString fileName = url.fileName(); fileName.replace(QRegExp(".xmi$"),".docbook"); url.setPath(m_destDir.path()); url.addPath(fileName); KIO::Job* job = KIO::file_copy(KUrl::fromPath(tmpFileName), url, -1, KIO::Overwrite | KIO::HideProgressInfo); if ( KIO::NetAccess::synchronousRun( job, (QWidget*)UMLApp::app() ) ) { umlDoc->writeToStatusBar(i18n("Docbook Generation Complete...")); m_pStatus = true; } else { umlDoc->writeToStatusBar(i18n("Docbook Generation Failed...")); m_pStatus = false; } while ( m_pThreadFinished == false ) { // wait for thread to finish qApp->processEvents(); } emit finished(m_pStatus);}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:25,
示例16: uDebug/** * Call this method to generate Pascal code for a UMLClassifier. * @param c the class to generate code for */void PascalWriter::writeClass(UMLClassifier *c){ if (!c) { uDebug() << "Cannot write class of NULL concept!"; return; } const bool isClass = !c->isInterface(); QString classname = cleanName(c->name()); QString fileName = qualifiedName(c).toLower(); fileName.replace(QLatin1Char('.'), QLatin1Char('-')); //find an appropriate name for our file fileName = overwritableName(c, fileName, QLatin1String(".pas")); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } QFile file; if (!openFile(file, fileName)) { emit codeGenerated(c, false); return; } // Start generating the code. QTextStream pas(&file); //try to find a heading file(license, comments, etc) QString str; str = getHeadingFile(QLatin1String(".pas")); if (!str.isEmpty()) { str.replace(QRegExp(QLatin1String("%filename%")), fileName); str.replace(QRegExp(QLatin1String("%filepath%")), file.fileName()); pas << str << endl; } QString unit = qualifiedName(c); pas << "unit " << unit << ";" << m_endl << m_endl; pas << "INTERFACE" << m_endl << m_endl; // Use referenced classes. UMLPackageList imports; findObjectsRelated(c, imports); if (imports.count()) { pas << "uses" << m_endl; bool first = true; foreach (UMLPackage* con, imports) { if (con->baseType() != UMLObject::ot_Datatype) { if (first) first = false; else pas << "," << m_endl; pas << " " << qualifiedName(con); } } pas << ";" << m_endl << m_endl; }
开发者ID:Nephos,项目名称:umbrello,代码行数:61,
示例17: xsltFileNamevoid Docbook2XhtmlGeneratorJob::run(){ UMLDoc* umlDoc = UMLApp::app()->document(); xsltStylesheetPtr cur = NULL; xmlDocPtr doc, res; const char *params[16 + 1]; int nbparams = 0; params[nbparams] = NULL; umlDoc->writeToStatusBar(i18n("Exporting to XHTML...")); QString xsltFileName(KGlobal::dirs()->findResource("appdata", QLatin1String("docbook2xhtml.xsl"))); uDebug() << "XSLT file is'" << xsltFileName << "'"; QFile xsltFile(xsltFileName); xsltFile.open(QIODevice::ReadOnly); QString xslt = QString::fromLatin1(xsltFile.readAll()); uDebug() << "XSLT is'" << xslt << "'"; xsltFile.close(); QString localXsl = KGlobal::dirs()->findResource("data", QLatin1String("ksgmltools2/docbook/xsl/html/docbook.xsl")); uDebug() << "Local xsl is'" << localXsl << "'"; if (!localXsl.isEmpty()) { localXsl = QLatin1String("href=/"file://") + localXsl + QLatin1String("/""); xslt.replace(QRegExp(QLatin1String("href=/"http://[^/"]*/"")), localXsl); } KTemporaryFile tmpXsl; tmpXsl.setAutoRemove(false); tmpXsl.open(); QTextStream str (&tmpXsl); str << xslt; str.flush(); xmlSubstituteEntitiesDefault(1); xmlLoadExtDtdDefaultValue = 1; uDebug() << "Parsing stylesheet " << tmpXsl.fileName(); cur = xsltParseStylesheetFile((const xmlChar *)tmpXsl.fileName().toLatin1().constData()); uDebug() << "Parsing file " << m_docbookUrl.path(); doc = xmlParseFile((const char*)(m_docbookUrl.path().toUtf8())); uDebug() << "Applying stylesheet "; res = xsltApplyStylesheet(cur, doc, params); KTemporaryFile tmpXhtml; tmpXhtml.setAutoRemove(false); tmpXhtml.open(); uDebug() << "Writing HTML result to temp file: " << tmpXhtml.fileName(); xsltSaveResultToFd(tmpXhtml.handle(), res, cur); xsltFreeStylesheet(cur); xmlFreeDoc(res); xmlFreeDoc(doc); xsltCleanupGlobals(); xmlCleanupParser(); emit xhtmlGenerated(tmpXhtml.fileName());}
开发者ID:behlingc,项目名称:umbrello-behlingc,代码行数:59,
示例18: CodeEditor/** * Adds a code document to the tabbed output. */void CodeViewerDialog::addCodeDocument( CodeDocument * doc){ CodeEditor * page = new CodeEditor ( this, "_codedocumenteditor_", doc ); QString name = doc->getFileName(); QString ext = doc->getFileExtension(); uDebug() << "name=" << name << " / ext=" << ext; m_tabWidget->addTab(page, (name + (ext.isEmpty() ? "" : ext))); connect( m_highlightCheckBox, SIGNAL( stateChanged(int) ), page, SLOT( changeHighlighting(int) ) ); connect( m_showHiddenCodeCB, SIGNAL( stateChanged(int) ), page, SLOT( changeShowHidden(int) ) );}
开发者ID:Elv13,项目名称:Umbrello-ng,代码行数:14,
示例19: uDebugvoid TclWriter::writeClass(UMLClassifier * c){ if (!c) { uDebug() << "Cannot write class of NULL concept!"; return; } QFile fileh, filetcl; // find an appropriate name for our file fileName_ = findFileName(c, ".tcl"); if (fileName_.isEmpty()) { emit codeGenerated(c, false); return; } if (!openFile(fileh, fileName_)) { emit codeGenerated(c, false); return; } // preparations className_ = cleanName(c->name()); if (!c->package().isEmpty()) { mNamespace = "::" + cleanName(c->package()); mClassGlobal = mNamespace + "::" + className_; } else { mNamespace = "::"; mClassGlobal = "::" + className_; } // write Header file writeHeaderFile(c, fileh); fileh.close(); // Determine whether the implementation file is required. // (It is not required if the class is an enumeration.) bool need_impl = true; if (!c->isInterface()) { if (c->baseType() == UMLObject::ot_Enum) need_impl = false; } if (need_impl) { if (!openFile(filetcl, fileName_ + "body")) { emit codeGenerated(c, false); return; } // write Source file writeSourceFile(c, filetcl); filetcl.close(); } // emit done code emit codeGenerated(c, true);}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:52,
示例20: uDebug/** * Selects only widgets, but no associations. * Overrides base class method. * If the press event happened on the line of an object, the object is set * as current widget. If the press event happened on a widget, the widget is * set as current widget. */void ToolBarStateMessages::setCurrentElement(){ m_isObjectWidgetLine = false; ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos()); if (objectWidgetLine) { uDebug() << Q_FUNC_INFO << "Object detected"; setCurrentWidget(objectWidgetLine); m_isObjectWidgetLine = true; return; } uDebug() << Q_FUNC_INFO << "Object NOT detected"; //commit 515177 fixed a setting creation messages only working properly at 100% zoom //However, the applied patch doesn't seem to be necessary no more, so it was removed //The widgets weren't got from UMLView, but from a method in this class similarto the //one in UMLView but containing special code to handle the zoom UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos()); if (widget) { setCurrentWidget(widget); return; }}
开发者ID:jpleclerc,项目名称:Umbrello-ng2,代码行数:29,
示例21: uDebug/** * Call this method to generate Actionscript code for a UMLClassifier. * @param c the class you want to generate code for */void ASWriter::writeClass(UMLClassifier *c){ if (!c) { uDebug()<<"Cannot write class of NULL concept!"; return; } QString classname = cleanName(c->name()); QString fileName = c->name().toLower(); //find an appropriate name for our file fileName = findFileName(c, QLatin1String(".as")); if (fileName.isEmpty()) { emit codeGenerated(c, false); return; } QFile fileas; if (!openFile(fileas, fileName)) { emit codeGenerated(c, false); return; } QTextStream as(&fileas); ////////////////////////////// //Start generating the code!! ///////////////////////////// //try to find a heading file (license, coments, etc) QString str; str = getHeadingFile(QLatin1String(".as")); if (!str.isEmpty()) { str.replace(QRegExp(QLatin1String("%filename%")), fileName + QLatin1String(".as")); str.replace(QRegExp(QLatin1String("%filepath%")), fileas.fileName()); as << str << m_endl; } //write includes UMLPackageList includes; findObjectsRelated(c, includes); foreach (UMLPackage* conc, includes) { QString headerName = findFileName(conc, QLatin1String(".as")); if (!headerName.isEmpty()) { as << "#include /"" << findFileName(conc, QLatin1String(".as")) << "/"" << m_endl; } }
开发者ID:Nephos,项目名称:umbrello,代码行数:54,
示例22: uDebug/** * Removes an entityAttribute from the class. * @param att The entityAttribute to remove. * @return Count of the remaining entityAttributes after removal. * Returns -1 if the given entityAttribute was not found. */int UMLEntity::removeEntityAttribute(UMLClassifierListItem* att){ if (!m_List.removeAll((UMLEntityAttribute*)att)) { uDebug() << "can not find att given in list"; return -1; } emit entityAttributeRemoved(att); UMLObject::emitModified(); // If we are deleting the object, then we don't need to disconnect..this is done auto-magically // for us by QObject. -b.t. // disconnect(att, SIGNAL(modified()), this, SIGNAL(modified())); delete att; return m_List.count();}
开发者ID:ShermanHuang,项目名称:kdesdk,代码行数:20,
示例23: ifvoid CppTree2Uml::parseFunctionDeclaration(GroupAST* funSpec, GroupAST* storageSpec, TypeSpecifierAST * typeSpec, InitDeclaratorAST * decl){ bool isFriend = false;//:unused: bool isVirtual = false; bool isStatic = false;//:unused: bool isInline = false; bool isPure = decl->initializer() != 0; bool isConstructor = false; if (funSpec){//:unused: QList<AST*> l = funSpec->nodeList();//:unused: for (int i = 0; i < l.size(); ++i) {//:unused: QString text = l.at(i)->text();//:unused: if (text == QLatin1String("virtual")) isVirtual = true;//:unused: else if (text == QLatin1String("inline")) isInline = true;//:unused: } } if (storageSpec){ QList<AST*> l = storageSpec->nodeList(); for (int i = 0; i < l.size(); ++i) { QString text = l.at(i)->text(); if (text == QLatin1String("friend")) isFriend = true; else if (text == QLatin1String("static")) isStatic = true; } } DeclaratorAST* d = decl->declarator(); QString id = d->declaratorId()->unqualifiedName()->text(); UMLClassifier *c = m_currentClass[m_clsCnt]; if (c == NULL) { uDebug() << id << ": need a surrounding class."; return; } QString returnType = typeOfDeclaration(typeSpec, d); UMLOperation *m = Import_Utils::makeOperation(c, id); // if a class has no return type, it could de a constructor or // a destructor if (d && returnType.isEmpty() && id.indexOf(QLatin1Char('~')) == -1) isConstructor = true; parseFunctionArguments(d, m); Import_Utils::insertMethod(c, m, m_currentAccess, returnType, isStatic, isPure, isFriend, isConstructor, m_comment); m_comment = QString();}
开发者ID:evaldobarbosa,项目名称:umbrello-1,代码行数:49,
注:本文中的uDebug函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ uError函数代码示例 C++ u8g_pgm_read函数代码示例 |