int CommonView::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QWidget::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 9)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 9;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< Interval*>(_v) = interval(); break;
        case 1: *reinterpret_cast< ProtConf*>(_v) = getProtSubmit(); break;
        case 2: *reinterpret_cast< bool*>(_v) = showSource(); break;
        case 3: *reinterpret_cast< bool*>(_v) = selectParamsEnabled(); break;
        case 4: *reinterpret_cast< QString*>(_v) = dateTimeFormat(); break;
        case 5: *reinterpret_cast< QFont*>(_v) = font(); break;
        case 6: *reinterpret_cast< QString*>(_v) = printTitle(); break;
        case 7: *reinterpret_cast< QFont*>(_v) = printTitleFont(); break;
        case 8: *reinterpret_cast< QFont*>(_v) = printFont(); break;
        case 9: *reinterpret_cast< bool*>(_v) = getSaveChanges(); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setInterval(*reinterpret_cast< Interval*>(_v)); break;
        case 1: setProtConf(*reinterpret_cast< ProtConf*>(_v)); break;
        case 2: setShowSource(*reinterpret_cast< bool*>(_v)); break;
        case 3: setSelectParamsEnabled(*reinterpret_cast< bool*>(_v)); break;
        case 4: setDateTimeFormat(*reinterpret_cast< QString*>(_v)); break;
        case 5: setFont(*reinterpret_cast< QFont*>(_v)); break;
        case 6: setPrintTitle(*reinterpret_cast< QString*>(_v)); break;
        case 7: setPrintTitleFont(*reinterpret_cast< QFont*>(_v)); break;
        case 8: setPrintFont(*reinterpret_cast< QFont*>(_v)); break;
        case 9: setSaveChanges(*reinterpret_cast< bool*>(_v)); break;
        }
        _id -= 10;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 10;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 10;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Example #2
0
void TableDialog::apply()
{
    if (colName->text().contains("_")){
        QMessageBox::warning(this, tr("MantidPlot - Warning"),
        tr("For internal consistency reasons the underscore character is replaced with a minus sign."));}

    QString name=colName->text().replace("-", "_");
    if (name.contains(QRegExp("\\W"))){
        QMessageBox::warning(this,tr("MantidPlot - Error"), tr("The column names must only contain letters and digits!"));
        name.remove(QRegExp("\\W"));
	}

    int sc = d_table->selectedColumn();
    d_table->setColumnWidth(colWidth->value(), applyToAllBox->isChecked());
    d_table->setColComment(sc, comments->text().replace("\n", " ").replace("\t", " "));
    d_table->setColName(sc, name.replace("_", "-"), enumerateAllBox->isChecked());

    bool rightColumns = applyToRightCols->isChecked();
    if (rightColumns){
        bool readOnly = boxReadOnly->isChecked();
		for (int i = sc; i<d_table->numCols(); i++){
            d_table->setReadOnlyColumn(i, readOnly);
			d_table->hideColumn(i, boxHideColumn->isChecked());
		}
    } else {
        d_table->setReadOnlyColumn(sc, boxReadOnly->isChecked());
		d_table->hideColumn(sc, boxHideColumn->isChecked());
	}

    int format = formatBox->currentIndex();
    int colType = displayBox->currentIndex();
    switch(colType)
	{
	case 0:
		setNumericFormat(formatBox->currentIndex(), precisionBox->value(), rightColumns);
	break;

	case 1:
		setTextFormat(rightColumns);
	break;

	case 2:
		 setDateTimeFormat(colType, formatBox->currentText(), rightColumns);
	break;

	case 3:
		setDateTimeFormat(colType, formatBox->currentText(), rightColumns);
	break;

	case 4:
        if(format == 0)
            setMonthFormat("MMM", rightColumns);
        else if(format == 1)
            setMonthFormat("MMMM", rightColumns);
        else if(format == 2)
            setMonthFormat("M", rightColumns);
	break;

	case 5:
        if(format == 0)
            setDayFormat("ddd", rightColumns);
        else if(format == 1)
            setDayFormat("dddd", rightColumns);
        else if(format == 2)
            setDayFormat("d", rightColumns);
	break;
	}
}