PDA

View Full Version : label on root window



Corinzio
21st January 2009, 22:08
I'm trying to display a QLabel on the root window on X11 with Openbox i've written this code but all i got is a gray background and no label (if i move a window the background under the window goes back to black).




QDesktopWidget* desk = QApplication::desktop();
int primary = desk->primaryScreen();
QWidget* root = desk->screen(primary);
QPixmap ico = QPixmap("ico.png");
QLabel label;
label.setPixmap(ico);
QVBoxLayout *layout = new QVBoxLayout;
layout->addWidget(&label);
root->setLayout(layout);
root->show();
root->repaint();



Is it possible to do with only qt4 or i have to write code in XLib?

Thanks