You are not logged in.

#1 2004-04-28 13:07:01

glynadgie
Member
From: Birmingham, England
Registered: 2003-12-17
Posts: 7
Website

qt-3.3.2 with patch for Qt Designer

qt-3.3.2 fixes problems with rendering monospaced fonts (hooray!). However, there is still a problem with multiple editor windows in Qt Designer, that is in all qt versions since 3.3.0. The bug means that you cannot raise an editor window by clicking on a filename in the project files list: you have to click on the  editor window to raise it, which is no good if it is hidden by other windows.

I fixed this by comparing the sources for 3.2.3 and 3.3.2. The Designer source files are in tools/designer/designer. The fix is just to add three lines to mainwindowactions.cpp, before the return at the end of the MainWindow::editSource(SourceFile*) method. Only one instruction is actually needed to make the windows raise properly: editor->setFocus(). I copied the other two lines as well in case they have other related effects.

Here is my patch file:

--- tools/designer/designer/mainwindowactions.cpp       2003-12-05 10:24:21.0000
00000 +0000
+++ tools/designer/designer/mainwindowactions.cpp.new   2004-04-28 10:28:24.0000
00000 +0100
@@ -1779,6 +1779,12 @@
        editor = f->editor();
     if ( !editor )
        editor = createSourceEditor( f, currentProject, lang );
+// Glyn Adgie. 28 Apr 04. Raise editor window when name is clicked on in sources list.
+// Copied from qt-3.2.3.
+    editor->show();
+    editor->setFocus();
+    emit editorChanged();
+// End Glyn
     return editor;
 }

The patch is applied in PKBUILD like this:

patch -Np0 -i ../designer.patch

Offline

#2 2004-04-28 15:01:39

glynadgie
Member
From: Birmingham, England
Registered: 2003-12-17
Posts: 7
Website

Re: qt-3.3.2 with patch for Qt Designer

My previous patch only fixes raising editor windows for standard source files. A similar patch is needed in another method to do the same for *.ui.h files.

diff -Naur qt-x11-free-3.3.2-orig/tools/designer/designer/mainwindowactions.cpp qt-x11-free-3.3.2/tools/designer/designer/mainwindowactions.cpp > ../designer.patch

--- qt-x11-free-3.3.2-orig/tools/designer/designer/mainwindowactions.cpp    2003-12-05 10:24:21.000000000 +0000
+++ qt-x11-free-3.3.2/tools/designer/designer/mainwindowactions.cpp    2004-04-28 15:02:31.000000000 +0100
@@ -1761,6 +1761,12 @@
 
     if ( !editor )
     editor = createSourceEditor( formWindow(), formWindow()->project(), lang );
+// Glyn Adgie. 29 Apr 04. Raise editor window when name is clicked on in
+// sources list. This is for *.ui.h files. Copied from qt-3.2.3.
+    editor->show();
+    editor->setFocus();
+    emit editorChanged();
+// End Glyn
     return editor;
 }
 
@@ -1779,6 +1785,12 @@
     editor = f->editor();
     if ( !editor )
     editor = createSourceEditor( f, currentProject, lang );
+// Glyn Adgie. 29 Apr 04. Raise editor window when name is clicked on in sources list.
+// Copied from qt-3.2.3.
+    editor->show();
+    editor->setFocus();
+    emit editorChanged();
+// End Glyn
     return editor;
 }
 

I have also modified the way I generate the patch, to be consistent with the existing freetype2 header patch. Here is the complete PKGBUILD:

# $Id: PKGBUILD,v 1.24 2004/03/02 04:13:28 judd Exp $
# Maintainer: Manolis Tzanidakis <manolis@archlinux.org>
# Contributor: John Proctor <jproctor@prium.net>
pkgname=qt
pkgver=3.3.2
pkgrel=1
pkgdesc="The QT gui toolkit."
url="http://www.trolltech.com/products/qt/index.html"
pkgfqn=${pkgname}-x11-free-${pkgver}
install=qt.install
depends=('xfree86' 'libpng' 'libjpeg')
source=(ftp://ftp.trolltech.com/qt/source/${pkgfqn}.tar.bz2 qt.profile
        qt-3.2.3.patch designer.patch)
md5sums=('4e599bedfcb3fe389bc7ec921c476432' 'd75ab729b02bba8f58ba7b6d46609dd7'
         '7c8ae8926f620065fcd7112c7b2a5e4b')

export QTDIR=${pkgsrcdir}
export PATH=${QTDIR}/bin:${PATH}
export LD_LIBRARY_PATH=${QTDIR}/lib:${LD_LIBRARY_PATH}

build() {
    cd $startdir/src/$pkgfqn
    patch -Np1 -i ../qt-3.2.3.patch
    patch -Np1 -i ../designer.patch

    echo "yes" | ./configure -prefix /opt/qt -system-zlib -qt-gif 
        -system-libpng -system-libjpeg -plugin-imgfmt-mng -thread -no-stl 
        -no-g++-exceptions 

    # fix the broken makefiles
    sed -i 's|[[:space:]]*strip.*doc/html.*$|#|g' src/Makefile

    # optimize the build
    sed -i "s:-O2:${CFLAGS}:g" mkspecs/linux-g++/qmake.conf

    make || return 1
    make INSTALL_ROOT=$startdir/pkg install
    install -D -m755 $startdir/qt.profile $startdir/pkg/etc/profile.d/qt.sh
}

By the way, should I be posting this here, or should I email the maintainer with my suggestions?

Offline

Board footer

Powered by FluxBB