mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
cross ref item : show the master comment at the bottom of cross
element : improve the function to sort an element list qet graphics item : add a bool to disable the snap to grid (used for cross ref item, to be exactly at the bottom of element) git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2948 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -525,11 +525,13 @@ bool comparPos(const Element *elmt1, const Element *elmt2) {
|
||||
//Compare folio first
|
||||
if (elmt1->diagram()->folioIndex() != elmt2->diagram()->folioIndex())
|
||||
return elmt1->diagram()->folioIndex() < elmt2->diagram()->folioIndex();
|
||||
//Compare the row in second
|
||||
//Compare the row(in letter pos) in second
|
||||
QString a = elmt1->diagram()->convertPosition(elmt1->scenePos()).letter();
|
||||
QString b = elmt2->diagram()->convertPosition(elmt2->scenePos()).letter();
|
||||
if (a != b)
|
||||
return a<b;
|
||||
//In last compare the line
|
||||
//In last compare the line, if line is egal, return sorted by row in real pos
|
||||
if (elmt1->pos().x() == elmt2->pos().x())
|
||||
return elmt1->y() <= elmt2->pos().y();
|
||||
return elmt1->pos().x() <= elmt2->pos().x();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user