int QtTreePropertyBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QtAbstractPropertyBrowser::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: collapsed((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 1: expanded((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 2: d_func()->slotCollapsed((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 3: d_func()->slotExpanded((*reinterpret_cast< const QModelIndex(*)>(_a[1]))); break;
        case 4: d_func()->slotCurrentBrowserItemChanged((*reinterpret_cast< QtBrowserItem*(*)>(_a[1]))); break;
        case 5: d_func()->slotCurrentTreeItemChanged((*reinterpret_cast< QTreeWidgetItem*(*)>(_a[1])),(*reinterpret_cast< QTreeWidgetItem*(*)>(_a[2]))); break;
        default: ;
        }
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = indentation(); break;
        case 1: *reinterpret_cast< bool*>(_v) = rootIsDecorated(); break;
        case 2: *reinterpret_cast< bool*>(_v) = alternatingRowColors(); break;
        case 3: *reinterpret_cast< bool*>(_v) = isHeaderVisible(); break;
        case 4: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 5: *reinterpret_cast< int*>(_v) = splitterPosition(); break;
        case 6: *reinterpret_cast< bool*>(_v) = propertiesWithoutValueMarked(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setIndentation(*reinterpret_cast< int*>(_v)); break;
        case 1: setRootIsDecorated(*reinterpret_cast< bool*>(_v)); break;
        case 2: setAlternatingRowColors(*reinterpret_cast< bool*>(_v)); break;
        case 3: setHeaderVisible(*reinterpret_cast< bool*>(_v)); break;
        case 4: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 5: setSplitterPosition(*reinterpret_cast< int*>(_v)); break;
        case 6: setPropertiesWithoutValueMarked(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Example #2
0
void GLESettings::readAll()
{
	// Read the application settings
	setPosition(settingStore->value("application/position", QPoint(200,200)).toPoint());
	setSize(settingStore->value("application/size", QSize(400,400)).toSize());
	setMainWindowState(settingStore->value("application/mainstate").toByteArray());
	setDrawingAreaSize(settingStore->value("application/drawingsize", QSize(400,400)).toSize());
	setStoreSize(settingStore->value("application/storeSize", true).toBool());
	setStoreDirectory(settingStore->value("application/storeDirectory", true).toBool());
	setSaveOnPreview(settingStore->value("application/saveOnPreview", false).toBool());
	setAskAboutObjects(settingStore->value("application/askAboutKeepingObjects", true).toBool());
	setAutoScaleOnOpen(settingStore->value("application/autoScaleOnOpen", true).toBool());
	setLibGSLocation(settingStore->value("application/libGSLocation", QString()).toString());
	setEditorLocation(settingStore->value("application/editorLocation", QString("")).toString());
	setDPI(settingStore->value("application/resolution", 100).toInt());
	setMonitorOpenFile(settingStore->value("application/monitorOpenFile", true).toBool());
	setMonitorAutoReloadFile(settingStore->value("application/monitorAutoReload", true).toBool());
	setSplitterPosition(settingStore->value("application/splitterSizes").toByteArray());
	setConsoleWindowAutoShowSize(settingStore->value("application/consoleAutoShowSize", 0).toInt());
	setEmulateGLEVersion(settingStore->value("application/emulateGLEVersion", 0).toInt());
	setExportFormat(settingStore->value("application/exportFormat", 0).toInt());
	setExportPageSize(settingStore->value("application/exportPageSize", 0).toInt());
	setPreviewPageSize(settingStore->value("application/previewPageSize", 0).toInt());
	setOpenExportedFigure(settingStore->value("application/openExportedFigure", true).toBool());
	setExportGrayScale(settingStore->value("application/exportGrayScale", false).toBool());
	setExportTransparent(settingStore->value("application/exportTransparent", false).toBool());
	setExportBitmapResolution(settingStore->value("application/exportBitmapResolution", 150).toInt());
	setExportVectorResolution(settingStore->value("application/exportVectorResolution", 600).toInt());
	setRenderUsingCairo(settingStore->value("application/renderUsingCairo", false).toBool());

	if (storeDirectory())
		setPwd(settingStore->value("application/workingDirectory", "").toString());

	// Read the server settings
	setPort(settingStore->value("server/portNumber", DEFAULT_PORT).toInt());
	setAutoStartServer(settingStore->value("server/autoStart", true).toBool());

	// Read the drawing settings
	setGrid(QPointF(settingStore->value("drawing/gridX", 1.0).toDouble(),
	                settingStore->value("drawing/gridY", 1.0).toDouble()));
	setEqualGrid(settingStore->value("drawing/equalGrid", false).toBool());
	setPolarSnapStartAngle(settingStore->value("drawing/polarSnapStartAngle", 0.0).toDouble());
	setPolarSnapIncAngle(settingStore->value("drawing/polarSnapIncAngle", 30.0).toDouble());
	setOsnapOnStart(settingStore->value("drawing/osnapOnStart", false).toBool());
	setOrthoSnapOnStart(settingStore->value("drawing/orthoSnapOnStart", false).toBool());
	setPolarSnapOnStart(settingStore->value("drawing/polarSnapOnStart", false).toBool());
	setPolarTrackOnStart(settingStore->value("drawing/polarTrackOnStart", false).toBool());
	setGridSnapOnStart(settingStore->value("drawing/gridSnapOnStart", false).toBool());
}
int QtTreePropertyBrowser::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QtAbstractPropertyBrowser::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 6)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 6;
    } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) {
        if (_id < 6)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 6;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = indentation(); break;
        case 1: *reinterpret_cast< bool*>(_v) = rootIsDecorated(); break;
        case 2: *reinterpret_cast< bool*>(_v) = alternatingRowColors(); break;
        case 3: *reinterpret_cast< bool*>(_v) = isHeaderVisible(); break;
        case 4: *reinterpret_cast< ResizeMode*>(_v) = resizeMode(); break;
        case 5: *reinterpret_cast< int*>(_v) = splitterPosition(); break;
        case 6: *reinterpret_cast< bool*>(_v) = propertiesWithoutValueMarked(); break;
        default: break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setIndentation(*reinterpret_cast< int*>(_v)); break;
        case 1: setRootIsDecorated(*reinterpret_cast< bool*>(_v)); break;
        case 2: setAlternatingRowColors(*reinterpret_cast< bool*>(_v)); break;
        case 3: setHeaderVisible(*reinterpret_cast< bool*>(_v)); break;
        case 4: setResizeMode(*reinterpret_cast< ResizeMode*>(_v)); break;
        case 5: setSplitterPosition(*reinterpret_cast< int*>(_v)); break;
        case 6: setPropertiesWithoutValueMarked(*reinterpret_cast< bool*>(_v)); break;
        default: break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    } else if (_c == QMetaObject::RegisterPropertyMetaType) {
        if (_id < 7)
            *reinterpret_cast<int*>(_a[0]) = -1;
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
void CPropBrowserEngineGeneral::show(QWidget* parentWindow)
{
	setPropertiesWithoutValueMarked(true); // so that group properties stand out
	setRootIsDecorated(true); // keep true, otherwise subcategories won't work correctly
	setAlternatingRowColors(true);
	setHeaderVisible(true);
	//setIndentation(60);
	//setStatusTip("bla");
	//setToolTip("Bla");
	setResizeMode(QtTreePropertyBrowser::Interactive);
	setSplitterPosition(_splitterPos);
	setWindowTitle("Physics Engines Properties - General");


	variantManager = new QtVariantPropertyManager();
	variantFactory = new QtVariantEditorFactory();
	setFactoryForManager(variantManager,variantFactory);


	buttonManager = new ButtonEditManager();
	buttonFactory  = new PushButtonEditFactory();
	setFactoryForManager(buttonManager,buttonFactory);


	QStringList configurationEnum;
	configurationEnum << "Very accurate" << "Accurate (default)" << "Fast" << "Very fast" << "Customized";
	p_configuration = variantManager->addProperty(QtVariantPropertyManager::enumTypeId(),"");
	p_configuration->setAttribute("enumNames", configurationEnum);
	QtBrowserItem* anItem=addProperty(p_configuration);
	setBackgroundColor(anItem,QTPROPERTYBROWSER_COLOR_GREY);


	QtProperty *bulletGroup = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(),"Bullet properties");
	bulletGroup->theBrightness=140;
	bulletGroupItem=addProperty(bulletGroup);
	setBackgroundColor(bulletGroupItem,QTPROPERTYBROWSER_COLOR_RED);
	setExpanded(bulletGroupItem,_bulletPropertiesExpanded);

	QtProperty *odeGroup = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(),"ODE properties");
	odeGroup->theBrightness=140;
	odeGroupItem=addProperty(odeGroup);
	setBackgroundColor(odeGroupItem,QTPROPERTYBROWSER_COLOR_GREEN);
	setExpanded(odeGroupItem,_odePropertiesExpanded);

	QtProperty *vortexGroup = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(),"Vortex properties");
	vortexGroup->theBrightness=140;
	vortexGroupItem=addProperty(vortexGroup);
	setBackgroundColor(vortexGroupItem,QTPROPERTYBROWSER_COLOR_BLUE);
	setExpanded(vortexGroupItem,_vortexPropertiesExpanded);

	// Bullet:
	p_bulletTimeStep = variantManager->addProperty(QVariant::String,"");
	bulletGroup->addSubProperty(p_bulletTimeStep);
	p_bulletConstraintSolvIterat = variantManager->addProperty(QVariant::String,"");
	bulletGroup->addSubProperty(p_bulletConstraintSolvIterat);
	p_bulletInternalScaling = variantManager->addProperty(QVariant::String,"");
	bulletGroup->addSubProperty(p_bulletInternalScaling);
	p_bulletInternalFullScaling = variantManager->addProperty(QVariant::Bool,"");
	bulletGroup->addSubProperty(p_bulletInternalFullScaling);
	p_bulletCollMarginScaling = variantManager->addProperty(QVariant::String,"");
	bulletGroup->addSubProperty(p_bulletCollMarginScaling);

	// ODE:
	p_odeTimeStep = variantManager->addProperty(QVariant::String,"");
	odeGroup->addSubProperty(p_odeTimeStep);
	p_odeQuickStep = variantManager->addProperty(QVariant::Bool,"");
	odeGroup->addSubProperty(p_odeQuickStep);
	p_odeIterations = variantManager->addProperty(QVariant::String,"");
	odeGroup->addSubProperty(p_odeIterations);
	p_odeInternalScaling = variantManager->addProperty(QVariant::String,"");
	odeGroup->addSubProperty(p_odeInternalScaling);
	p_odeInternalFullScaling = variantManager->addProperty(QVariant::Bool,"");
	odeGroup->addSubProperty(p_odeInternalFullScaling);
	p_odeGlobalErp = variantManager->addProperty(QVariant::String,"");
	odeGroup->addSubProperty(p_odeGlobalErp);
	p_odeGlobalCfm = variantManager->addProperty(QVariant::String,"");
	odeGroup->addSubProperty(p_odeGlobalCfm);

	// Vortex:
	p_vortexTimeStep = variantManager->addProperty(QVariant::String,"");
	vortexGroup->addSubProperty(p_vortexTimeStep);
	p_vortexContactTolerance = variantManager->addProperty(QVariant::String,"");
	vortexGroup->addSubProperty(p_vortexContactTolerance);
	p_vortexInternalScaling = variantManager->addProperty(QVariant::String,"");
	vortexGroup->addSubProperty(p_vortexInternalScaling);
	p_vortexInternalFullScaling = variantManager->addProperty(QVariant::Bool,"");
	vortexGroup->addSubProperty(p_vortexInternalFullScaling);
	p_vortexAutoSleep = variantManager->addProperty(QVariant::Bool,"");
	vortexGroup->addSubProperty(p_vortexAutoSleep);
	p_vortexMultithreading = variantManager->addProperty(QVariant::Bool,"");
	vortexGroup->addSubProperty(p_vortexMultithreading);

	QtProperty* vortexConstraint = variantManager->addProperty(QtVariantPropertyManager::groupTypeId(),"Constraint properties");
	vortexGroup->addSubProperty(vortexConstraint);
	vortexConstraintItem=getSubPropertyBrowserItem(vortexGroupItem,vortexConstraint);
	setExpanded(vortexConstraintItem,_vortexConstraintPropertiesExpanded);

	p_vortexConstraintLinearCompliance = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintLinearCompliance);
	p_vortexConstraintLinearDamping = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintLinearDamping);
	p_vortexConstraintLinearKinLoss = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintLinearKinLoss);
	p_vortexConstraintAngularCompliance = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintAngularCompliance);
	p_vortexConstraintAngularDamping = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintAngularDamping);
	p_vortexConstraintAngularKinLoss = variantManager->addProperty(QVariant::String,"");
	vortexConstraint->addSubProperty(p_vortexConstraintAngularKinLoss);


	refresh();

	enableNotifications(true);

//	setWindowFlags(Qt::CustomizeWindowHint|Qt::WindowMaximizeButtonHint|Qt::WindowCloseButtonHint);
//	setWindowModality(Qt::ApplicationModal);
	setGeometry(_dlgPosX,_dlgPosY,_dlgSizeX,_dlgSizeY);

}