为什么当我在 QSortFilterProxyModel 中执行 invalidateFilter() 时出现分段错误
在我的 QSortFilterProxyModel 中,我按槽获取一些字符串:
void FilterModel::OnSetName(const QString &name)
{
if(!name.isEmpty())
{
m_nameToContains=name;
invalidateFilter();
}
}
稍后我在重写的方法中使用这些 prop m_nameToContains QString:
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE;
将我的显示角色与这些进行比较。 但有时,在调试时我会收到分段错误错误。 我不在 QSortFilterProxyModel 中使用指针,我的堆栈跟踪是:
我的程序出现在 invalidateFilter() 处。可能是什么原因?我做错了什么?
先进制造:
0x7ffff66de6de 59 pop %rcx
0x7ffff66de6df 5e pop %rsi
0x7ffff66de6e0 4c 89 fa mov %r15,%rdx
0x7ffff66de6e3 4c 89 ee mov %r13,%rsi
0x7ffff66de6e6 4c 89 e7 mov %r12,%rdi
0x7ffff66de6e9 e8 12 90 ff ff callq 0x7ffff66d7700
0x7ffff66de6ee 48 8b b5 78 ff ff ff mov -0x88(%rbp),%rsi
0x7ffff66de6f5 41 b9 01 00 00 00 mov $0x1,%r9d
0x7ffff66de6fb 4d 89 f8 mov %r15,%r8
0x7ffff66de6fe 4c 89 e9 mov %r13,%rcx
0x7ffff66de701 48 89 da mov %rbx,%rdx
0x7ffff66de704 4c 89 e7 mov %r12,%rdi
0x7ffff66de707 e8 64 9b ff ff callq 0x7ffff66d8270
0x7ffff66de70c 48 8d 45 90 lea -0x70(%rbp),%rax
0x7ffff66de710 48 8b 75 80 mov -0x80(%rbp),%rsi
0x7ffff66de714 48 89 c7 mov %rax,%rdi
0x7ffff66de717 48 89 85 60 ff ff ff mov %rax,-0xa0(%rbp)
0x7ffff66de71e e8 2d 6e ff ff callq 0x7ffff66d5550
0x7ffff66de723 4c 89 ef mov %r13,%rdi
0x7ffff66de726 e8 f5 e2 ec ff callq 0x7ffff65aca20
0x7ffff66de72b 48 8b 7d 80 mov -0x80(%rbp),%rdi
0x7ffff66de72f e8 ec e2 ec ff callq 0x7ffff65aca20
0x7ffff66de734 48 8d 43 08 lea 0x8(%rbx),%rax
0x7ffff66de738 4d 8b 74 24 08 mov 0x8(%r12),%r14
0x7ffff66de73d 48 c7 45 88 00 00 00 00 movq $0x0,-0x78(%rbp)
In my QSortFilterProxyModel
i get some string by slot:
void FilterModel::OnSetName(const QString &name)
{
if(!name.isEmpty())
{
m_nameToContains=name;
invalidateFilter();
}
}
Later I use these prop m_nameToContains QString in overrided method:
virtual bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const Q_DECL_OVERRIDE;
to compare my display role with these.
But sometimes, in debug I get an sigmentation fault error.
I do not use pointers in QSortFilterProxyModel, my stack trace is:
My program falls at invalidateFilter(). What's can be the reason? What's i do wrong?
ASM:
0x7ffff66de6de 59 pop %rcx
0x7ffff66de6df 5e pop %rsi
0x7ffff66de6e0 4c 89 fa mov %r15,%rdx
0x7ffff66de6e3 4c 89 ee mov %r13,%rsi
0x7ffff66de6e6 4c 89 e7 mov %r12,%rdi
0x7ffff66de6e9 e8 12 90 ff ff callq 0x7ffff66d7700
0x7ffff66de6ee 48 8b b5 78 ff ff ff mov -0x88(%rbp),%rsi
0x7ffff66de6f5 41 b9 01 00 00 00 mov $0x1,%r9d
0x7ffff66de6fb 4d 89 f8 mov %r15,%r8
0x7ffff66de6fe 4c 89 e9 mov %r13,%rcx
0x7ffff66de701 48 89 da mov %rbx,%rdx
0x7ffff66de704 4c 89 e7 mov %r12,%rdi
0x7ffff66de707 e8 64 9b ff ff callq 0x7ffff66d8270
0x7ffff66de70c 48 8d 45 90 lea -0x70(%rbp),%rax
0x7ffff66de710 48 8b 75 80 mov -0x80(%rbp),%rsi
0x7ffff66de714 48 89 c7 mov %rax,%rdi
0x7ffff66de717 48 89 85 60 ff ff ff mov %rax,-0xa0(%rbp)
0x7ffff66de71e e8 2d 6e ff ff callq 0x7ffff66d5550
0x7ffff66de723 4c 89 ef mov %r13,%rdi
0x7ffff66de726 e8 f5 e2 ec ff callq 0x7ffff65aca20
0x7ffff66de72b 48 8b 7d 80 mov -0x80(%rbp),%rdi
0x7ffff66de72f e8 ec e2 ec ff callq 0x7ffff65aca20
0x7ffff66de734 48 8d 43 08 lea 0x8(%rbx),%rax
0x7ffff66de738 4d 8b 74 24 08 mov 0x8(%r12),%r14
0x7ffff66de73d 48 c7 45 88 00 00 00 00 movq $0x0,-0x78(%rbp)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论