Commited QtDesigner stuff

Reginald Stadlbauer reggie at trolltech.com
Tue Aug 15 15:45:43 UTC 2000


On Tue, 15 Aug 2000, you wrote:
> Hi,
>
> I just commited a few improvements related to Qt Designer:
>
> _ In CKDevelop::switchToFile(QString filename, bool bForceReload,bool
> bShowModifiedBox) I use KProcess to launch Qt Designer on .ui files.
>
> _ In CKDevInstall::slotAuto() I added Qt Designer as a tool, but it can
> appear only if the tools are reinstalled. By the way, do you know an
> easy way to reinstall only the tools ?
>
> _ In CKAppWizard::slotProcessExited() I added a new filter group for
> User Interface .ui files. This group is shown in the LFV and Qt Designer
> is launched when a ui file is clicked in the LFV.

Ok, I looked it it now. Would be cool if there would be a nice way to add .ui 
files (offer it in this template dialog). Also I noticed that every time you 
click on a ui file it is opened again in the designer. That is for sure not 
what one wants, and it is a bug of the Qt Designer. I fixed that now, here is 
a patch against qt/tools/designer/designer/main.cpp for those interested:

==== //depot/qt/2.2/tools/designer/designer/main.cpp#10 - 
/home/reggie/troll/qt/tools/designer/designer/main.cpp ====
@@ -23,6 +23,7 @@
 #include <qlabel.h>
 #include <qfile.h>
 #include <qtextstream.h>
+#include <qobjectlist.h>
 
 #include <stdlib.h>
 #include <signal.h>
@@ -48,8 +49,21 @@
     QStringList lst = QStringList::split( " ", args );
     for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) {
 	QString arg = (*it).stripWhiteSpace();
-	if ( arg[0] != '-' )
-	    MainWindow::self->openFile( arg );
+	if ( arg[0] != '-' ) {
+	    QObjectList* l = MainWindow::self->queryList( "FormWindow" );
+	    FormWindow* fw = (FormWindow*) l->first();
+	    FormWindow* totop;
+	    bool haveit = FALSE;
+	    while ( fw ) {
+		haveit = haveit || fw->fileName() == arg;
+		if ( haveit )
+		    totop = fw;
+		
+		fw = (FormWindow*) l->next();
+	    }
+	    if ( !haveit )
+		MainWindow::self->openFile( arg );
+	}
     }
     MainWindow::self->raise();
     MainWindow::self->setActiveWindow();
@@ -65,7 +79,6 @@
 #if defined(_OS_WIN32_)
 #include <qt_windows.h>
 #include <process.h>
-#include <qobjectlist.h>
 
 class QDesignerApplication : public QApplication
 {


BTW: Tonight we will release a Qt 2.2.0beta2. This will unfortunately not 
include this patch as the packages are already done and freezed.

-- 
Reggie (reggie at trolltech.com)




More information about the KDevelop-devel mailing list