简体   繁体   English

启动时Qt Designer和Qt Assistant seg错误

[英]Qt Designer & Qt Assistant seg fault on startup

I apologize if this is in the wrong section - move as necessary... 如果这是错误的部分,我深表歉意-视需要移动...

A bit of background: I have a Qt 4.8.4 application that I've built that runs beautifully...for me. 有一点背景知识:我有一个构建的Qt 4.8.4应用程序,对我来说运行得很好。 I'm connected to a Linux Redhat box using VNC. 我使用VNC连接到Linux Redhat盒。

However, when giving the application to a colleague for use, he is unable to make it run without getting a segmentation fault: basically, he'll try to check one of the checkboxes, and the application will seg fault and using gdb, the backtrace shows: 但是,当将应用程序交给同事使用时,他无法使其运行而不会遇到分段错误:基本上,他将尝试检查其中一个复选框,并且该应用程序将分段错误并使用gdb(回溯)显示:

#0  0x00000000 in ?? ()
#1  0xb7a2b9e8 in QGtkStyle::drawComplexControl () from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4
#2  0xb7b315b5 in QScrollBar::paintEvent () from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4
#3  0xb7682fd4 in QWidget::event () from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4
...

Couple of things to note: 需要注意的几件事:

  1. The other user: he's on the SAME Linux Redhat box as I am, just a different login. 另一个用户:他和我一样在SAME Linux Redhat框中,只是一个不同的登录名。 He has EXACTLY the same PATH , QTDIR , QTLIB , QTBIN , QTINC , & QTMAKESPEC as I do. 他具有与我完全相同的PATHQTDIRQTLIBQTBINQTINCQTMAKESPEC We are both using the bash shell. 我们俩都使用bash shell。
  2. I put a bit of debug in my application to compare the system environment as known by qt, and those are the same (with the execption of user name/login stuff). 我在应用程序中进行了一些调试,以比较qt已知的系统环境,它们是相同的(带有用户名/登录名的执行)。

I've been banging my head on my desk trying to figure this out. 我一直在想办法解决这个问题。

Well, I decided to do something random, & I ran the Qt Designer which is installed...It failed to start. 好吧,我决定随机做些事情,然后我运行了已安装的Qt Designer……无法启动。 Interesting... 有趣...

So I did some investigating and found that the Qt Designer in the menu is for Qt-3.3, which is also installed. 因此,我进行了一些调查,发现菜单中的Qt Designer适用于Qt-3.3,该产品也已安装。 That, or so I've read, should not be an issue. 我读过的那个大概不是问题。

I then tried to launch the Qt Designer that was packaged with Qt 4.8.4 and surprise surprise but it too fails to start. 然后,我尝试启动与Qt 4.8.4打包在一起的Qt Designer,这使它感到惊讶,但它也无法启动。 If I try to start it from a terminal, I get a "Segmentation Fault" output. 如果尝试从终端启动它,则会收到“分段故障”输出。 (Further investigation shows that the Qt Assistant is doing the same thing...) (进一步的调查显示,Qt Assistant正在执行相同的操作...)

Running designer (for qt 4.8.4) through gdb, the backtrace shows: 通过gdb运行Designer(对于qt 4.8.4),回溯显示:

#0  0x00000000 in ?? ()
#1  0xb6f049e8 in QGtkStyle::drawComplexControl() from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4
#2  0xb700a5b5 in QScrollBar::paintEvent() from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4
#3  0xb6b5bfd4 in QWidget::event () from /usr/local/Trolltech/Qt-4.8.4/lib/libQtGui.so.4

THE BACKTRACE FOR THE DESIGNER IS THE SAME AS THE BACKTRACE FOR MY APPLICATION! 设计师的背景与我的应用程序的背景相同!

...and I don't know what that means for my application/other user. ...而且我不知道这对我的应用程序/其他用户意味着什么。

I originally thought of reinstalling Qt, but how would that fix things if it's working fine for me? 我本来是想重新安装Qt,但是如果对我来说工作正常,那将如何解决?

So for anyone who is having a similiar issue, I believe I have found the answer, well at least in this case: 因此,对于遇到类似问题的任何人,我相信至少在这种情况下,我已经找到了答案:

After comparing my home directory and the other user's home directory, I found two folders that peaked my interest: 在比较我的主目录和另一个用户的主目录之后,我发现了两个引起我极大兴趣的文件夹:

.config/
.qt/

As it turns out, the other user was missing the .qt folder! 事实证明,另一个用户缺少 .qt文件夹! AND inside my .config, I had a "Trolltech" folder which he did not have. 在我的.config文件中,我有一个他没有的“ Trolltech”文件夹。 So I copied mine to his and noticed one final thing before trying to run things again... 因此,我将自己的作品复制到他的作品中,并注意到最后一件事,然后尝试再次运行...

Under .config/, there is a file called Trolltech.conf - well guess what: his was drastically different from mine: it wasn't setting everything for Qt 4.8.4 that my Trolltech.conf file was setting. 在.config /下,有一个名为Trolltech.conf的文件-猜猜是什么:他和我的完全不同:我的Trolltech.conf文件没有设置Qt 4.8.4的所有内容。 So I copied that too. 所以我也照做了。

And lo-and-behold - Qt Designer (for 3.3 and 4.8.4), Qt Assistant, AND my application all work beautifully now. 值得一看的是-Qt Designer(适用于3.3和4.8.4),Qt Assistant和我的应用程序现在都可以正常工作。 :D :D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM