hlp:编辑内容不裁剪和对齐左上角,使用绝对坐标;修改编辑框滚动条样式;上下颠倒默认取反

This commit is contained in:
kite_lucs
2026-08-26 16:23:28 +08:00
parent a274b75705
commit 4ea9d2e2c8
6 changed files with 165 additions and 51 deletions
+5 -2
View File
@@ -31,6 +31,7 @@ TestPrintWidget::TestPrintWidget(QWidget* parent)
// m_TextEdit = ui.m_TextEdit;
m_LineEdit = ui.m_LineEdit;
pViewer = ui.graphicsView;
// 初始化按钮组(互斥)
m_ButtonGroup = new QButtonGroup(this);
m_ButtonGroup->setExclusive(true);
@@ -427,6 +428,7 @@ void TestPrintWidget::openWorkFile(QString filePath){
// 将场景中所有项移动,使 pPicScene->itemsBoundingRect() 的左上角对齐到 scene 的 (0,0)
// 计算当前边界并做平移(仅在有偏移时执行)
/*
QRectF bounds = pPicScene->itemsBoundingRect();
if (!bounds.isNull()) {
qreal dx = -bounds.x();
@@ -440,7 +442,8 @@ void TestPrintWidget::openWorkFile(QString filePath){
it->setPos(oldPos + QPointF(dx, dy));
}
}
}
}
*/
pViewer->centerOn(0, 0);
@@ -1129,4 +1132,4 @@ void TestPrintWidget::on_btn_copy_clicked()
void TestPrintWidget::on_btn_paste_clicked()
{
pasteCopiedLayer();
}
}