//set background
wallPaperPath.clear();
wallPaperPath.
append(QDir::currentPath());
wallPaperPath.append(WALLPAPER_DIRECTORY);
wallPaperPath.append(KEYPAD_NUMPAD); //this line charge the keypad image but first i use the background image------> wallPaperPath.append(BACKGROUND); in other previus function
//wallPaperPath.append(WALLPAPER);
image.load(wallPaperPath,0);
brush.setStyle(Qt::SolidPattern);
brush.setTextureImage(image);
this->setPalette(palette);
//set background
QString wallPaperPath;
wallPaperPath.clear();
wallPaperPath.append(QDir::currentPath());
wallPaperPath.append(WALLPAPER_DIRECTORY);
wallPaperPath.append(KEYPAD_NUMPAD); //this line charge the keypad image but first i use the background image------> wallPaperPath.append(BACKGROUND); in other previus function
//wallPaperPath.append(WALLPAPER);
QImage image;
image.load(wallPaperPath,0);
QBrush brush;
brush.setStyle(Qt::SolidPattern);
brush.setTextureImage(image);
QPalette palette;
palette.setBrush(QPalette::Active, QPalette::Window, brush);
palette.setBrush(QPalette::Inactive, QPalette::Window, brush);
palette.setBrush(QPalette::Disabled, QPalette::Window, brush);
palette.setBrush(QPalette::Normal, QPalette::Window, brush);
palette.setBrush(QPalette::Current, QPalette::Window, brush);
palette.setBrush(QPalette::Active, QPalette::Background, brush);
palette.setBrush(QPalette::Inactive, QPalette::Background, brush);
palette.setBrush(QPalette::Disabled, QPalette::Background, brush);
palette.setBrush(QPalette::Normal, QPalette::Background, brush);
palette.setBrush(QPalette::Current, QPalette::Background, brush);
palette.setBrush(QPalette::Active, QPalette::Foreground, brush);
palette.setBrush(QPalette::Inactive, QPalette::Foreground, brush);
palette.setBrush(QPalette::Disabled, QPalette::Foreground, brush);
palette.setBrush(QPalette::Normal, QPalette::Foreground, brush);
palette.setBrush(QPalette::Current, QPalette::Foreground, brush);
palette.setBrush(QPalette::Active, QPalette::Base, brush);
palette.setBrush(QPalette::Inactive, QPalette::Base, brush);
palette.setBrush(QPalette::Disabled, QPalette::Base, brush);
palette.setBrush(QPalette::Normal, QPalette::Base, brush);
palette.setBrush(QPalette::Current, QPalette::Base, brush);
palette.setBrush(QPalette::Active, QPalette::AlternateBase, brush);
palette.setBrush(QPalette::Inactive, QPalette::AlternateBase, brush);
palette.setBrush(QPalette::Disabled, QPalette::AlternateBase, brush);
palette.setBrush(QPalette::Normal, QPalette::AlternateBase, brush);
palette.setBrush(QPalette::Current, QPalette::AlternateBase, brush);
palette.setBrush(QPalette::Active, QPalette::Highlight, brush);
palette.setBrush(QPalette::Inactive, QPalette::Highlight, brush);
palette.setBrush(QPalette::Disabled, QPalette::Highlight, brush);
palette.setBrush(QPalette::Normal, QPalette::Highlight, brush);
palette.setBrush(QPalette::Current, QPalette::Highlight, brush);
palette.setBrush(QPalette::Active, QPalette::Light, brush);
palette.setBrush(QPalette::Inactive, QPalette::Light, brush);
palette.setBrush(QPalette::Disabled, QPalette::Light, brush);
palette.setBrush(QPalette::Normal, QPalette::Light, brush);
palette.setBrush(QPalette::Current, QPalette::Light, brush);
this->setPalette(palette);
To copy to clipboard, switch view to plain text mode
Bookmarks