~ubuntu-branches/ubuntu/vivid/kdesdk/vivid

« back to all changes in this revision

Viewing changes to okteta/kasten/controllers/view/structures/datatypes/primitive/unsigneddatainformation.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2012-06-06 11:49:54 UTC
  • mfrom: (0.4.21)
  • Revision ID: package-import@ubuntu.com-20120606114954-rdls73fzlpzxglbx
Tags: 4:4.8.80-0ubuntu1
* New uptream beta release
* Update dont_export_private_classes.diff

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
    static QWidget* staticCreateEditWidget(QWidget* parent);
48
48
    static QVariant staticDataFromWidget(const QWidget* w);
49
49
    static void staticSetWidgetData(T value, QWidget* w);
50
 
    static int displayBase();
51
50
 
52
51
    virtual QScriptValue valueAsQScriptValue() const = 0;
53
52
    virtual QString valueString() const = 0;
78
77
template<typename T>
79
78
inline QWidget* UnsignedDataInformation<T>::staticCreateEditWidget(QWidget* parent)
80
79
{
81
 
    UIntSpinBox* ret = new UIntSpinBox(parent, displayBase());
 
80
    UIntSpinBox* ret = new UIntSpinBox(parent, PrimitiveDataInformation::unsignedDisplayBase());
82
81
    ret->setMaximum(std::numeric_limits<T>::max());
83
82
    return ret;
84
83
}
126
125
}
127
126
 
128
127
template<typename T>
129
 
inline int UnsignedDataInformation<T>::displayBase()
130
 
{
131
 
    int base = Kasten1::StructViewPreferences::unsignedDisplayBase();
132
 
    if (base == Kasten1::StructViewPreferences::EnumUnsignedDisplayBase::Binary)
133
 
        return 2;
134
 
    else if (base == Kasten1::StructViewPreferences::EnumUnsignedDisplayBase::Hexadecimal)
135
 
        return 16;
136
 
    else
137
 
        return 10; //safe default value
138
 
}
139
 
 
140
 
template<typename T>
141
128
inline AllPrimitiveTypes UnsignedDataInformation<T>::value() const
142
129
{
143
130
    return AllPrimitiveTypes(mValue);