[WRONG] PROPOSAL: QtWidgets: Add setRowVisible and setColumnVisible to QTableView
-
Hi.
I want to change visibility of rows and columns of QTableWidget. I know, that I can use (show/hide)(Row/Column) methods, but sometimes more elegant solution is to use functions that take visibility factor. So, I think it would be better to have methods setRowVisible/setColumnVisible. Second reason is current inconsistency: QWidget and other classes provide all this methods: show, hide, setVisible, while QTableView doesn't have similar methods.
I think that this wouldn't break API. -
If you want a change in the Qt API, it probably would be best to discuss it on the "interest" or "Developer" "mailing list":http://lists.qt-project.org/mailman/listinfo or "ask for a new feature here":http://bugreports.qt-project.org/, since the Qt developers don't hit the forum very often (if at all).
-
@hardcodes.de hardcodes.de
Thank you. I'll follow your suggestion. -
Isn't this what you're looking for (though inverted)?
"QTableView::setRowHidden":http://qt-project.org/doc/qt-5.0/qtwidgets/qtableview.html#setRowHidden
"QTableView::setColumnHidden":http://qt-project.org/doc/qt-5.0/qtwidgets/qtableview.html#setColumnHidden -
Yes, you are right. Thank you, that's my fault.
OK, that means the problem is in docs: there are no references to those methods from (show/hide)(Row/Column). How could I find it if methods don't copy QWidget's logic and even descriptions of methods don't contain word "visible"?
But: why this methods are inverted? I think it would be more natural if they be setRowVisible/setColumnVisible. -
The way I see it widgets are hidden by default (you need to call show to see top level widgets) so the more common operation is showing them, thus setVisible. For rows it's the opposite - they are shown by default and more common thing to do is hiding them, so there's setRowHidden.
I might be totally wrong of course.
-
Yes, your explanation seems to be logical. I can say that we have much more nontop level widgets which are visible by default, than hidden top level widgets, but Qt's point of view can be easily accepted.
I think I'll file a bug in documentation.