Exemple #1
0
CSVSettings::RangeView::RangeView (CSMSettings::Setting *setting,
                                       Page *parent)
    : mRangeWidget (0), mRangeType (setting->type()), View (setting, parent)
{

    mRangeWidget = 0;

    if (isMultiValue())
        return;

    switch (mRangeType)
    {
    case CSMSettings::Type_SpinBox:
    case CSMSettings::Type_DoubleSpinBox:
        buildSpinBox (setting);
    break;

    case CSMSettings::Type_Dial:
    case CSMSettings::Type_Slider:
        buildSlider (setting);
    break;

    default:
        break;
    }

    if(mRangeWidget)
    {
        mRangeWidget->setFixedWidth (widgetWidth (setting->widgetWidth()));
        mRangeWidget->setObjectName (setting->name());
    }

    addWidget (mRangeWidget);
}
Exemple #2
0
CSVSettings::TextView::TextView(CSMSettings::Setting *setting, Page *parent)
    : mDelimiter (setting->delimiter()), View (setting, parent)

{
    if (setting->isMultiLine())
        mTextWidget = new QTextEdit ("", this);
    else
        mTextWidget = new QLineEdit ("", this);

    if (setting->widgetWidth() > 0)
        mTextWidget->setFixedWidth (widgetWidth (setting->widgetWidth()));

    connect (mTextWidget, SIGNAL (textEdited (QString)),
           this, SLOT (slotTextEdited (QString)));

    addWidget (mTextWidget, setting->viewRow(), setting->viewColumn());
}
Exemple #3
0
QWidget *CSVSettings::ListView::buildWidget(bool isMultiLine, int width)
{
    QWidget *widget = 0;

    if (isMultiLine)
    {
        mAbstractItemView = new QListView (this);
        widget = mAbstractItemView;

        if (width > 0)
            widget->setFixedWidth (widgetWidth (width));
    }
    else
    {
        mComboBox = new QComboBox (this);
        widget = mComboBox;

        if (width > 0)
            mComboBox->setMinimumContentsLength (width);
    }

    return widget;
}