Hi,
I checked the documentation but I couldn't find if there is a way to remove borders between the columns of the table. Is there a way to perform this task?
Hi,
I checked the documentation but I couldn't find if there is a way to remove borders between the columns of the table. Is there a way to perform this task?
they depend from style. so, you can try to write your own style or use your own stylesheet insted.
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Hi again,
I see what you are saying but I couldn't give a style for the header rows or columns. They only return integers when I said ...columnAt(int x) unlike table cells. Thus, I couldn't play with their styles. When I tried to change the style from the tablewidget itself ( i.e.: myTableWidget.setStyleSheet("border-style:none")); ) , it only removes the border of the cells but not the header columns and rows.
try this (from Qt Assistant)
QHeaderView::section {
background-color: qlineargradient(x1:0, y1:0, x2:0, y2:1,
stop:0 #616161, stop: 0.5 #505050,
stop: 0.6 #434343, stop:1 #656565);
color: white;
padding-left: 4px;
border: 1px solid #6c6c6c;
}
Qt Assistant -- rocks!
please, use tags [CODE] & [/CODE].
Ok it worked!
By the way, is there a way to exclude horizontal header of the table widget from the table widget's frame?
I tried horizontalHeader.setFrameStyle(QFrame::NoFrame), not interestingly it didn't work![]()
I have one more question that I just encountered that is;
I want to setTextAlignment for the items in the table such as the following:
Qt Code:
for( int row=0; ...) { for(int column=0;...) { myTableWidget.item ( row, column ).setTextAlignment(Qt::AlignCenter); } }To copy to clipboard, switch view to plain text mode
it only aligns the first - table(0,0) - item but not the rest.
What could be the problem?
Thanks in advance
Last edited by jpn; 15th March 2009 at 10:59. Reason: missing [code] tags
it's done!
the error was just a minor logical error. The code I posted above is working now.
Bookmarks