[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Using the doc-view model with a KTabCtl
From:       Daniel <dadecal () teleline ! es>
Date:       2000-03-08 8:42:58
[Download RAW message or body]

My application uses a KTabCtl widget as the main view(AppView inherits
KTabCtl), with three different tabs. This is giving me a hard time to
follow the doc-view model, since things I see should be done in the view
class, in my case they have to be done in the classes that define the
widgets for each tab. Here's what the code looks like:

void KonStructApp::initView()
{
 view = new KonStructView(this);
 graphicWidget = new KonGraphic(view);
 view->addTab(graphicWidget,i18n("Design Module"));
 graphicWidget->setBackgroundColor(black);
 graphicWidget->setFrameStyle(QFrame::WinPanel|QFrame::Sunken);

 editWidget2 = new KEdit(kapp,view,"Calculation_Module");
 editWidget2->setFocusPolicy(QWidget::StrongFocus);
 view->addTab(editWidget2,i18n("Calculation Module"));

 editWidget = new KEdit(kapp,view,"Results");
 editWidget->setFocusPolicy(QWidget::StrongFocus);
 view->addTab(editWidget,i18n("Results"));

 doc->addView(view);
 setView(view);
 QString caption=kapp->getCaption();
 setCaption(caption+": "+doc->getTitle());
 connect(view, SIGNAL(tabSelected(int)),SLOT(slotToggleModule(int)));
}

so the thing is that my KonStructView class contains very little and the
main activity grows arround the KonGraphic class. It seems to me this
isn't the right way to use the view-doc model.
Could someone explain me how to do it?

Daniel de los Reyes Calvo
dadecal@arq.upv.es

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic