qt fan
24th January 2009, 21:07
hello,
i have a simple class that derives from QWidget.
the paint event looks like this:
void ssbgtest::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
well, this paintevent lets me use background-image in the style sheet.
but i need a border-image, because it will then resize the image when you resize the window. background-image tiles the image.
what i need is the code to provide this feature for my simple class. i guess its only about the primitiv element, but which is the right to draw?
greetz qt fan
i have a simple class that derives from QWidget.
the paint event looks like this:
void ssbgtest::paintEvent(QPaintEvent *)
{
QStyleOption opt;
opt.init(this);
QPainter p(this);
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
}
well, this paintevent lets me use background-image in the style sheet.
but i need a border-image, because it will then resize the image when you resize the window. background-image tiles the image.
what i need is the code to provide this feature for my simple class. i guess its only about the primitiv element, but which is the right to draw?
greetz qt fan