Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. set QTableWidget's row width?
Qt 6.11 is out! See what's new in the release blog

set QTableWidget's row width?

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 986 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Shadowblitz16S Offline
    Shadowblitz16S Offline
    Shadowblitz16
    wrote on last edited by
    #1

    does anybody know how to set the QTableWidget's row width?

    I see there is setColumnWidth() and setRowHeight() but that's not what I need.
    my text is being clipped by the row and I need to increase it to make it look better.

    
    MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        ui->statusBar->setSizeGripEnabled(false);
    
        ui->toolBar->setIconSize(QSize(16, 16));
    
        ui->listWidgetStrings->setFocusPolicy(Qt::NoFocus);
        for (int i=0; i<ui->tableWidget->rowCount(); i++)
            ui->tableWidget->setRowWidth(i, 32); //<- setRowWidth is not a function or method
    
       // ui->comboBox_Cycle->setItemDelegate(QAbstractItemDelegate);
        //ui->dockWidgetMain->setTitleBarWidget(new QFrame());
        //ui->tabWidget->setTabEnabled(0, false);
        //ui->tab_4->hide();
        //ui->tab_3->hide();
    
    }
    
    Ni.SumiN 1 Reply Last reply
    0
    • Shadowblitz16S Shadowblitz16

      does anybody know how to set the QTableWidget's row width?

      I see there is setColumnWidth() and setRowHeight() but that's not what I need.
      my text is being clipped by the row and I need to increase it to make it look better.

      
      MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
      {
          ui->setupUi(this);
          ui->statusBar->setSizeGripEnabled(false);
      
          ui->toolBar->setIconSize(QSize(16, 16));
      
          ui->listWidgetStrings->setFocusPolicy(Qt::NoFocus);
          for (int i=0; i<ui->tableWidget->rowCount(); i++)
              ui->tableWidget->setRowWidth(i, 32); //<- setRowWidth is not a function or method
      
         // ui->comboBox_Cycle->setItemDelegate(QAbstractItemDelegate);
          //ui->dockWidgetMain->setTitleBarWidget(new QFrame());
          //ui->tabWidget->setTabEnabled(0, false);
          //ui->tab_4->hide();
          //ui->tab_3->hide();
      
      }
      
      Ni.SumiN Offline
      Ni.SumiN Offline
      Ni.Sumi
      wrote on last edited by
      #2

      @Shadowblitz16

      sid you try these

      horizontalHeaderDefaultSectionSize
      verticalHeaderDefaultSectionSize
      

      Also check resize().

      1 Reply Last reply
      0
      • Shadowblitz16S Offline
        Shadowblitz16S Offline
        Shadowblitz16
        wrote on last edited by
        #3

        no I will though thankyou.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved