//BEGIN class View View::View( Document *document, ViewContainer *viewContainer, uint viewAreaId, const char *name ) : QWidget( viewContainer->viewArea(viewAreaId), name ? name : ("view_" + QString::number(viewAreaId)).toLatin1().data() ), KXMLGUIClient() { m_pFocusWidget = 0l; m_dcopID = 0; m_viewAreaId = viewAreaId; m_pDocument = document; p_viewContainer = viewContainer; m_pViewIface = 0l; setFocusPolicy( Qt::ClickFocus ); if ( ViewArea * viewArea = viewContainer->viewArea(viewAreaId) ) viewArea->setView(this); else kDebug() << k_funcinfo << " viewArea = " << viewArea <<endl; m_layout = new QVBoxLayout(this); // Don't bother creating statusbar if no ktechlab as we are not a main ktechlab tab if ( KTechlab::self() ) { m_statusBar = new ViewStatusBar(this); m_layout->addWidget( new KVSSBSep(this) ); m_layout->addWidget( m_statusBar ); connect( KTechlab::self(), SIGNAL(configurationChanged()), this, SLOT(slotUpdateConfiguration()) ); } }
ItemDocument::ItemDocument(const QString &caption, const char *name) : Document(caption, name), m_queuedEvents(0), m_nextIdNum(1), m_bIsLoading(false), m_currentState(0), m_savedState(0) { m_zOrder.clear(); m_canvas = new Canvas(this, "canvas"); m_canvasTip = new CanvasTip(this, m_canvas); m_cmManager = new CMManager(this); updateBackground(); m_pUpdateItemViewScrollbarsTimer = new QTimer(this); connect(m_pUpdateItemViewScrollbarsTimer, SIGNAL(timeout()), this, SLOT(updateItemViewScrollbars())); m_pEventTimer = new QTimer(this); connect(m_pEventTimer, SIGNAL(timeout()), this, SLOT(processItemDocumentEvents())); connect(this, SIGNAL(selectionChanged()), this, SLOT(slotInitItemActions())); connect(ComponentSelector::self(), SIGNAL(itemClicked(const QString&)), this, SLOT(slotUnsetRepeatedItemId())); connect(FlowPartSelector::self(), SIGNAL(itemClicked(const QString&)), this, SLOT(slotUnsetRepeatedItemId())); #ifdef MECHANICS connect(MechanicsSelector::self(), SIGNAL(itemClicked(const QString&)), this, SLOT(slotUnsetRepeatedItemId())); #endif m_pAlignmentAction = new KActionMenu(i18n("Alignment"), "rightjust", this); slotUpdateConfiguration(); }
Document::Document( const QString &caption, const char *name ) : QObject( KTechlab::self(), name ), b_modified(false), m_pDocumentIface(0), m_pActiveView(0), m_caption(caption), m_bAddToProjectOnSave(false), m_dcopID(0), m_nextViewID(0), m_bDeleted(false) { connect( KTechlab::self(), SIGNAL(configurationChanged()), this, SLOT(slotUpdateConfiguration()) ); }