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

Andi Fischer andi.fischer at hispeed.ch
Tue Apr 27 16:14:10 UTC 2010


On 04/27/2010 07:12 AM, Oliver Kellogg wrote:
> 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.
>>
>>      
Slowly - slowly! This has not changed at all.
Goto "Settings" - "Configure Umbrello UML Modeller ..."
In the now shown configure dialog choose the "General Settings".
There you find the checkbox "Use new C++/Java/Ruby Generators".
Check it, close umbrello and start again. When you right click on a 
class, choose "View Code" in the popup. There you are - the code editor 
comes up.

Don't remove it - it's a nice concept!

Regards,

Andi






More information about the umbrello-devel mailing list