PDA

View Full Version : qPEditor - the editor for the programmer.



mik-protasov
23rd April 2008, 15:02
qPEditor - the editor for the programmer.

He is the powerful editor with the open code under license GPL.

Features:
Cross - platform;
It is written completely on Qt. Minimal requirements Qt 4.2.x;
Adjustment of styles of allocation for various programming languages;
Folding the text;
Support undo/redo.
Use in Qt Designer as a plugin.

www.AnyQSoft.com

mik-protasov
13th May 2008, 09:38
Version qPEditor is updated to 1.0.1.
This is a bug-fix release.

http://www.anyqsoft.com/qPEditor?Lang=Eng (http://www.anyqsoft.com)

elcuco
13th May 2008, 17:04
Did not compile for me on Linux.

Man, it's hard for someone to release an open source application... because then n00bs on the internet start telling how messy your code is... and bla bla bla...

wait, at least let me explain:

1) your code is a mess of upper case and lower case classnames or file names. please be consistant

2) the compilation is VERY messy, lots of warnings (please put a new line in the end of each file for example).

3) the compilation creates a library directly in $(QTDIR)/lib which is bad!!!! in most situations you will not be able to write that file, since its in /usr/lib. you were lucky and i tested in my local 4.4 build - so the make utility was able to create the file.

THAT IS VERY RUDE! installing libs is part of the "install" rule, not the "make". please don't so such things in the future, now my $QTDIR is infected with some library which I probably not use, what else is installed?

4) the libs directive did not work for me, I have to completely modify it. not using a strict path (and library name!) was helpful to me.

5) a lot of runtime warnings, please fix then (hint, QPainter::end() is a good idea).

6) The syntax definition file ... why do you put the language definition and (for while) and the display definition (blue with font size 12) on the same file? i find this very limiting.

7) the code contains 2 style.def for "qt/qs cpp"... bad... bad...

I still need to see how this scales up (did you try loading a 12kb-25kb file?).

Hey, it looks better then other software I looked ! :)

I am attaching here a diff, for you to fix and for Linux/Unix developers to apply if they want to use it.

mik-protasov
13th May 2008, 20:15
elcuco

Thanks. I shall necessarily look your offers and I shall make editing. With the register and the ends of lines it completely agree.

mik-protasov
15th May 2008, 12:49
Updated qPEditor up to version 1.0.2.
Tested for Linux.

elcuco
16th May 2008, 18:48
Works perfectly now, THANKS!
(horrible colors, but na...)

2 things:
it's possible to run the example without installing, here:


[elcuco@localhost qPEditor]$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/elcuco/src/2/qPEditor/qPEditorLib/
[elcuco@localhost qPEditor]$ ./examples/DesignerExample/DesignerExample


and, please, next time export the source before you package, you will save ~50% of the size of the download :)


[elcuco@localhost qPEditor]$ svn info
Path: .
URL: file:///C:/Portable/Repository/qPEditor/trunk
Repository Root: file:///C:/Portable/Repository/qPEditor
Repository UUID: 92c12e8a-2a66-6e4e-8df9-10d1464c7f38
Revision: 92
Node Kind: directory
Schedule: normal
Last Changed Author: Mike
Last Changed Rev: 92
Last Changed Date: 2008-05-15 13:22:00 +0300 (Thu, 15 May 2008)

mik-protasov
17th May 2008, 08:46
All can be adjusted colors.
1. In the Designer or in a code: color of a background, color of a current line, color of panels аnd others colors - look properties qPEditor.
2. Color allocation of a code in the editor is adjusted in dialogue of styles. In an example on Style in ToolBar.

It agree. So it is possible to start an example.

Next time it is indispensable export the source before you package

elcuco
21st May 2008, 15:06
I see the way to modify the colors in a single touch. What I did in my text editor widget is to define a language definition and colors definitions in different XML files. This way the colors and syntax are easy to change.

If you want to check my code, or at least the ideas I used, feel free to do it:
http://code.google.com/p/qtedit4/wiki/QsvEditorBeta

mik-protasov
8th July 2008, 18:43
Version qPEditor is updated to 1.1.0
The added panel bookmark and marketed separation fresh bracket.

elcuco
8th July 2008, 22:00
Version 1.1.0 does not compile here (Mandriva 2008.1, Qt4.4.0)



