Page 5 of 11 FirstFirst ... 34567 ... LastLast
Results 81 to 100 of 216

Thread: QCodeEdit

  1. #81
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QCodeEdit

    I think we had a regression in the find feature in the last build. I notice now that if I do

    example/example lib/qcodeedit.cpp

    then ctrl-f to get the find dialog, then search for "this", it finds the first hit but refuses to find any of the others. Both the next icon, and the return key fail to repeat the find.

  2. #82
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: QCodeEdit

    Great! I'll have to start laying with this. Maybe I can now ditch my pricey editor CRiSP. I like it a lot but it has a few features I don't like and it costs money and I can only run it on one of my machines without paying more money. Yes, I'm cheap!

    -joe

    Quote Originally Posted by fullmetalcoder View Post
    Time will tell... In case you care about history this feature had been requested already back in the times of DevQt genesis...


    It DOES... It may not look obvious to the user but I use the exact same internal infrastructure to and rectangular selection, and it's already working... The CTRL+drag gives you a column edit right? Now do CTRL+SHIFT + drag (and move to right/left) and you'll obtain a rectangular selection that can be copied/cut/pasted. The paste mode is inspired from Kate/Kwrite : the MIME data is given a "text/column-selection" data which can be inserted on several lines (even if there is already some text...) and, as a fallback, the subsequent selections separated by linefeeds.



    I knew I forgot something... D'n'D does not work yet with rectangular selection...


    There is already such a GUI : Edyuk trimmed of all its plugins


    I'll try to add that ASAP.

  3. #83
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Re: QCodeEdit

    The QCodeEdit is amazing.
    I would like to use it in my project. I am able to compile it only dynamicly/shared, but I when compiling statically on windows using mingw i get error, because it links -lqtmaind -lqtcored -lqtguid , but in the static-Qt, there are only theese libraries without the "d" at the end of the library names.

    Thanks for help.

  4. #84
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by allstar View Post
    The QCodeEdit is amazing.
    I would like to use it in my project. I am able to compile it only dynamicly/shared, but I when compiling statically on windows using mingw i get error, because it links -lqtmaind -lqtcored -lqtguid , but in the static-Qt, there are only theese libraries without the "d" at the end of the library names.

    Thanks for help.
    Trying running "make release" (or "mingw32-make release") instead of just "make"... If it does not work open the project files and make sure the build mode is set to "release" (CONFIG += release)...

    Quote Originally Posted by Usability
    I think we had a regression in the find feature in the last build. I notice now that if I do

    example/example lib/qcodeedit.cpp

    then ctrl-f to get the find dialog, then search for "this", it finds the first hit but refuses to find any of the others. Both the next icon, and the return key fail to repeat the find.
    Right. It comes from the new behavior of QDocumentCursor::clearSelection() which used to leave the column number unchanged while it now sets it back to anchor column (introduced to make column selection consistent...). The fix is fortunately a one-liner and should be committed by the time you read this
    Current Qt projects : QCodeEdit, RotiDeCode

  5. #85
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    Trying running "make release" (or "mingw32-make release") instead of just "make"... If it does not work open the project files and make sure the build mode is set to "release" (CONFIG += release)...
    Yes, the primary problem was solved, but then I got undefined references to DOM, so I added QT += xml that helped with the xml, but then I got another error:

    Qt Code:
    1. C:\qcodeedit2\example>make release
    2. make -f Makefile.Release
    3. make[1]: Entering directory `C:/qcodeedit2/example'
    4. g++ -static -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-ps
    5. eudo-reloc -Wl,-s -mthreads -Wl -Wl,-subsystem,windows -o "release\example.exe"
    6. .build\main.o -L"d:\build\qt-win-opensource-src-4.3.2\lib" -lmingw32 -lqtmain -
    7. L.. -lqcodeedit -lQtXml -lQtGui -lgdi32 -lcomdlg32 -loleaut32 -limm32 -lwinmm -l
    8. winspool -lmsimg32 -lQtCore -lkernel32 -luser32 -lshell32 -luuid -lole32 -ladvap
    9. i32 -lws2_32
    10. d:\build\qt-win-opensource-src-4.3.2\lib\libQtGui.a(qcompleter.o):qcompleter.cpp
    11. :(.text$_ZN17QCompletionEngineD0Ev[QCompletionEngine::~QCompletionEngine()]+0x0)
    12. : multiple definition of `QCompletionEngine::~QCompletionEngine()'
    13. ..\libqcodeedit.a(qcompletionengine.o):c:/qcodeedit2/lib/language/qcompletioneng
    14. ine.cpp:50: first defined here
    15. d:\build\qt-win-opensource-src-4.3.2\lib\libQtGui.a(qcompleter.o):qcompleter.cpp
    16. :(.text$_ZN17QCompletionEngineD1Ev[QCompletionEngine::~QCompletionEngine()]+0x0)
    17. : multiple definition of `QCompletionEngine::~QCompletionEngine()'
    18. ..\libqcodeedit.a(qcompletionengine.o):c:/qcodeedit2/lib/language/qcompletioneng
    19. ine.cpp:50: first defined here
    20. .build\main.o:main.cpp:(.text+0x51b): undefined reference to `_imp___ZN14QFormat
    21. FactoryC1ERK7QStringP7QObject'
    22. .build\main.o:main.cpp:(.text+0x564): undefined reference to `_imp___ZN9QDocumen
    23. t16setFormatFactoryEP14QFormatFactory'
    24. .build\main.o:main.cpp:(.text+0x58e): undefined reference to `_imp___ZN20QLineMa
    25. rksInfoCenter8instanceEv'
    26. .build\main.o:main.cpp:(.text+0x5a6): undefined reference to `_imp___ZN20QLineMa
    27. rksInfoCenter13loadMarkTypesERK7QString'
    28. .build\main.o:main.cpp:(.text+0x5ef): undefined reference to `_imp___ZN16QLangua
    29. geFactoryC1EP14QFormatFactoryP7QObject'
    30. .build\main.o:main.cpp:(.text+0x638): undefined reference to `_imp___ZN16QLangua
    31. geFactory17addDefinitionPathERK7QString'
    32. .build\main.o:main.cpp:(.text+0x698): undefined reference to `_imp___ZN9QCodeEdi
    33. tC1EP7QWidget'
    34. .build\main.o:main.cpp:(.text+0x6c4): undefined reference to `_imp___ZN14QLineMa
    35. rkPanelC1EP7QWidget'
    36. .build\main.o:main.cpp:(.text+0x6f9): undefined reference to `_imp___ZN9QCodeEdi
    37. t8addPanelEP6QPanelNS_8PositionE'
    38. .build\main.o:main.cpp:(.text+0x71c): undefined reference to `_imp___ZN16QLineNu
    39. mberPanelC1EP7QWidget'
    40. .build\main.o:main.cpp:(.text+0x751): undefined reference to `_imp___ZN9QCodeEdi
    41. t8addPanelEP6QPanelNS_8PositionE'
    42. .build\main.o:main.cpp:(.text+0x774): undefined reference to `_imp___ZN10QFoldPa
    43. nelC1EP7QWidget'
    44. .build\main.o:main.cpp:(.text+0x7a9): undefined reference to `_imp___ZN9QCodeEdi
    45. t8addPanelEP6QPanelNS_8PositionE'
    46. .build\main.o:main.cpp:(.text+0x7cc): undefined reference to `_imp___ZN12QStatus
    47. PanelC1EP7QWidget'
    48. .build\main.o:main.cpp:(.text+0x804): undefined reference to `_imp___ZN9QCodeEdi
    49. t8addPanelEP6QPanelNS_8PositionE'
    50. .build\main.o:main.cpp:(.text+0x827): undefined reference to `_imp___ZN19QSearch
    51. ReplacePanelC1EP7QWidget'
    52. .build\main.o:main.cpp:(.text+0x85f): undefined reference to `_imp___ZN9QCodeEdi
    53. t8addPanelEP6QPanelNS_8PositionE'
    54. .build\main.o:main.cpp:(.text+0x870): undefined reference to `_imp___ZNK9QCodeEd
    55. it6editorEv'
    56. .build\main.o:main.cpp:(.text+0x898): undefined reference to `_imp___ZNK9QCodeEd
    57. it6editorEv'
    58. .build\main.o:main.cpp:(.text+0x8a8): undefined reference to `_imp___ZN7QEditor7
    59. setTextERK7QString'
    60. .build\main.o:main.cpp:(.text+0x8d5): undefined reference to `_imp___ZNK9QCodeEd
    61. it6editorEv'
    62. collect2: ld returned 1 exit status
    63. make[1]: *** [release\example.exe] Error 1
    64. make[1]: Leaving directory `C:/qcodeedit2/example'
    65. make: *** [release] Error 2
    To copy to clipboard, switch view to plain text mode 

    Please help, if you can.

  6. #86
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by allstar View Post
    Please help, if you can.
    All the linking errors (which presumably includes QtXml related ones) come from the fact that you are trying to build QCodeEdit as a static lib... The simplest way to work around this is to add the following line to your project file :

    Qt Code:
    1. DEFINES += _QCODE_EDIT_BUILD_
    To copy to clipboard, switch view to plain text mode 

    Note : the use of this macro was usually intended as a way to allow direct embedding of the sources but AFAIK it should work just as well with static libs...
    Current Qt projects : QCodeEdit, RotiDeCode

  7. #87
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Thanks FullMetalCoder, I confirm find is working again.

  8. #88
    Join Date
    Jun 2007
    Posts
    11
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by fullmetalcoder View Post
    All the linking errors (which presumably includes QtXml related ones) come from the fact that you are trying to build QCodeEdit as a static lib... The simplest way to work around this is to add the following line to your project file :

    Qt Code:
    1. DEFINES += _QCODE_EDIT_BUILD_
    To copy to clipboard, switch view to plain text mode 

    Note : the use of this macro was usually intended as a way to allow direct embedding of the sources but AFAIK it should work just as well with static libs...
    Thanks. Finally I added it dircetly without the lib and its working. But it was needed to comment QCompletionEngine::~QCompletionEngine() - empty destructor in qcompletionengine.cpp -there was a conflict,( see above).

    Otherwise. There is a problem, that you cannot scroll with mousewheel when the cursor is on linenumberbar.
    Last edited by allstar; 10th November 2007 at 11:21.

  9. #89
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Hi,

    I've been playing with this more, with version 1.0. Does this have the features your speaking of?

    What version of Qt should I be compiling against. I am using 4.2.1.

    How does one invoke 'column based' editing? Also, I cannot seem to get the cursor mirroring to work. I tried by clicking the document to place the curser, then point to another place and click while holding the Ctrl key. It just moved the cursor. Selecting worked like it always did.

    This may sound like I'm being picky about this selection. Over the years, I have come to use it at least once a day and quite often more. I'm trapped on my editor until I find a solution. It makes moving rows of variable names or array elements . It save me a lot of typing. both of my fingers really appreciate that

    -joe

    Quote Originally Posted by fullmetalcoder View Post
    I just added column column-based edit which opens way for selection but I'll need advice on this to ensure that they will not alter the overall usability of the editor...

    By the way I did a lot more than column based edit (though it also allows it) : I added something I called "cursor mirrors". These are cursors which mimic the actions of the "real" cursor. You can place them anywhere by holding the Control key while clicking and start typing.

    There are some limitations and probably some polishing left to do but it works quite fine and open new perspectives for tedious and repetitive tasks...

  10. #90
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by croftj View Post
    I've been playing with this more, with version 1.0. Does this have the features your speaking of?
    Version 1.0 is an antquity... You can either fetch sources from SVN (as described above) or get the package I've just released.

    BTW, QCodeEdit 2 has troubles with Qt 4.2 (ui files incompatibilities and some crucial bugs were fixed in Qt 4.3.x) so you'd better upgrading.
    Current Qt projects : QCodeEdit, RotiDeCode

  11. #91
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Thumbs up Re: QCodeEdit

    This is looking much better. The cursor mirroring does pretty much behaves like I expect. It is just cumbersome to use.

    The upside is that it looks like the code is present to make rectangular selections. Can you give me hints where to look if I wanted to see where the markings for a rectangular area get set?

    On another note. As pointed out by another in an earlier post, you really should change your naming scheme. It's hard to tell your class names from Trolltechs. Not to mention, if they ever create a class name you have, it will cause you no end of grief.

    The 'fm' prefix is still available. So your class name would be QfmCodeEdit etc. You can learn more about the Nameing guidlines and registering a prefix here: http://trolltech.com/developer/notes/naming. Look for 'Reserved Name Prefixes'.

    I know it can be a daunting task to rename your classes. I just went through this will my QcjData classes. It only gets harder as more time passes so it's best to do it sooner than later.

    Keep up the good work!

    -joe

    Quote Originally Posted by fullmetalcoder View Post
    Version 1.0 is an antquity... You can either fetch sources from SVN (as described above) or get the package I've just released.

    BTW, QCodeEdit 2 has troubles with Qt 4.2 (ui files incompatibilities and some crucial bugs were fixed in Qt 4.3.x) so you'd better upgrading.

  12. #92
    Join Date
    Jan 2006
    Posts
    371
    Thanks
    14
    Thanked 18 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    another option might be using a separate namespace:

    Qt Code:
    1. using namespace FullMetalCoderInc;
    2. FullMetalCoderInc::QCodeEdit *editor; // another option
    To copy to clipboard, switch view to plain text mode 
    Last edited by elcuco; 11th November 2007 at 21:44. Reason: missing [code] tags

  13. #93
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by croftj View Post
    The upside is that it looks like the code is present to make rectangular selections. Can you give me hints where to look if I wanted to see where the markings for a rectangular area get set?
    what do you mean? there is no real rectangular selection but a smartly managed combination of selections actually which, drawn together make up a nice rectangle...

    As for the naming I guess a namspace would be the best solution for consistency...
    Current Qt projects : QCodeEdit, RotiDeCode

  14. #94
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    I think I just found a couple of bugs.
    When using proportional fonts, the horizontal scroll bar appears to significantly under estimate the width of the text and will not allow scrolling to the end of the lines.
    Also try this. Move the cursor to the start of a line either by clicking it there or using home. Now hold shift and press down cursor. In every other editor, this moves the cursor down to the start of the next line and selects all of the line that it left. In QCodeEdit it does this but also selects all of the line it moved to, leaving 2 lines completely selected.

  15. #95
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Usability View Post
    I think I just found a couple of bugs.
    When using proportional fonts, the horizontal scroll bar appears to significantly under estimate the width of the text and will not allow scrolling to the end of the lines.
    Also try this. Move the cursor to the start of a line either by clicking it there or using home. Now hold shift and press down cursor. In every other editor, this moves the cursor down to the start of the next line and selects all of the line that it left. In QCodeEdit it does this but also selects all of the line it moved to, leaving 2 lines completely selected.
    Good news : I fixed both issues.
    Bad news : my network connection is getting kinda weird (some apps can use it, browser for instance and others fail...) so, as svn hung during the commit I'm not quite sure the content of the repository has been updated properly...
    Current Qt projects : QCodeEdit, RotiDeCode

  16. #96
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    It works now, thanks for that fix

    I just suffered using windows again long enough to check this still compiles on MSVC6. There were just two changes needed.

    qeditor.cpp line 1120, do not return a value, its a void function.
    Similarly 1685.

  17. #97
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Hi Fullmetalcoder, I am having trouble refreshing the content of the editor. I did this

    Qt Code:
    1. QString qsFileName = pEditor->fileName();
    2. pEditor->load(qsFileName);
    To copy to clipboard, switch view to plain text mode 

    and it causes a crash.

    The call stack shows
    • QEditor::load,
    • QEditor::setText,
    • QDocument::setText,
    • qDeleteAll,
    • qDeleteAll,
    • QDocumentLineHandle::~QDocumentLineHandle,
    • QDocumentPrivate::emitLineDeleted,
    • QHash<Key, T>::remove,
    • QHash<Key, T>::detach,
    • QHash<Key, T>::detach_helper


    If I am going about this the right way, hopefully you can bind some event in one of your programs to these two lines and reproduce the crash. If it doesn't just fall out and you need a test case, let me know.

  18. #98
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Some search related questions.

    I think there is a problem with the "In selection" option on find. A concrete example. I invoke the editor like this:
    example/example lib/qcodeedit.cpp
    Then select lines 35 to 39
    key ctrl-f
    enter new as the search string, and it finds the one on line 28. Note that this is with From cursor off.

    What is the second button from the left in the find bar for? I have never know it do anything and it has no tool tip.

    Is there any way I can set the "From cursor" option to be the default when I create an editor? I think this is what most people would expect of a find, and I want to save them the trouble of figuring out why their first find didn't do what they wanted.

  19. #99
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    Quote Originally Posted by Usability View Post
    qeditor.cpp line 1120, do not return a value, its a void function.
    Similarly 1685.
    Quote Originally Posted by Usability View Post
    I am having trouble refreshing the content of the editor. I did this

    Qt Code:
    1. QString qsFileName = pEditor->fileName();
    2. pEditor->load(qsFileName);
    To copy to clipboard, switch view to plain text mode 

    I think there is a problem with the "In selection" option on find. A concrete example. I invoke the editor like this:
    example/example lib/qcodeedit.cpp
    Then select lines 35 to 39
    key ctrl-f
    enter new as the search string, and it finds the one on line 28. Note that this is with From cursor off.

    Is there any way I can set the "From cursor" option to be the default when I create an editor? I think this is what most people would expect of a find, and I want to save them the trouble of figuring out why their first find didn't do what they wanted.
    I'll sort these out ASAP (which basically means next week end...)

    Quote Originally Posted by Usability
    What is the second button from the left in the find bar for? I have never know it do anything and it has no tool tip.
    I'm not sure I understand which one you refer to but I think it's the one supposed to somehow "refresh" the search context.
    Current Qt projects : QCodeEdit, RotiDeCode

  20. #100
    Join Date
    May 2007
    Location
    England
    Posts
    56
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QCodeEdit

    I am having trouble writing the syntax file for a language that uses begin/end as the block start/end delimiters, like { and } in C.

    I started with this:

    Qt Code:
    1. <sequence format="keyword" parenthesis="be_block:open" indent="1" fold="1">begin</sequence>
    2. <sequence format="keyword" parenthesis="be_block:close" indent="1" fold="1">end</sequence>
    To copy to clipboard, switch view to plain text mode 

    And the folding mostly worked well. Unfortunately it spotted the begin in

    int beginning;

    and marked it as the start of a fold-able block.
    So I tried this:

    Qt Code:
    1. <list id="keywords/blocks" format="keyword">
    2. <word parenthesis="be_block:close" indent="1" fold="1">begin</word>
    3. <word parenthesis="be_block:close" indent="1" fold="1">end</word>
    4. </list>
    To copy to clipboard, switch view to plain text mode 

    But that doesn't fold at all. Any suggestions on the solution for this?


    A couple of related but somewhat pedantic questions. There seem to be some gremlins exposed by having begin and end markers on the same line. Try running the example editor, eg

    example/example

    And enter this:

    Qt Code:
    1. if (1) {;} else {
    2.  
    3.  
    4. }
    5. if {
    6.  
    7.  
    8. }
    To copy to clipboard, switch view to plain text mode 

    then collapse the fold starting on the if. For me this produces a corrupt screen showing three if lines. I appreciate that is an ugly example, and I wont be at all surprised if you choose to ignore it.

    This one is a more reasonable code style.

    Qt Code:
    1. if (1) {
    2.  
    3.  
    4. } else {
    5.  
    6.  
    7. }
    To copy to clipboard, switch view to plain text mode 

    Here if you fold up the if statement it folds the complete program. I am not sure this is correct. I was expecting the else branch to remain expanded.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.