如何在Qt中隐藏斯科尔区域
how to hide a scoll area in qt?
我试图隐藏滚动区域,但运行这些命令只是使其更小,更靠近底部。我正在尝试关闭一个滚动区域,其中包含实时网络摄像头提要。我已经尝试了隐藏和关闭命令,但两者都不起作用。
connect(mCameraAction, &QAction::triggered, [&](){
ui->xAxis->hide();
ui->yAxis->hide();
ui->zAxis->hide();
ui->xRotate->hide();
ui->yRotate->hide();
ui->zRotate->hide();
ui->x1Label->hide();
ui->y1Label->hide();
ui->z1Label->hide();
ui->x2Label->hide();
ui->y2Label->hide();
ui->z2Label->hide();
ui->ScrollArea->show();
mCamera->setViewfinder(mCameraViewfinder);
mLayout->addWidget(mCameraViewfinder);
mLayout->setMargin(0);
ui->ScrollArea->setLayout(mLayout);
mCamera->start();
});
connect(mGantryAction,&QAction::triggered, [&](){
mCamera->stop();
ui->ScrollArea->hide();
ui->scrollAreaWidgetContents->hide();
ui->xAxis->setLayout(mLayout);
ui->yAxis->setLayout(mLayout);
ui->zAxis->setLayout(mLayout);
ui->xRotate->setLayout(mLayout);
ui->yRotate->setLayout(mLayout);
ui->zRotate->setLayout(mLayout);
ui->x1Label->setLayout(mLayout);
ui->y1Label->setLayout(mLayout);
ui->z1Label->setLayout(mLayout);
ui->x2Label->setLayout(mLayout);
ui->y2Label->setLayout(mLayout);
ui->z2Label->setLayout(mLayout);
ui->x1Label->show();
ui->y1Label->show();
ui->z1Label->show();
ui->x2Label->show();
ui->y2Label->show();
ui->z2Label->show();
ui->xAxis->show();
ui->yAxis->show();
ui->zAxis->show();
ui->xRotate->show();
ui->yRotate->show();
ui->zRotate->show();
});
QScrollArea 是 QFrame 的后代。如果将框架形状设置为 QFrame::NoFrame尝试:
setFrameShape(QFrame::NoFrame);
相关文章:
- 为什么斯科特·迈耶斯(Scott Meyers)建议更喜欢"迭代器"而不是"const_i
- 自适应路径 - 阿斯塔尔修改
- 康斯坦特还行,但不是康特克斯普尔?
- SIGABRT:使用斯托伊/斯托尔时超出范围
- 如何在Qt中隐藏斯科尔区域
- 接口哈斯克尔和C++
- C++ 克鲁斯卡尔算法的实现
- integral_constant vs 康特斯普尔
- 使用C++程序中的拉斯皮斯蒂尔读取相机图像
- 克鲁斯卡尔的算法解释
- 克鲁斯卡尔算法用矢量转换
- 如果违反了利斯科夫替代原则,我该怎么办?
- 斯科特·迈耶斯谈价值
- C++ 如何实现双倍权重(而不是整数)的克鲁斯卡尔定理
- 利斯科夫替换原则和多重层次结构
- 克鲁斯卡尔算法代码因未知原因而崩溃
- 克鲁斯卡尔的算法实现
- 超载是否违反利斯科夫替换原则
- 为什么在此C++片段中未显示利斯科夫替代原则违规
- 关闭康科尔窗口会导致崩溃