g++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DEDITORPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -DQT_SHARED -I../../../../qt-44/mkspecs/linux-g++ -I. -I../../../../qt-44/include/QtDesigner -I../../../../qt-44/include/QtCore -I../../../../qt-44/include/QtCore -I../../../../qt-44/include/QtGui -I../../../../qt-44/include/QtGui -I../../../../qt-44/include/QtXml -I../../../../qt-44/include/QtXml -I../../../../qt-44/include/QtScript -I../../../../qt-44/include/QtScript -I../../../../qt-44/include -I../src -I../src/StyleDialog -Irelease -Irelease -o release/textedit.o ../src/textedit.cpp
In file included from ../src/textedit.h:28,
from ../src/textedit.cpp:22:
../src/userblockdata.h: In constructor ‘QBlockData::QBlockData()’:
../src/userblockdata.h:58: warning: ‘QBlockData::collapsedBlock’ will be initialized after
../src/userblockdata.h:55: warning: ‘bool QBlockData::marked’
../src/userblockdata.h:43: warning: when initialized here
../src/textedit.cpp: In member function ‘virtual void TextEdit::paintEvent(QPaintEvent*)’:
../src/textedit.cpp:83: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:87: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:91: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:95: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:99: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:103: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp: At global scope:
../src/textedit.cpp:109: warning: unused parameter ‘end’
make[1]: *** [release/textedit.o] Error 1
make[1]: Leaving directory `/home/elcuco/src/qeditor/qPEditor/qPEditorPlugin'
make: *** [sub-qPEditorPlugin-make_default] Error 2
[elcuco@localhost qPEditor]$


Edit:

You are passing a QChar() to a function which needs a reference. The workaround is simple:


if ( CurrentLineVisible && CurrentLineColor.isValid() )
{
QChar c1 = '{';
QChar c2 = '}';
...
switch ( cc )
{
case '{':
if ( !exists( pos )) break;
paintBracketForward( cur, pos , c1=QChar( '{' ), c2=QChar( '}' ) );
break;


Note what that I just added, c1=QChar() statements in all the cases. Now it compiles and works.

mik-protasov
22nd July 2008, 10:21
Version 1.1.0 does not compile here (Mandriva 2008.1, Qt4.4.0)



g++ -c -pipe -g -D_REENTRANT -Wall -W -fPIC -DEDITORPLUGIN -DQT_PLUGIN -DQT_SCRIPT_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQDESIGNER_EXPORT_WIDGETS -DQT_SHARED -I../../../../qt-44/mkspecs/linux-g++ -I. -I../../../../qt-44/include/QtDesigner -I../../../../qt-44/include/QtCore -I../../../../qt-44/include/QtCore -I../../../../qt-44/include/QtGui -I../../../../qt-44/include/QtGui -I../../../../qt-44/include/QtXml -I../../../../qt-44/include/QtXml -I../../../../qt-44/include/QtScript -I../../../../qt-44/include/QtScript -I../../../../qt-44/include -I../src -I../src/StyleDialog -Irelease -Irelease -o release/textedit.o ../src/textedit.cpp
In file included from ../src/textedit.h:28,
from ../src/textedit.cpp:22:
../src/userblockdata.h: In constructor ‘QBlockData::QBlockData()’:
../src/userblockdata.h:58: warning: ‘QBlockData::collapsedBlock’ will be initialized after
../src/userblockdata.h:55: warning: ‘bool QBlockData::marked’
../src/userblockdata.h:43: warning: when initialized here
../src/textedit.cpp: In member function ‘virtual void TextEdit::paintEvent(QPaintEvent*)’:
../src/textedit.cpp:83: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:87: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:91: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:95: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:99: error: no matching function for call to ‘TextEdit::paintBracketForward(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:75: note: candidates are: void TextEdit::paintBracketForward(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp:103: error: no matching function for call to ‘TextEdit::paintBracketBack(QTextCursor&, int&, QChar, QChar)’
../src/textedit.h:76: note: candidates are: void TextEdit::paintBracketBack(QTextCursor&, int, QChar&, QChar&)
../src/textedit.cpp: At global scope:
../src/textedit.cpp:109: warning: unused parameter ‘end’
make[1]: *** [release/textedit.o] Error 1
make[1]: Leaving directory `/home/elcuco/src/qeditor/qPEditor/qPEditorPlugin'
make: *** [sub-qPEditorPlugin-make_default] Error 2
[elcuco@localhost qPEditor]$


Edit:

You are passing a QChar() to a function which needs a reference. The workaround is simple:


if ( CurrentLineVisible && CurrentLineColor.isValid() )
{
QChar c1 = '{';
QChar c2 = '}';
...
switch ( cc )
{
case '{':
if ( !exists( pos )) break;
paintBracketForward( cur, pos , c1=QChar( '{' ), c2=QChar( '}' ) );
break;


Note what that I just added, c1=QChar() statements in all the cases. Now it compiles and works.

Version qPEditor is updated to 1.1.1
Removal mistake.

elcuco

We ask to check the amendable version and report the result.