QTableWidget column宽度的设置
2011-01-20 20:41
148 查看
qcdataTable->verticalHeader()->setHidden(true);
qcdataTable->setColumnWidth(0, 50);
qcdataTable->setColumnWidth(1, 50);
qcdataTable->horizontalHeader()->setResizeMode(0,QHeaderView::Fixed);
qcdataTable->horizontalHeader()->setStretchLastSection(true);
如果改成
qcdataTable->horizontalHeader()->setResizeMode(QHeaderView::Fixed);
qcdataTable->horizontalHeader()->setStretchLastSection(true);
则除最后一列随边框变化外,其余宽度不能改变。
QHeaderView::Interactive 0
The user can resize the section. The section can also be resized programmatically using
resizeSection
()
QHeaderView::Fixed 2
The user cannot resize the section. The section can only be resized programmatically using
resizeSection
()
QHeaderView::Stretch 1
will automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically
QHeaderView::ResizeToContents 3
will automatically resize the section to its optimal size based on the contents of the entire column or row. The size cannot be changed by the user or programmatically
qcdataTable->setColumnWidth(0, 50);
qcdataTable->setColumnWidth(1, 50);
qcdataTable->horizontalHeader()->setResizeMode(0,QHeaderView::Fixed);
qcdataTable->horizontalHeader()->setStretchLastSection(true);
如果改成
qcdataTable->horizontalHeader()->setResizeMode(QHeaderView::Fixed);
qcdataTable->horizontalHeader()->setStretchLastSection(true);
则除最后一列随边框变化外,其余宽度不能改变。
QHeaderView::Interactive 0
The user can resize the section. The section can also be resized programmatically using
resizeSection
()
QHeaderView::Fixed 2
The user cannot resize the section. The section can only be resized programmatically using
resizeSection
()
QHeaderView::Stretch 1
will automatically resize the section to fill the available space. The size cannot be changed by the user or programmatically
QHeaderView::ResizeToContents 3
will automatically resize the section to its optimal size based on the contents of the entire column or row. The size cannot be changed by the user or programmatically
相关文章推荐
- Android GridView——如何以dp单位使用setColumnWidth()设置宽度
- 动态修改 datagrid Column 隐藏显示 设置宽度
- java 导出excel文件设置宽度高度自适应
- highcharts x轴返回图片,设置颜色,宽度
- span标签 设置宽度
- Android 设置获取屏幕宽度(备忘)
- CSS 中如何把 Span 标签设置为固定宽度
- 关于CDockablePane不能设置固定宽度的解决方案
- html中label宽度设置、非替换元素和替换元素
- higncharts column设置最低高度/长度
- 【IOS学习笔记】为UICollectionView设置自适应屏幕宽度以及点击效果
- 设置div的宽度从0加到100,从100减到0,反复执行
- Android中如何在代码中动态设置控件的高度以及宽度
- ApachePOI导出exce,设置单元格风格的属性和设置字体风格的属性的两个工具类,POI宽度和excel 像素转换
- eclipse设置缩进换行的宽度
- 如何设置HTML span、label 的宽度
- reporting service报表设计时候页面宽度高度的设置 -转
- javascript在不同浏览器设置窗口高度、宽度,改变窗口大小
- 设置table的td宽度,不随文字变宽
- BootStrap表单宽度设置方法