/*! Restores the splitter's layout to the \a state specified. Returns true if the state is restored; otherwise returns false. Typically this is used in conjunction with QSettings to restore the size from a past session. Here is an example: Restore the splitters's state: \snippet doc/src/snippets/splitter/splitter.cpp 2 A failure to restore the splitter's layout may result from either invalid or out-of-date data in the supplied byte array. \sa saveState() */ bool QSplitter::restoreState(const QByteArray &state) { Q_D(QSplitter); int version = 0; QByteArray sd = state; QDataStream stream(&sd, QIODevice::ReadOnly); QList<int> list; bool b; qint32 i; qint32 marker; qint32 v; stream >> marker; stream >> v; if (marker != SplitterMagic || v != version) return false; stream >> list; d->setSizes_helper(list, false); stream >> b; setChildrenCollapsible(b); stream >> i; setHandleWidth(i); stream >> b; setOpaqueResize(b); stream >> i; setOrientation(Qt::Orientation(i)); d->doResize(); return true; }
KateViewManager::KateViewManager (QWidget *parentW, KateMainWindow *parent) : QSplitter (parentW) , m_mainWindow(parent) , m_blockViewCreationAndActivation (false) , m_activeViewRunning (false) { // while init m_init = true; // important, set them up, as we use them in other methodes setupActions (); guiMergedView = 0; // resize mode setOpaqueResize( KGlobalSettings::opaqueResize() ); KateViewSpace* vs = new KateViewSpace( this, 0 ); addWidget (vs); vs->setActive( true ); m_viewSpaceList.append(vs); connect( this, SIGNAL(viewChanged()), this, SLOT(slotViewChanged()) ); connect(KateDocManager::self(), SIGNAL(initialDocumentReplaced()), this, SIGNAL(viewChanged())); connect(KateDocManager::self(), SIGNAL(documentCreated(KTextEditor::Document *)), this, SLOT(documentCreated(KTextEditor::Document *))); connect(KateDocManager::self(), SIGNAL(documentDeleted(KTextEditor::Document *)), this, SLOT(documentDeleted(KTextEditor::Document *))); // init done m_init = false; }
KateViewManager::KateViewManager(QWidget *parentW, KateMainWindow *parent) : QSplitter(parentW) , m_mainWindow(parent) , m_blockViewCreationAndActivation(false) , m_activeViewRunning(false) , m_minAge(0) , m_guiMergedView(nullptr) { // while init m_init = true; // important, set them up, as we use them in other methodes setupActions(); // resize mode setOpaqueResize(style()->styleHint(QStyle::SH_Splitter_OpaqueResize, 0, this)); KateViewSpace *vs = new KateViewSpace(this, 0); addWidget(vs); vs->setActive(true); m_viewSpaceList.append(vs); connect(this, SIGNAL(viewChanged(KTextEditor::View*)), this, SLOT(slotViewChanged())); connect(KateApp::self()->documentManager(), SIGNAL(documentCreatedViewManager(KTextEditor::Document*)), this, SLOT(documentCreated(KTextEditor::Document*))); /** * before document is really deleted: cleanup all views! */ connect(KateApp::self()->documentManager(), SIGNAL(documentWillBeDeleted(KTextEditor::Document*)) , this, SLOT(documentWillBeDeleted(KTextEditor::Document*))); /** * handle document deletion transactions * disable view creation in between * afterwards ensure we have views ;) */ connect(KateApp::self()->documentManager(), SIGNAL(aboutToDeleteDocuments(const QList<KTextEditor::Document *> &)) , this, SLOT(aboutToDeleteDocuments(const QList<KTextEditor::Document *> &))); connect(KateApp::self()->documentManager(), SIGNAL(documentsDeleted(const QList<KTextEditor::Document *> &)) , this, SLOT(documentsDeleted(const QList<KTextEditor::Document *> &))); // register all already existing documents m_blockViewCreationAndActivation = true; const QList<KTextEditor::Document *> &docs = KateApp::self()->documentManager()->documentList(); foreach(KTextEditor::Document * doc, docs) { documentCreated(doc); }
int QSplitter::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QFrame::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { if (_id < 1) qt_static_metacall(this, _c, _id, _a); _id -= 1; } #ifndef QT_NO_PROPERTIES else if (_c == QMetaObject::ReadProperty) { void *_v = _a[0]; switch (_id) { case 0: *reinterpret_cast< Qt::Orientation*>(_v) = orientation(); break; case 1: *reinterpret_cast< bool*>(_v) = opaqueResize(); break; case 2: *reinterpret_cast< int*>(_v) = handleWidth(); break; case 3: *reinterpret_cast< bool*>(_v) = childrenCollapsible(); break; } _id -= 4; } else if (_c == QMetaObject::WriteProperty) { void *_v = _a[0]; switch (_id) { case 0: setOrientation(*reinterpret_cast< Qt::Orientation*>(_v)); break; case 1: setOpaqueResize(*reinterpret_cast< bool*>(_v)); break; case 2: setHandleWidth(*reinterpret_cast< int*>(_v)); break; case 3: setChildrenCollapsible(*reinterpret_cast< bool*>(_v)); break; } _id -= 4; } else if (_c == QMetaObject::ResetProperty) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyDesignable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyScriptable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyStored) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyEditable) { _id -= 4; } else if (_c == QMetaObject::QueryPropertyUser) { _id -= 4; } #endif // QT_NO_PROPERTIES return _id; }
MainWidget::MainWidget( QWidget* parent, const char* name ) : QSplitter( parent, name ), m_dirty( false ), m_wrapText( false ) { m_scanStack = new ScanStack( this, "scan stack" ); m_htmlWidget = new HTMLWidget( &m_stylesheetURLs, this, "html widget" ); m_indexWidget = new IndexWidget( m_scanStack, this, "index widget" ); moveToFirst( m_indexWidget ); m_scanStack->appendHTMLWidget( m_htmlWidget ); setOpaqueResize( true ); QTimer::singleShot( 0, this, SLOT( slotFinaliseInitialisation( ))); connect( m_htmlWidget, SIGNAL( errorLoadingLocalManPage( const QString& )), SLOT( slotErrorLoadingLocalManPage( const QString& ))); connect( m_indexWidget, SIGNAL( visibleScanWidgetChanged( ScanWidget* )), SLOT( slotVisibleScanWidgetChanged( ScanWidget* ))); }
/*********ListViews::ListViews(QWidget *parent, const char *name)************ ** ** Parameters:- 1. QWidget* :- The parameter needed by the base class i.e QSplitter ** 2. char* :- The name parameter needed by the base class, i.e., QSplitter ** Returns :- It does not return anything size its 2 argument constructor ** Description:- This is the constructor of the ListViews and is used to ** set up all the requirement and initialization of the ** components in the code. ************************************************************/ ListViews::ListViews(QWidget *parent, const char *name): QSplitter(Qt::Horizontal, parent), mpDataModelGUI(NULL), mpTreeDM(NULL), mpTreeSortDM(NULL), mpMathModel(NULL), mpCurrentWidget(NULL), mCurrentItemKey(), mpCMCAResultWidget(NULL), mpCQMCAWidget(NULL), mpCQLNAWidget(NULL), mpCLNAResultWidget(NULL), mpCompartmentsWidget(NULL), compartmentsWidget1(NULL), defaultWidget(NULL), differentialEquations(NULL), eventsWidget(NULL), eventWidget1(NULL), mpFunctionsWidget(NULL), functionWidget1(NULL), lyapWidget(NULL), lyapResultWidget(NULL), mpSpeciesWidget(NULL), metabolitesWidget1(NULL), modelWidget(NULL), mpGlobalQuantitiesWidget(NULL), mpModelValueWidget(NULL), mpEFMWidget(NULL), mpEFMResultWidget(NULL), mpMoietiesTaskResult(NULL), mpMoietiesTaskWidget(NULL), optimizationWidget(NULL), optResultWidget(NULL), paramFittingWidget(NULL), mpFittingResultWidget(NULL), mpParameterOverviewWidget(NULL), mpParameterSetsWidget(NULL), mpParameterSetWidget(NULL), mpPlotsWidget(NULL), mpPlotSubwidget(NULL), mpReactionsWidget(NULL), reactionsWidget1(NULL), scanWidget(NULL), sensWidget(NULL), sensResultWidget(NULL), stateWidget(NULL), steadystateWidget(NULL), mpReportsWidget(NULL), tableDefinition1(NULL), timeSeriesWidget(NULL), trajectoryWidget(NULL), tssaWidget(NULL), tssaResultWidget(NULL), crossSectionTaskWidget(NULL), crossSectionTimeSeriesWidget(NULL), #ifdef COPASI_NONLIN_DYN_OSCILLATION oscillationTaskWidget(NULL), #endif #ifdef COPASI_DEBUG mpUpdatesWidget(NULL), #endif mpLayoutsWidget(NULL), mpMathMatrixWidget(NULL) { // Qt3 support to Qt4 reference states . . . // "Use the QSizePolicy() constructor and call the setHorizontalStretch(), setVerticalStretch(), and setHeightForWidth() functions instead." // The stretch was set at "1 ,1", before, but maybe it doesn't need to be explicitly set now. this->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred)); setChildrenCollapsible(false); // create a new QListview to be displayed on the screen..and set its property mpTreeView = new CQBrowserPane(this); mpTreeDM = new CQBrowserPaneDM(this); mpTreeSortDM = new QSortFilterProxyModel(this); mpTreeSortDM->setSourceModel(mpTreeDM); mpTreeSortDM->setSortRole(Qt::EditRole); mpTreeSortDM->setSortCaseSensitivity(Qt::CaseInsensitive); // pSortModel->sort(0, Qt::AscendingOrder); mpTreeView->setModel(mpTreeSortDM); mpTreeView->sortByColumn(0, Qt::AscendingOrder); mpStackedWidget = new QStackedWidget(this); addWidget(mpTreeView); addWidget(mpStackedWidget); if (!opaqueResize()) setOpaqueResize(); defaultWidget = new CQSplashWidget(this); mpStackedWidget->addWidget(defaultWidget); mpCurrentWidget = defaultWidget; // keeps track of the mpCurrentWidget in use mCurrentItemKey = ""; mpStackedWidget->setCurrentWidget(defaultWidget); QList<int> Sizes = sizes(); Sizes[0] = 240; Sizes[1] = 560; setSizes(Sizes); // establishes the communication between the mpTreeView clicked and the routine called.... connect(mpTreeDM, SIGNAL(dataChanged(const QModelIndex &, const QModelIndex &)), this, SLOT(slotSort(const QModelIndex &, const QModelIndex &))); }