[Uml-devel] Some more steps to Qt4 in soc-umbrello

Oliver Kellogg oliver.kellogg at t-online.de
Tue Apr 27 05:12:28 UTC 2010


That was a bit off topic, here's the exact call graph of concern:

UMLWidget::slotMenuSelection()
    case ListPopupMenu::mt_ViewCode:
        UMLClassifier *c = dynamic_cast<UMLClassifier*>(m_pObject);
        if (c) {
            UMLApp::app()->viewCodeDocument(c);

UMLApp::viewCodeDocument()
    if (currentGen && classifier) {
        if (!dynamic_cast<SimpleCodeGenerator*>(currentGen)) {
            // (aha, not doing this for simple codegen)
            CodeDocument *cdoc =
       currentGen->findCodeDocumentByClassifier(classifier);
            if (cdoc) {
                Settings::OptionState& optionState =
       Settings::getOptionState();
                CodeViewerDialog * dialog =
       currentGen->getCodeViewerDialog(this,
                cdoc,optionState.codeViewerState, ...

CodeViewerDialog * CodeGenerator::getCodeViewerDialog
( QWidget* parent, CodeDocument *doc,
        Settings::CodeViewerState state)
{
    return new CodeViewerDialog(parent, doc, state);


CodeViewerDialog::CodeViewerDialog
( QWidget* parent, CodeDocument * doc,
   Settings::CodeViewerState state,
   const char* name, bool modal, Qt::WFlags fl )
        : KDialog ( parent, fl ), m_state(state)
{
    // .....
    addCodeDocument(doc);


void CodeViewerDialog::addCodeDocument( CodeDocument * doc)
{
    CodeEditor * page = new CodeEditor
                 ( this, "_codedocumenteditor_", doc );


(Sorry for the ugly wrapped lines, my mail program insists on them)


On Tue, 2010-04-27 at 06:24 +0200, Oliver Kellogg wrote: 
> On Tue, 2010-04-27 at 00:20 +0200, Eike Krumbacher wrote:
> > [...]
> > One last step has to be done, this is resolving this little thing with 
> > dialogs/codeeditor.*. This is the last Q3 class.
> > 
> > This CodeEditor becomes visible in uml.cpp->void 
> > UMLApp::viewCodeDocument(UMLClassifier* classifier) as CodeViewerDialog, 
> > but only if *no* SimpleCodeGenerator is used. As Riddell on #umbrello 
> > told my, all Generators are simple. So this CodeViewerDialog *never* 
> > pops up.
> 
> Maybe I'm out of the loop for too long -
> When I last worked on Umbrello (KDE 3.5), we had a setting "newcodegen"
> in the Settings::GeneralState (optionstate.h) and this could be set true
> in a $HOME/.kde resource. This setting was used by
> CodeGenFactory::createObject() (codegenerators/codegenfactory.cpp) to
> decide whether to create a a simple or an advanced code generator.
> 






More information about the umbrello-devel mailing list