Originally Posted by
aamer4yu
Also better if you use delegates for this purpose..
There have been many such questions.. search the forum, you will get the idea..
Thank u very much. Can u plz tell me how to add it. I searchd in forum , but didn't get satisfectory post.
Below is my implimentation
{
public:
CDelegatePushButton();
~CDelegatePushButton() {}
void paint();
};
CDelegatePushButton::CDelegatePushButton()
{
paint();
}
void CDelegatePushButton::paint()
{
pushButton->setFixedSize(25,30);
}
class CDelegatePushButton : public QItemDelegate
{
public:
CDelegatePushButton();
~CDelegatePushButton() {}
void paint();
};
CDelegatePushButton::CDelegatePushButton()
{
paint();
}
void CDelegatePushButton::paint()
{
QPushButton *pushButton = new QPushButton;
pushButton->setFixedSize(25,30);
}
To copy to clipboard, switch view to plain text mode
and inside my trewwidget class i added like below in constructor
treeWidget->setItemDelegate(testDelegate);
treeWidget->setItemDelegate(testDelegate);
To copy to clipboard, switch view to plain text mode
But its not working. Please tell me how to do.
Bookmarks