hai All
I am still facing some problem with ALIGNMENT ( cell_data in QTable) while am trying to include QCheckTableItem as cell_data in QTable
This is the class i have created to support Left alignment in QTable
class MyTableItem : public QTableITem
{
public :
-----
-------- // other constructors support pixmap, text..etc
// new constructor which support QCheckTableItem in Cell_Data
DWCTableItem( QTable * table,
EditType editType,
const QCheckTableItem * chkTableItem,
const QString & AlignSpec
= "LeftCenter" ) : QTableItem ( table, editType ) , m_strAlign ( AlignSpec )
{
}
virtual alignment() const
{
---
---// after some process
---
return Qt::AlignLeft ;
}
};
class MyTableItem : public QTableITem
{
QString m_strAlign ;
public :
-----
-------- // other constructors support pixmap, text..etc
// new constructor which support QCheckTableItem in Cell_Data
DWCTableItem( QTable * table,
EditType editType,
const QCheckTableItem * chkTableItem,
const QString & AlignSpec = "LeftCenter" )
: QTableItem ( table, editType ) , m_strAlign ( AlignSpec )
{
}
virtual alignment() const
{
---
---// after some process
---
return Qt::AlignLeft ;
}
};
To copy to clipboard, switch view to plain text mode
In run time am calling this as follows.....
-----------------
QTable *myTable = new QTable(.... );
QCheckTableItem *myCheckTableItem = new QCheckTableItem ( myTable, "SomeText" );
myTable->setItem ( row, col, new MyTableItem(
myTable,
QTableItem::Never,
myCheckTableItem ) );
------------------
-----------------
QTable *myTable = new QTable(.... );
QCheckTableItem *myCheckTableItem = new QCheckTableItem ( myTable, "SomeText" );
myTable->setItem ( row, col, new MyTableItem(
myTable,
QTableItem::Never,
myCheckTableItem ) );
------------------
To copy to clipboard, switch view to plain text mode
After this QTable is not showing any thing in that cell , where we used the funciton
myTable->setItem ( row, col, new MyTableItem(
myTable,
QTableItem::Never,
myCheckTableItem ) );
myTable->setItem ( row, col, new MyTableItem(
myTable,
QTableItem::Never,
myCheckTableItem ) );
To copy to clipboard, switch view to plain text mode
Please tell me whether am using the appropriate constructor of QTableITem in MyTableITem...??
please tell me what's wrong with this...!!
Thanks in advance
Bookmarks