Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
None
-
4.8.0
-
Mac OS X Lion, Qt 4.8.0
Description
I try to put a shadow effect on my widget, but app crashes with EXC_BAD_ACCESS in QGraphicsDropShadowEffect::draw(). Just right before that, console says this:
"QPainter::begin: Widget painting can only begin as a result of a paintEvent
QPainter::translate: Painter not active"
How to represent:
Create project with widget, put a QLabel on it, then do this in c-tor:
QGraphicsDropShadowEffect * shadow = new QGraphicsDropShadowEffect(this);
shadow->setColor(Qt::red);
shadow->setOffset(1, 1);
setGraphicsEffect(shadow);
App crashes on launch. Here is its backtrace:
0 QGraphicsDropShadowEffect::draw
1 QWidgetPrivate::drawWidget
2 -[QCocoaView drawRect:]
3 -[NSView _drawRect:clip:]
4 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
5 -[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:]
6 -[NSView _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
7 -[NSThemeFrame _recursiveDisplayRectIfNeededIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:topView:]
8 -[NSView _displayRectIgnoringOpacity:isVisibleRect:rectIsVisibleRectForView:]
9 -[NSView displayIfNeeded]
10 -[NSWindow _reallyDoOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
11 -[NSWindow _doOrderWindow:relativeTo:findKey:forCounter:force:isModal:]
12 -[NSWindow orderWindow:relativeTo:]
13 -[NSWindow makeKeyAndOrderFront:]
14 QWidgetPrivate::show_sys
15 QWidgetPrivate::show_helper
16 QWidget::setVisible
17 QWidget::show qwidget.h
18 main main.cpp