Lars Gullik Bjønnes wrote:
[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| [EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:
| | | This patch even makes it run, albeit with a grabled screen. The gui
| | operations (adding objects and such) are done in the wrong order.
| | No changes to xforms, but changes so that qt compiles.
| (patch at bottom)

But also qt3 segfaults upon startup:


The following committed patch should solve this crash. I believe something similar should be done for gtk.

Abdel.

Log:

Fix qt3 crash by delaying QtView member object initialisation as done in the qt4 frontend:

* QtView::init(): new method, overloaded from LyXView::init()

Index: QtView.C
===================================================================
--- QtView.C    (revision 14197)
+++ QtView.C    (working copy)
@@ -59,6 +59,23 @@
 {
        qApp->setMainWidget(this);
 
+#ifndef Q_WS_MACX
+       //  assign an icon to main form. We do not do it under Qt/Mac,
+       //  since the icon is provided in the application bundle.
+       string const iconname = libFileSearch("images", "lyx", "xpm");
+       if (!iconname.empty())
+               setIcon(QPixmap(toqstr(iconname)));
+#endif
+}
+
+
+QtView::~QtView()
+{
+}
+
+
+void QtView::init()
+{
        menubar_.reset(new QLMenubar(this, menubackend));
        getToolbars().init();
 
@@ -67,28 +84,17 @@
        view_state_changed.connect(boost::bind(&QtView::update_view_state, 
this));
        connect(&statusbar_timer_, SIGNAL(timeout()), this, 
SLOT(update_view_state_qt()));
 
-#ifndef Q_WS_MACX
-       //  assign an icon to main form. We do not do it under Qt/Mac,
-       //  since the icon is provided in the application bundle.
-       string const iconname = libFileSearch("images", "lyx", "xpm");
-       if (!iconname.empty())
-               setIcon(QPixmap(toqstr(iconname)));
-#endif
-
        // make sure the buttons are disabled if needed
        updateToolbars();
 
        // allowing the toolbars to tear off is too easily done,
        // and we don't save their orientation anyway. Disable the handle.
        setToolBarsMovable(false);
+       
+       LyXView::init();
 }
 
 
-QtView::~QtView()
-{
-}
-
-
 void QtView::setWindowTitle(string const & t, string const & it)
 {
        setCaption(toqstr(t));
Index: QtView.h
===================================================================
--- QtView.h    (revision 14199)
+++ QtView.h    (working copy)
@@ -40,6 +40,9 @@
 
        ~QtView();
 
+       /// initialise the object members (menubars, toolbars, etc..)
+       void init();
+
        /// show - display the top-level window
        void show();
 

Reply via email to