Caching QVariant of the column to accelerate the QTreeView.
This commit is contained in:
parent
4449b76213
commit
b7adc4db52
|
@ -116,8 +116,8 @@ namespace Hurricane {
|
||||||
QVariant SimpleNetInformations::getColumn ( int column )
|
QVariant SimpleNetInformations::getColumn ( int column )
|
||||||
{
|
{
|
||||||
switch ( column ) {
|
switch ( column ) {
|
||||||
case 0: return QVariant(getString(getName()).c_str());
|
case 0: return _columnNet;
|
||||||
case 1: return QVariant((unsigned int)getPlugsCount());
|
case 1: return _columnPlug;
|
||||||
}
|
}
|
||||||
return QVariant(QObject::tr("Column Out of Bound"));
|
return QVariant(QObject::tr("Column Out of Bound"));
|
||||||
}
|
}
|
||||||
|
@ -125,7 +125,9 @@ namespace Hurricane {
|
||||||
|
|
||||||
SimpleNetInformations::SimpleNetInformations ( const Net* net )
|
SimpleNetInformations::SimpleNetInformations ( const Net* net )
|
||||||
: NetInformations(net)
|
: NetInformations(net)
|
||||||
, _plugsCount(_net->getPlugs().getSize())
|
, _plugsCount (_net->getPlugs().getSize())
|
||||||
|
, _columnNet (getString(getName()).c_str())
|
||||||
|
, _columnPlug ((unsigned int)_plugsCount)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,8 @@ namespace Hurricane {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
size_t _plugsCount;
|
size_t _plugsCount;
|
||||||
|
QVariant _columnNet;
|
||||||
|
QVariant _columnPlug;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue