void CanvasAppliance::slotVerifyVideoInputs(int count) { // delete previous buttons qDeleteAll(m_webcamButtons); m_webcamButtons.clear(); // create new buttons, indexed and connected for (int i = 0; i < count; i++) { PixmapButton * p = new PixmapButton(ui.addContentBox); p->setFixedSize(QSize(50, 50)); p->setPixmap(QPixmap(":/data/insert-webcam.png")); p->setHoverPixmap(QPixmap(":/data/insert-overlay-plus.png")); p->setToolTip(tr("Add Webcam")); p->setProperty("index", i); connect(p, SIGNAL(clicked()), this, SLOT(slotAddWebcam())); ui.addWebcamLayout->addWidget(p); m_webcamButtons.append(p); } }