Comics Mania
Comics Mania

Reputation: 9

How to add a myOwn-background image to QPlainTextEdit?

For example, if you create a simple plaintextedit, the background is just white. How do I change white background with my own image?

Upvotes: 0

Views: 81

Answers (1)

Morvy
Morvy

Reputation: 48

In design edit, you can set the styleSheet in properties of QWidget. In c++ code you can set the background using QSS, for example, setting ‍‍‍‍background-image: URL("path/image.png");:

myWidget->setStyleSheet("background-image: URL('path/image.png')");

Upvotes: 2

Related Questions