2014-06-24 10 views
1

QCustomPlot 플롯에 로고/QImage를 어떻게 추가 할 수 있습니까?QCustomPlot의 QImage/Logo

나는 Qt와 QCustomPlot에 대해 상당히 새롭다.

어떻게 음모 로고 추가 C++

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

을 사용하고?

+0

당신이 로고는 항상 구석에, 예를 들어 표시 하시겠습니까? 또는 (x, y) 위치에 배치해야합니까? – Nejat

+0

로고를 항상 모서리에 표시하고 싶습니다. – user2256532

답변

0

당신은 로고 이미지에 의해 라벨의 픽스맵을 설정하고 플롯의 레이아웃에 레이블을 추가 :

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);