Just try this code if it works -
label->setFixedSize(400,300);
label
->setPixmap
(QPixmap("some_pic.JPG").
scaled(label
->size
()));
tb->setStyleSheet("background-color : transparent ; color:white;");
tb->addAction("Action 1");
tb->addAction("Action 2");
tb->addAction("Action 3");
tb->resize(label->width(),tb->height());
layout->addWidget(label);
QLabel *label = new QLabel();
label->setFixedSize(400,300);
label->setPixmap(QPixmap("some_pic.JPG").scaled(label->size()));
QToolBar *tb = new QToolBar(label);
tb->setStyleSheet("background-color : transparent ; color:white;");
tb->addAction("Action 1");
tb->addAction("Action 2");
tb->addAction("Action 3");
tb->resize(label->width(),tb->height());
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(label);
To copy to clipboard, switch view to plain text mode
Put it in ctor of your custom widget.
You can also replace the stylesheet line with this one -
tb->setStyleSheet("QToolBar { background-color : rgba(200,0,0,100) ; color:white; border-color: transparent;} QToolButton{background-color : transparent;} ");
tb->setStyleSheet("QToolBar { background-color : rgba(200,0,0,100) ; color:white; border-color: transparent;} QToolButton{background-color : transparent;} ");
To copy to clipboard, switch view to plain text mode
Bookmarks