crooked
crooked

Reputation: 715

QDialog - setting background image

How can I simply set background of my QDialog? I can easily set colour of background, but when i try use image, my background just goes black. I was trying to use: QPallete with QBrush, StyleSheets :(.

Upvotes: 0

Views: 3716

Answers (1)

Vladimir Bershov
Vladimir Bershov

Reputation: 2832

You can simply

MyDialog::MyDialog(QWidget *parent)
    : QDialog(parent)
{
    ui.setupUi(this);

    setStyleSheet( "background-image:url(image.jpg);" ); //this works
}

See also: Unable to set the background image in Qt Stylesheet

Upvotes: 1

Related Questions