/*! \reimp */ void QSplitterHandle::mouseReleaseEvent(QMouseEvent *e) { Q_D(QSplitterHandle); if (!opaqueResize() && e->button() == Qt::LeftButton) { int pos = d->pick(parentWidget()->mapFromGlobal(e->globalPos())) - d->mouseOffset; d->s->setRubberBand(-1); moveSplitter(pos); } }
/*! \reimp */ void QSplitterHandle::mouseMoveEvent(QMouseEvent *e) { Q_D(QSplitterHandle); if (!(e->buttons() & Qt::LeftButton)) return; int pos = d->pick(parentWidget()->mapFromGlobal(e->globalPos())) - d->mouseOffset; if (opaqueResize()) { moveSplitter(pos); } else { d->s->setRubberBand(closestLegalPosition(pos)); } }
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; }
/*! Saves the state of the splitter's layout. Typically this is used in conjunction with QSettings to remember the size for a future session. A version number is stored as part of the data. Here is an example: \snippet doc/src/snippets/splitter/splitter.cpp 1 \sa restoreState() */ QByteArray QSplitter::saveState() const { Q_D(const QSplitter); int version = 0; QByteArray data; QDataStream stream(&data, QIODevice::WriteOnly); stream << qint32(SplitterMagic); stream << qint32(version); QList<int> list; for (int i = 0; i < d->list.size(); ++i) { QSplitterLayoutStruct *s = d->list.at(i); list.append(s->sizer); } stream << list; stream << childrenCollapsible(); stream << qint32(handleWidth()); stream << opaqueResize(); stream << qint32(orientation()); return data; }
/*********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 &))); }