Skip to content
guitorri edited this page Sep 25, 2014 · 4 revisions

The status is that all the Qt3PtlList references were removed. The code is capable of loading schematics. The creation of schematics was not yet migrated. To avoid duplication of work I believe the remaining work has to be done considering the changes QGraphicsFramework will bring.

  • The branch is quite old & the main branch has developed significantly -> Next step would be (imho) to merge master back into this branch, clean out the merge conflicts, try to stabilize remove_Qt3PtrList and merge back into master. If I only had more time ;-)

Some bits of email exchange between Guilherme and Clemens:

  • Basically I replaced Qt3PtrlList wherever I could, the remaing parts were commented out. The commented out sections include are all the mouse interaction, drag, drop, insertion of items into the schematic. All this has to be replaced by QGraphics anyway. I got blocked not knowing which kind of objects have to be put into the QLists that keep track of the stuff on the schematic...

  • To make sure the QLists are sort of working, I tried to fix it so that I could at least open existing schematics. This part is done (mostly). All the schematics I had at the time could be rendered. Well some diagrams (like cartesian, smith) are still broken...

  • In the current status the Qt3PtrlList were all either removed or commented out. The code loads and renders (some) schematics. That is more ore less the status.

  • My intention was to create another branch to implement just the QGraphics and them merge into the remove_Qt3PtrlList. Now I believe it is better if we rebase remove_Qt3PtrlList on master, resolve conflicts and continue working out the QGraphics incrementally from there. This way we have the chance to improve and refactor the GUI, which would be more difficult if we just cherry-pick from remove_Qt3PtrlList.

  • Thanks for the status update regarding the Qt3PtrlList. In my opinion one can distinguish between (i) usage as part of the drawing routines & (ii) else (e.g. Q3PtrList cPointsX; in diagrams/graph.h). I fully agree that we shouldn't touch anything related to (i) as this will be changed when moving to QGraphics anyway.

  • Nevertheless, there may be some cases, where the Qt3PtrlList could be already ported (mostly the (ii) cases) as these wouldn't be touched by the transition to QGraphics. But this would mean cherry-picking commits and / or manual porting of partial commits.

Below you have a commented git log --pretty=oneline from remove_Qt3PtrlList. I (Guilherme) did some bad decisions, but nevertheless, several commits can be cherry-picked and retified rather easily. Read if from bottom (old) to top (new).

Notes:

  • You better use some tool (gitk) to see the commits and the affected files

  • The master branch diverged slightly. Merge is still possible, but the commits from remove_Qt3PtrlList need work. It is recommended to make a controlled cherry-pick and fix issues as commented below

  • Several small commits are easy picks and could indeed merge back to master

  • The suggestion is to have a very good look at the commits and the issues fixed later and then (i) cherry-pick and (2) manually fixup each of the smaller commits

    • Start with Arcs, Lines, Rects, ..., cPointsX
    • leave Props for later it use is spread all around the code, from mouse insertion to stream out to files.
  • Make sure the cherry-pick happens against a new branck of master

  • In some places QListIterator is needed as the logic rely on .next(), .previous() to traverse the container.

  • In other places QMutableListIterator is needed as the QList is modified.

  • The QListIterator was overdone, it could be replaced by a for or foreach which is shorter and easy to read.

  • Styles

   Line *p1;
   QListIterator<Line *> il(Lines);
   while (il.hasNext()) {
     p1 = il.next();
     // use p1
   }
 Element *pe;
 for(int i=0; i<movingElements.size(); i++)  {
    pe = movingElements[i];
    // use pe
  }
  Property *p1;
  QMutableListIterator<Property *> ip(Props);
  while (ip.hasNext()) {
    p1 = ip.next();
    // use p1
    ip.remove();
  }
  • note that foreach takes a copy of the container, cannot modify elements in the loop
    foreach(QString path, qucsPathList) {
         // to something with path
     }

Sorting out the remove_Qt3PtrlList good/bad commits

  • read from bottom to top
