這是關於使用小部件安排多媒體對象。 下面是我曾嘗試:如何安排QCamera與佈局中的其他小部件?
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
{
m_QPushButton_calibration = new QPushButton("Calibrate", this);
connect(m_QPushButton_calibration, SIGNAL (released()),this, SLOT (handleButton()));
QList<QCameraInfo> l_QListQCameraInfo_available_cameras = QCameraInfo::availableCameras();
if (l_QListQCameraInfo_available_cameras.length() > 2)
{
m_QCamera_required_camera = new QCamera (l_QListQCameraInfo_available_cameras[1]);
}
QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(m_QPushButton_calibration);
layout->addWidget(m_QCamera_required_camera);
this->setLayout(layout);
}
它導致:
error: no matching function for call to 'QHBoxLayout::addWidget(QCamera*&)'
layout->addWidget(m_QCamera_required_camera);
^
如何安排式Qcamera與其他部件的佈局?