I want to hide the row number column in QTableWidget

백자현

Normal QTablewidget is as follows:

          a             b
1        data          data
2        data          data
3        data          data

I want to remove the first column that shows row numbers. My table should look like this:

  a             b
data          data
data          data
data          data

I can not find the way to do this. Let me know if there is a way to add items more easily. That 's how I implemented my table:

QString a[5];
    a[0]="ddd";
QTableWidgetItem *item1 = new QTableWidgetItem(a[0]);
ui->tableWidget->setItem(0,0,item1 );
Samurai Jack

There are two views in QTable the vertical and the horizontal header, they are defined in QTableView, as any widget you can hide them so it can be done as below :

ui->tableWidget->verticalHeader()->setVisible(false); // Get Vertical header and hide it

You can have vertical header in easy way as one line code,

ui->tableWidget->setHorizontalHeaderLabels(QString("HEADER 1;HEADER 2;HEADER 3;HEADER 4").split(";"));

For setting the data in Table you can use QString Array which contains data using for loop you can store the data in table, but you need to take care about indexing.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

I want to multiply column row strings n number of times

From Dev

I want to hide table row of particular cells

From Dev

I want to hide table row of particular cells

From Dev

I want the min number of the column

From Dev

A cell contains the number of row and I want to get the value of that row on specific column

From Dev

I want to update a column if the row is duplicate

From Dev

How to detect the row and column number of cellwidget user clicked on QTableWidget in PyQt4?

From Dev

output is column and want it to be in a row

From Dev

In Gridview, I want to capture the Column Id's value for the selected Row

From Dev

Google Chrome selects whole column if I want to select a row

From Dev

I want to delete a column named "row.names."

From Dev

i want to update only single row column value with rollback commit

From Dev

How can I hide row/column headers in a NatTable?

From Dev

Scrappy outputs the data column by column, I want to scrape row by row. How is it possible?

From Dev

I want to hide all rows in a google drive spreadsheet that do not have any value in the cells in Column A

From Dev

I want to shift the value in a column for a particular row and shift the other rows one down in the column ?

From Dev

Grouping by row number in a column

From Dev

How can I use ROW_NUMBER() if the column name is not identified?

From Dev

How can I use ROW_NUMBER() if the column name is not identified?

From Dev

How do I find a value in a row and return the column number with VBA?

From Dev

I want to extract particular column from the file, column number is given in different file using shell scripting?

From Dev

There are 2 tables, A(column a) and B(column b). I want to find the number of occurrences of each value in table A column a in table B column b

From Dev

There are 2 tables, A(column a) and B(column b). I want to find the number of occurrences of each value in table A column a in table B column b

From Dev

I want to expand.grid from each row of a matrix when the matrix could have variable number of rows

From Dev

I want to count the number of occurence of a string in a row (specific to 3 columns: B, J, K).

From Dev

Excel: Duplicate names in column A, unique data in column B. I want one row for each unique name with multiple column

From Dev

I want to display string into row by row

From Dev

After Defining new columns using values of a row in sql I want a new column that will be the summation of the columns

From Dev

I want to check if first column contains textbox1 and display full row in listview

Related Related

  1. 1

    I want to multiply column row strings n number of times

  2. 2

    I want to hide table row of particular cells

  3. 3

    I want to hide table row of particular cells

  4. 4

    I want the min number of the column

  5. 5

    A cell contains the number of row and I want to get the value of that row on specific column

  6. 6

    I want to update a column if the row is duplicate

  7. 7

    How to detect the row and column number of cellwidget user clicked on QTableWidget in PyQt4?

  8. 8

    output is column and want it to be in a row

  9. 9

    In Gridview, I want to capture the Column Id's value for the selected Row

  10. 10

    Google Chrome selects whole column if I want to select a row

  11. 11

    I want to delete a column named "row.names."

  12. 12

    i want to update only single row column value with rollback commit

  13. 13

    How can I hide row/column headers in a NatTable?

  14. 14

    Scrappy outputs the data column by column, I want to scrape row by row. How is it possible?

  15. 15

    I want to hide all rows in a google drive spreadsheet that do not have any value in the cells in Column A

  16. 16

    I want to shift the value in a column for a particular row and shift the other rows one down in the column ?

  17. 17

    Grouping by row number in a column

  18. 18

    How can I use ROW_NUMBER() if the column name is not identified?

  19. 19

    How can I use ROW_NUMBER() if the column name is not identified?

  20. 20

    How do I find a value in a row and return the column number with VBA?

  21. 21

    I want to extract particular column from the file, column number is given in different file using shell scripting?

  22. 22

    There are 2 tables, A(column a) and B(column b). I want to find the number of occurrences of each value in table A column a in table B column b

  23. 23

    There are 2 tables, A(column a) and B(column b). I want to find the number of occurrences of each value in table A column a in table B column b

  24. 24

    I want to expand.grid from each row of a matrix when the matrix could have variable number of rows

  25. 25

    I want to count the number of occurence of a string in a row (specific to 3 columns: B, J, K).

  26. 26

    Excel: Duplicate names in column A, unique data in column B. I want one row for each unique name with multiple column

  27. 27

    I want to display string into row by row

  28. 28

    After Defining new columns using values of a row in sql I want a new column that will be the summation of the columns

  29. 29

    I want to check if first column contains textbox1 and display full row in listview

HotTag

Archive