星海's Blog

老头初学编程
乱七八糟的入门知识

QT tablModel/View编程中,QTABLEVIEW的视图大小问题

星海 posted @ 2012年6月08日 10:25 in C++学习 , 3798 阅读

MODEL继承自QAbstractTableModel,

VIEW使用的QTABLEVIEW。

 

就列的显示大小和弹簧问题,做了很多尝试。

现在基本可以达到满意效果。

 

    tableView = new QTableView;
    tableView->horizontalHeader()->setStretchLastSection(true);
    tableView->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
    tableView->horizontalHeader()->setResizeMode(4, QHeaderView::Stretch);
    tableView->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    tableView->setModel(model);
 

Avatar_small
HDFC BANK Mobile Ban 说:
2021年11月22日 16:43

Those days are gone when availing banking services required one to go to the bank and then stand in the queue and wait for one’s turn. Now, everything has turned better and has taken to the online platform. HDFC BANK Mobile Banking Login For providing its customer holistic banking experience. HDFC banks have resorted to mobile banking services with the name of ‘HDFC mobile banking.

Avatar_small
seo service UK 说:
2024年1月16日 17:35

Thanks for the tips guys. They were all great. I have been having issues with being fat both mentally and physically. Thanks to you guys i have been showing improvements. Do post more.

Avatar_small
seo service UK 说:
2024年2月24日 17:58

The writer has outdone himself this time. It is not at all enough; the website is also utmost perfect. I will never forget to visit your site again and again.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter