MyTableView
::MyTableView(QWidget* parent
){
QObject::connect(verticalHeader
(),
SIGNAL(sectionResized
(int,
int,
int)),
this,
SLOT(headerResized
(int,
int,
int)));
QObject::connect(horizontalHeader
(),
SIGNAL(sectionResized
(int,
int,
int)),
this,
SLOT(headerResized
(int,
int,
int)));
}
void MyTableView::headerResized(int, int, int)
{
setFixedSize(minimumSizeHint());
}
MyTableView::MyTableView(QWidget* parent)
: QTableView(parent)
{
QObject::connect(verticalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(headerResized(int, int, int)));
QObject::connect(horizontalHeader(), SIGNAL(sectionResized(int, int, int)), this, SLOT(headerResized(int, int, int)));
}
void MyTableView::headerResized(int, int, int)
{
setFixedSize(minimumSizeHint());
}
To copy to clipboard, switch view to plain text mode
Bookmarks