我正在尝试将图像插入到我的项目中。我写了以下代码:
void MainWindow::on_Layer_Updated(int arg1)
{
if(ui->scrnCheck1->checkState() == Qt::Checked && ui->insCheck1->checkState() == Qt::Checked && ui->scrnCheck2->checkState() == Qt::Checked && ui->sheathCheck1->checkState() == Qt::Checked
&& ui->insCheck3->checkState() == Qt::Checked && ui->concentricCheck2->checkState() == Qt::Checked && ui->insCheck2->checkState() == Qt::Checked && ui->armorCheck->checkState() == Qt::Checked
&& ui->jacketCheck->checkState() == Qt::Checked)
{
QImage image;
image.load(":/CondScrnInsScrnSheathInsCentricInsWiresArmJacket.png");
ui->label_2->setPixmap(QPixmap::fromImage(image));
ui->frame_10->setMinimumHeight(image.size().height() + 20);
ui->groupBox_3->setMinimumHeight(ui->frame_10->size().height() + 20);
}
当我运行程序时,图像会弹出,但图像的大小很大,以至于它与另一个网格重叠。所以我减小了 mainwindow.ui 中的图像视图-> 高度大小。然后只显示一半的图像。如何调整图像使其不会与其他网格重叠?