C++ QCustomPlot中的QImage/Logo

C++ QCustomPlot中的QImage/Logo,c++,qt,qcustomplot,C++,Qt,Qcustomplot,如何在QCustomPlot绘图中添加徽标/QImage 我对Qt和QCustomPlot都相当陌生 我用的是C++ QCustomPlot* plot = new QCustomPlot(parent); logo = new QImage(); bool success = logo->load("Logo-Wallpaper.png"); 如何将徽标添加到绘图?您可以通过徽标图像设置标签的像素贴图,并将标签添加到绘图中的布局: QLabel *myLabel = new QLab

如何在
QCustomPlot
绘图中添加徽标/QImage

我对Qt和
QCustomPlot
都相当陌生

我用的是C++

QCustomPlot* plot = new QCustomPlot(parent);
logo = new QImage();
bool success  = logo->load("Logo-Wallpaper.png");

如何将徽标添加到绘图?

您可以通过徽标图像设置标签的像素贴图,并将标签添加到绘图中的布局:

QLabel *myLabel = new QLabel(this);
myLabel->setPixmap(QPixmap::fromImage(logo));

QGridLayout * layout = new QGridLayout(plot);
layout->setAlignment(Qt::AlignRight | Qt::AlignTop);
layout->addWidget(myLabel ,0,0);

是否希望徽标始终显示在某个角落?或者应该将其放置在(x,y)位置?要始终在角落中显示徽标吗