I have an icon that is saved in a format:
//icon.h
extern const unsigned char icon[];
//icon.cpp
const unsigned char icon[]={0x17,0x3f,0x0c,....,0x10,0x06}
Now i want to add this icon to the status bar.
How do i do it?
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First create a widget that loads the icon data, like a QLabel on which you set a QPixmap. What format is that image in? You will have to load it into your pixmap using one of the constructors, or you could try loading it with
loadFromData().Then add that widget to the status bar like so:
Have a look at
statusBar(),addWidget()andaddPermanentWidget().An example of how to create the widget could be:
Specifying the format, as I mentioned above, is elaborated upon here.