I have implemented like as below ... but not working the alignment to LEFT
class MyTableItem : public QTableItem
{
public:
MyTableItem
( QTable
* table, EditType editType,
const QString & text
) :QTableItem ( table, editType, text )
{
}
~MyTableItem()
{
/*NOOP*/
}
int alignment()
{
return Qt::AlignLeft; //or Qt::AlignRight;
}
};
class MyTableItem : public QTableItem
{
public:
MyTableItem( QTable * table, EditType editType, const QString & text )
:QTableItem ( table, editType, text )
{
}
~MyTableItem()
{
/*NOOP*/
}
int alignment()
{
return Qt::AlignLeft; //or Qt::AlignRight;
}
};
To copy to clipboard, switch view to plain text mode
Then inside my MyMainWindow Class.... as follows
------
-----
void MyMainWindow :: refreshTable()
{
----
myTable->setItem( row , col, new MyTableItem( myTable , QTableItem::Never, TextInCell );
---
}
------
-----
void MyMainWindow :: refreshTable()
{
----
myTable->setItem( row , col, new MyTableItem( myTable , QTableItem::Never, TextInCell );
---
}
To copy to clipboard, switch view to plain text mode
I have debugged the code , the control comes in alignment() of MyTableItem...
please lead me to a right way if i am wrong..
Thank you
Bookmarks