From owner-freebsd-ports Sun Feb 18 11:29:49 2001 Delivered-To: freebsd-ports@freebsd.org Received: from fubar.damon.com (damon.com [199.98.84.2]) by hub.freebsd.org (Postfix) with ESMTP id E78CE37B401 for ; Sun, 18 Feb 2001 11:29:44 -0800 (PST) Received: (from dap@localhost) by fubar.damon.com (8.11.2/8.9.3) id f1IJTxn61969; Sun, 18 Feb 2001 13:29:59 -0600 (CST) (envelope-from dap) Date: Sun, 18 Feb 2001 13:29:58 -0600 From: Damon Permezel To: ports@freebsd.org Subject: qcad 1.4.2 and QT 2.2.4 Message-ID: <20010218132958.M46912@fubar.damon.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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