Added support for binding simple data to combo boxes. (not tested)
							parent
							
								
									3d9e182531
								
							
						
					
					
						commit
						ca35df241f
					
				@ -0,0 +1,33 @@
 | 
			
		||||
#include "combodata.h"
 | 
			
		||||
 | 
			
		||||
ComboData::ComboData(const QVariant &index, const QString &label)
 | 
			
		||||
{
 | 
			
		||||
    m_index = index;
 | 
			
		||||
    m_label = label;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
ComboData::~ComboData()
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
QVariant ComboData::index() const
 | 
			
		||||
{
 | 
			
		||||
    return m_index;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ComboData::setIndex(const QVariant &index)
 | 
			
		||||
{
 | 
			
		||||
    m_index = index;
 | 
			
		||||
}
 | 
			
		||||
QString ComboData::label() const
 | 
			
		||||
{
 | 
			
		||||
    return m_label;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void ComboData::setLabel(const QString &label)
 | 
			
		||||
{
 | 
			
		||||
    m_label = label;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -0,0 +1,25 @@
 | 
			
		||||
#ifndef COMBODATA_H
 | 
			
		||||
#define COMBODATA_H
 | 
			
		||||
 | 
			
		||||
#include <QVariant>
 | 
			
		||||
 | 
			
		||||
#include "core_global.h"
 | 
			
		||||
 | 
			
		||||
class CORESHARED_EXPORT ComboData
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    ComboData(const QVariant &index, const QString &label);
 | 
			
		||||
    ~ComboData();
 | 
			
		||||
 | 
			
		||||
    QVariant index() const;
 | 
			
		||||
    void setIndex(const QVariant &index);
 | 
			
		||||
 | 
			
		||||
    QString label() const;
 | 
			
		||||
    void setLabel(const QString &label);
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    QVariant m_index;
 | 
			
		||||
    QString m_label;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif // COMBODATA_H
 | 
			
		||||
					Loading…
					
					
				
		Reference in New Issue