|
使用VC2010(16.00.30319.01 for x64)编译QT4.8.4,编译时一切正常,但Release版的QtGui4.dll运行时错误,Debug版正常,谁知道为什么?
使用windbg加载QT自带例子:D:\qt\qt-sdk\demos\books\debug\books.exe
(9f0.790): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** ERROR: Symbol file could not be found. Defaulted to export symbols for D:\qt\qt-sdk\bin\QtGui4.dll - QtGui4!QAbstractItemView::viewOptions+0xff: 00000000`6d8a95ff 0f294310 movaps xmmword ptr [rbx+10h],xmm0 ds:00000000`002c9b38=000000cf000002320000000000000000
左看右看也没发现此函数有什么问题,按理来说vc的编译器应该不会有什么问题。
- /*!
- Returns a QStyleOptionViewItem structure populated with the view's
- palette, font, state, alignments etc.
- */
- QStyleOptionViewItem QAbstractItemView::viewOptions() const
- {
- Q_D(const QAbstractItemView);
- QStyleOptionViewItem option;
- option.init(this);
- option.state &= ~QStyle::State_MouseOver;
- option.font = font();
- #ifndef Q_WS_MAC
- // On mac the focus appearance follows window activation
- // not widget activation
- if (!hasFocus())
- option.state &= ~QStyle::State_Active;
- #endif
- option.state &= ~QStyle::State_HasFocus;
- if (d->iconSize.isValid()) {
- option.decorationSize = d->iconSize;
- } else {
- int pm = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);
- option.decorationSize = QSize(pm, pm);
- }
- option.decorationPosition = QStyleOptionViewItem::Left;
- option.decorationAlignment = Qt::AlignCenter;
- option.displayAlignment = Qt::AlignLeft|Qt::AlignVCenter;
- option.textElideMode = d->textElideMode;
- option.rect = QRect();
- option.showDecorationSelected = style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, this);
- return option;
- }
|