Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Feb 2001 13:29:58 -0600
From:      Damon Permezel <dap@damon.com>
To:        ports@freebsd.org
Subject:   qcad 1.4.2 and QT 2.2.4
Message-ID:  <20010218132958.M46912@fubar.damon.com>

next in thread | raw e-mail | index | archive | help
Sorry if this has been reported before.

Running 4.1-STABLE.

QCAD SEGVs on startup, due to a call to:
  QApplication::setStyle( new QWindowsStyle() );

(Why, I don't know...; there was a "nice???" Motif one setup.)

Anyway, this causes QT2.2.4 to crap out, because when they are
changing styles, they neglect to call the widget routine to
change the w->extra->style from the old (which is deleted) to the
new.

I am new to both QCAD and QT -- I just wanted to install QCAD and see
what it looked like, but my guess is that the problem lies here:

void QApplication::setStyle( QStyle *style )
{
    QStyle* old = app_style;
    app_style = style;

    if ( startingUp() ) {
//// this in itself looks dubious, but is not the problem
	delete old;
	return;
    }


    // clean up the old style
    if (old) {
	if ( is_app_running && !is_app_closing ) {
	    QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) );
	    register QWidget *w;
	    while ( (w=it.current()) ) {		// for all widgets...
		++it;
		if ( !w->testWFlags(WType_Desktop) &&	// except desktop
		     w->testWState(WState_Polished) ) { // has been polished
		    old->unPolish(w);
		}
	    }
	}
	old->unPolish( qApp );
    }

    // take care of possible palette requirements of certain gui
    // styles. Do it before polishing the application since the style
    // might call QApplication::setStyle() itself
    if ( !qt_std_pal )
	qt_create_std_palette();
    QPalette tmpPal = *qt_std_pal;
    app_style->polish( tmpPal );
	setPalette( tmpPal, TRUE );

    // initialize the application with the new style
    app_style->polish( qApp );

    // re-polish existing widgets if necessary
    if (old) {
	if ( is_app_running && !is_app_closing ) {
	    QWidgetIntDictIt it( *((QWidgetIntDict*)QWidget::mapper) );
	    register QWidget *w;
	    while ( (w=it.current()) ) {		// for all widgets...
		++it;
		if ( !w->testWFlags(WType_Desktop) ) {	// except desktop
		    if ( w->testWState(WState_Polished) )
			app_style->polish(w);		// repolish
////////////////
//// they call styleChange(), but this doesn't change the w->extra->style
//// a call is needed to w->setStyle().  In fact, this does the
//// unpolishing and repolishing, but the reason I don't want to just call
//// setStyle here is that there are many widgets with no style set,
//// and this would set it for all of them.  I suspect that certain
//// widgets have no need of style, and calling setStyle() would
//// break this.
////////////////
		    w->styleChange( *old );
		    if ( w->isVisible() ){
			w->update();
		    }
		}
	    }
	}
	delete old;
    }
}


If I comment out the offending call in QCAD, the programme starts up
fine.... no idea yet how long that will last.

However, the problem lies ultimately in QT.

Cheers,
Damon.

-- 
--
Damon Permezel
dap@damon.com



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010218132958.M46912>