Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
hi , i have defined qtableview as this example i found on the internet :
model = new QStandardItemModel(2,3,this); //2 Rows and 3 Columns
model->setHorizontalHeaderItem(0, new QStandardItem(QString("ID")));
model->setHorizontalHeaderItem(1, new QStandardItem(QString("Name")));
model->setHorizontalHeaderItem(2, new QStandardItem(QString("Description")));
i'm not finding no help using google with the following issues ,can somebody help pls :
1 - how can i define a size for every columns using percentages , meaning i.e first columns 10% of the width second 50% ,third 40% .
2 - how can i disable when double clicking on a row the edit . i mean when i double click on a row it is possible to change the value of the clicked column in a specified row .
3 - if possible that when on doubleclick to highlight the whole row not only the column .
4 - make the columns resizable , meaning can be resized with the mouse dragging them .
Did you look at the setDefaultSectionSize(...). With this you need to do your math to set appropriate size.
Did you look at setSectionResizeMode(...) ?
2 and 3 are confused slightly. However you can do this with handling MouseHandling on your view
in this picture 1(in red) shows what i talked about in 2 above .
2(in red) what i mean by highlighting the whole row .
[quote author="Dheerendra" date="1410196137"]1. Did you look at the setDefaultSectionSize(...). With this you need to do your math to set appropriate size.
it didn't work , and it only takes one argument , how can i specify for each column a size .
Hi all , im still looking for an answer , if it helps it doesn't have to be a tableview , i just need to list rows and flixible columns .