QT tabview 横向自适应

    ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);   //自动调整列宽
    ui->tableView->horizontalHeader()->setStretchLastSection(true);                           //最后一列缩放
    ui->tableView_2->setAlternatingRowColors(true);                                           //隔行变色
    ui->tableView_2->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);   //自动调整列宽
    ui->tableView_2->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);            //横向自适应

posted on 2022-09-26 17:04  xihong  阅读(216)  评论(0编辑  收藏  举报

导航