• 5210阅读
  • 0回复

[提问]Qt4.8.4 GUI库使用 VC2010 64bit正常编译 无法运行 [复制链接]

上一主题 下一主题
离线lejcey
 

只看楼主 正序阅读 楼主  发表于: 2012-12-04
使用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的编译器应该不会有什么问题。
  1. /*!
  2.     Returns a QStyleOptionViewItem structure populated with the view's
  3.     palette, font, state, alignments etc.
  4. */
  5. QStyleOptionViewItem QAbstractItemView::viewOptions() const
  6. {
  7.     Q_D(const QAbstractItemView);
  8.     QStyleOptionViewItem option;
  9.     option.init(this);
  10.     option.state &= ~QStyle::State_MouseOver;
  11.     option.font = font();
  12. #ifndef Q_WS_MAC
  13.     // On mac the focus appearance follows window activation
  14.     // not widget activation
  15.     if (!hasFocus())
  16.         option.state &= ~QStyle::State_Active;
  17. #endif
  18.     option.state &= ~QStyle::State_HasFocus;
  19.     if (d->iconSize.isValid()) {
  20.         option.decorationSize = d->iconSize;
  21.     } else {
  22.         int pm = style()->pixelMetric(QStyle::PM_SmallIconSize, 0, this);
  23.         option.decorationSize = QSize(pm, pm);
  24.     }
  25.     option.decorationPosition = QStyleOptionViewItem::Left;
  26.     option.decorationAlignment = Qt::AlignCenter;
  27.     option.displayAlignment = Qt::AlignLeft|Qt::AlignVCenter;
  28.     option.textElideMode = d->textElideMode;
  29.     option.rect = QRect();
  30.     option.showDecorationSelected = style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, this);
  31.     return option;
  32. }



快速回复
限100 字节
 
上一个 下一个