Beispiel #1
0
TupleComparator::TupleComparator(vector<Key> const& keys, const ArrayDesc& arrayDesc):
    _keys(keys), _arrayDesc(arrayDesc), _leFunctions(keys.size()), _eqFunctions(keys.size()), _types(keys.size())
{
    for (size_t i = 0; i < _keys.size(); i++) {
        vector<TypeId> argTypes(2, _arrayDesc.getAttributes()[_keys[i].columnNo].getType());
        FunctionDescription functionDesc;
        vector<FunctionPointer> converters;
        bool supportsVectorMode;
        if (!FunctionLibrary::getInstance()->findFunction("<", argTypes, functionDesc, converters, supportsVectorMode, false))
            throw USER_EXCEPTION(SCIDB_SE_INTERNAL, SCIDB_LE_OPERATOR_NOT_FOUND) << "<" << argTypes[0];
        _leFunctions[i] = functionDesc.getFuncPtr();
        if (!FunctionLibrary::getInstance()->findFunction("=", argTypes, functionDesc, converters, supportsVectorMode, false))
            throw USER_EXCEPTION(SCIDB_SE_INTERNAL, SCIDB_LE_OPERATOR_NOT_FOUND) << "=" << argTypes[0];
        _eqFunctions[i] = functionDesc.getFuncPtr();

        const int j = _keys[i].columnNo;
        TypeId strType = _arrayDesc.getAttributes()[j].getType();
        _types[i] = getDoubleFloatOther(strType);
    }
}
// from hyperlink in the "Related Function"
void FormulaDialog::slotShowFunction(const QString& function)
{
    FunctionDescription* desc =
        FunctionRepository::self()->functionInfo(function);
    if (!desc) return;

    // select the category
    QString category = desc->group();
    typeFunction->setCurrentIndex(typeFunction->findText(category));
    slotActivated(category);

    // select the function
    int row = functionsModel->stringList().indexOf(function);
    const QModelIndex sourcemodelindex = functionsModel->index(row, 0);
    const QModelIndex proxymodelindex = proxyModel->mapFromSource(sourcemodelindex);
    if (proxymodelindex.isValid())
        functions->setCurrentIndex(proxymodelindex);

    slotSelected(function);
}
Beispiel #3
0
// from hyperlink in the "Related Function"
void FormulaDialog::slotShowFunction( const QString& function )
{
    FunctionDescription* desc =
       FunctionRepository::self()->functionInfo( function );
    if ( !desc ) return;

    // select the category
    QString category = desc->group();
    typeFunction->setCurrentIndex(typeFunction->findText(category));
    slotActivated( category );

    // select the function
    //Q3ListBoxItem* item = functions->findItem( function, QKeySequence::ExactMatch | Qt::CaseSensitive );
    //if( item ) functions->setCurrentItem( item );
    int row = functionsModel->stringList().indexOf(function);
    const QModelIndex sourcemodelindex = functionsModel->index(row, 0);
    const QModelIndex proxymodelindex = proxyModel->mapFromSource(sourcemodelindex);
    if( proxymodelindex.isValid() )
        functions->setCurrentIndex( proxymodelindex );

    slotSelected( function );
}