FileBoxWidget() : openButton(0) { // our layout QHBoxLayout * lay = new QHBoxLayout(this); lay->setContentsMargins(0, 0, 0, 0); lay->setSpacing(0); // add open button openButton = new PixmapButton(this); openButton->setFixedSize(QSize(64, 60)); openButton->setToolTip(tr("Open")); openButton->setPixmap(QPixmap(":/data/action-open.png")); lay->addWidget(openButton); }
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); } }