(**)
2159482600c871ebe590c3c502b671d9985b782f fix access to empty connection list
0ff02958a4beea48715f27f1657fa2fb1d3837d4 restored undo / redo (broken though)
783d3a93bd2b82f4d088270efa81a02c4c109584 ...
d4abe672c08771cbe35e68763a2a53fdd6d272ea reimplemented commented out findRef()
095afbd98e3e0c0ea8c92b6c6e394a7cc74a0f90 fixed some porting mistakes, still unstable
28a4ddc84322d734ab075dffe64f6b9d2b1fe4da restored some of the original behaviour, still unsta
8cb52ca4f385fb0bc819da3a3179b36d7fef154c undo the commented-out pieces
ffd4b1e6278dbcb5aa8710195b9a4c62d3cd2278 fixed some typos in qucs_actions
ad1fe4650fc0da666a38bf1666f63c1ebb9f95f1 fixed some <= in stead of < in for loops
8951c8ae113bf30dd53165430f51c0041081eceb Merge branch 'master' of ssh://git.code.sf.net/p/quc
65f8a955c84f6947f77e85c85f6c8ae8eceae767 notsolved problem with Rect with multiple curves
9151493d33628ef1ed53670c04d98836f16f4a38 fix eqndefined
6418e5f68196682ec5c9847b0511e29e7d3bfe08 fix tabdiagram
b4efbb86a6b95d9e88c6d81fcb8bba52fd96ae5a fix diagram again
f14d282a6461bd528496581b833f9264c84226a3 fix truthdiagram
b3a36633ed450530568021cefab69f791fe3bc87 fix diagram
9595cbb95fbd04406b9091e6db241d1d1be23637 fix load of Eqn
0f83b31b3a1bf62e9725a3ab8bd83cece5b3532e fix param_sweep
64534492eecd9198c8ba3a43733748e7dd7c2825 fixed subcircuit netlist
53ce8a118a7ac18a7ec135fce894608c461ddff8 fixed simmessage state (Running is constant)
628571018242144edf67ba4968d179c1c0f63f78 fixed loading of wires
0483ef13e9a9f81428c1e03a3894c0aa6bcdf091 fixed loop ranges
d5fc517669f85361747913c479c3afce08ed67c3 fix the load form file
1eb9136001f8ab91231a476b8a1cfdaf5e940783 fix component registration
27b0158d26698621d6d8d3458fc3b2614a2138af use .size() instead of .count() on lists
3d678503c66e99def7e03e4552a92e14f0bda6a0 done removing, go hunt for bugs 
 * USABLE till next ^ (**)
 * Use with care, mostly as reference to find issues that need fix.

**
a9506c01cf6f197b385a0ade7f09f994b7f5ecc6 removed from schematic_file
65807aafe7afc395473861cb6df9e8affe39bb4f removed q3ptrlist from schematic_element
5af79730ab62ede2037801846f529e3cbd1dcd55 removed q3ptrlist from schematic
35bd30bbca2a82e901b1e5229f9dde8623cef3da removed q3ptrlist Parameter from id_text
b754e776b9139208b9a0b3ab920a9709fbadb260 remove q3ptrlist form mouseactions
b22d579fcc317fdd115ff2ae7eb2cad0635888ce removed q3ptrlist from vtabbar
6b90af39a862d45764d2341e5084aa7f0ce1c16e removed q3ptrlist from module
dea0eb7e1dc718d477ddb680537c897d835e2c87 removed q3ptrlist from sweepdialog
 * VERY USABLE till next ^ (**)
 * watch for `QListIterator` -> `forach`
 * see next set of fixes that could apply here
 

 **
8d6bcffbb3fe376c88ade5105b871658a32c6a03 ported graph cPointsX list
0cecad27d3344ee852fd9f6105c629a33d5ef550 ported graph Markers list
0fcec00fa1c5fecdedc92cb20b70bd8ce53ae819 ported Graphs list
  * VERY USABLE till next ^ (**)
  * watch for `QListIterator` -> `forach`

33badd89b4813860fe37a3cb34315dc576627816 ported ElementCache lists, builds and runs
  * USABLE ported `ElementCache` watch for `QListIterator` -> `forach`

2892ca39c2dd2fd34d7777552d95bd9f1eab5dcf got to compile, ported Diagrams
  * USABLE ported `Diagrams, `DocDiags`, watch for `QListIterator` -> `forach`

3923898e3c653d33ffa150827b4a7a348fa55b9c started porting Q3PtrList to QList
  * NOT GOOD REDO split in into manageable commits, leave this for later, pick the above ones
  * converted `Props`, widespread use of `QListIterator`, maybe better if replaced with `foreach`
  * `QMutableListIterator` is needed in some places
  * converted mouse `movingElements`
  * converted `Wires`, `DocWires`
  * `Nodes`, `DocNodes`
  * `Paintings`, `DocPaints`
  * `Components`, `DocComps
  * `SymbolPaints`