列宽改变后,激发居中显示
This commit is contained in:
parent
a9b4a42c87
commit
e486388b1b
|
|
@ -119,6 +119,8 @@ MainWindowCurve::MainWindowCurve(QWidget *parent) :
|
|||
ui->tableWidget_2->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
// 连接信号和槽
|
||||
connect(ui->tableWidget_2, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(slotContextMenu(QPoint)));
|
||||
//列宽改变
|
||||
connect(ui->tableWidget_2->horizontalHeader(), &QHeaderView::sectionResized, this, &MainWindowCurve::onSectionResized);
|
||||
|
||||
//隐藏滚动条
|
||||
ui->tableWidget_2->verticalScrollBar()->setDisabled(true); // 禁用滚动
|
||||
|
|
@ -275,7 +277,7 @@ void MainWindowCurve::s_setRangeVScrollBar2(QString strUuid)
|
|||
//2个滚动条位置
|
||||
SetScrollBar_Geometry();
|
||||
|
||||
emit sig_resizeWindow();
|
||||
//emit sig_resizeWindow();
|
||||
}
|
||||
|
||||
//窗口居中处理
|
||||
|
|
@ -6389,3 +6391,17 @@ void MainWindowCurve::slotCreateTail()
|
|||
{
|
||||
m_dock2->show();
|
||||
}
|
||||
|
||||
//列宽改变
|
||||
void MainWindowCurve::onSectionResized(int logicalIndex, int oldSize, int newSize)
|
||||
{
|
||||
if(g_iLoadingJson==1)//针对模板加载,不处理列宽改变,避免多次冲突
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
qDebug() << "onSectionResized";
|
||||
|
||||
//居中
|
||||
emit sig_resizeWindow();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -228,6 +228,9 @@ public slots:
|
|||
//窗口居中处理
|
||||
void resizeWindow();
|
||||
|
||||
//列宽改变
|
||||
void onSectionResized(int logicalIndex, int oldSize, int newSize);
|
||||
|
||||
public:
|
||||
QAction* m_selectWellAc = nullptr; //选择井
|
||||
QAction* m_fixwellsectionHeaderAc = nullptr; //锁头
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user