mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +01:00
add function to sort an elements list by the positions of elements.
this function is use by: cross ref item -> shild are always sorted element selector widget -> list of widget are sorted. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2931 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -35,6 +35,7 @@ ElementSelectorWidget::ElementSelectorWidget(QList <Element *> elmt_list, QWidge
|
||||
selected_element(0),
|
||||
showed_element(0)
|
||||
{
|
||||
qSort(elements_list.begin(), elements_list.end(), comparPos);
|
||||
ui->setupUi(this);
|
||||
buildInterface();
|
||||
}
|
||||
@@ -86,6 +87,7 @@ void ElementSelectorWidget::clear() {
|
||||
void ElementSelectorWidget::setList(QList<Element *> elmt_list) {
|
||||
clear();
|
||||
elements_list << elmt_list;
|
||||
qSort(elements_list.begin(), elements_list.end(), comparPos);
|
||||
buildInterface();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user