17 setWindowTitle( tr(
"MWL Custom Lambda Selector" ) );
20 QVBoxLayout*
main =
new QVBoxLayout(
this );
21 main->setSpacing ( 2 );
22 main->setContentsMargins( 2, 2, 2, 2 );
23 QVBoxLayout* left =
new QVBoxLayout;
24 QVBoxLayout* right =
new QVBoxLayout;
25 QHBoxLayout* lists =
new QHBoxLayout;
34 QLabel* lb_original =
us_label( tr(
"Original Lambdas" ) );
35 QLabel* lb_selected =
us_label( tr(
"Selected Lambdas" ) );
40 lw_original->setSelectionMode( QAbstractItemView::ExtendedSelection );
41 lw_selected->setSelectionMode( QAbstractItemView::ExtendedSelection );
43 for (
int ii = 0; ii <
nbr_orig; ii++ )
56 QHBoxLayout* buttons =
new QHBoxLayout;
63 connect( pb_reset, SIGNAL( clicked() ), SLOT(
reset() ) );
64 connect( pb_help, SIGNAL( clicked() ), SLOT(
help() ) );
65 connect( pb_cancel, SIGNAL( clicked() ), SLOT(
cancel() ) );
69 buttons->addWidget( pb_reset );
70 buttons->addWidget( pb_help );
71 buttons->addWidget( pb_cancel );
74 left ->addWidget( lb_original );
76 left ->addWidget(
pb_add );
77 right ->addWidget( lb_selected );
80 lists ->addLayout( left );
81 lists ->addLayout( right );
84 main ->addLayout( lists );
85 main ->addLayout( buttons );
92 DbgLv(0) <<
"AddSelections";
93 QList< QListWidgetItem* > selitems =
lw_original->selectedItems();
95 for (
int ii = 0; ii < selitems.count(); ii++ )
97 QListWidgetItem* l_item = selitems.at( ii );
98 int lambda = l_item->text().toInt();
99 lw_original->setCurrentItem( l_item, QItemSelectionModel::Deselect );
101 if ( !
selected.contains( lambda ) )
113 tr(
"1 selected lambda" ) :
114 tr(
"%1 selected lambdas" ).arg( nbr_select ) );
120 DbgLv(0) <<
"RemoveSelections";
121 QList< QListWidgetItem* > selitems =
lw_selected->selectedItems();
123 for (
int ii = 0; ii < selitems.count(); ii++ )
125 int lambda = selitems.at( ii )->text().toInt();
126 int selndx =
selected.indexOf( lambda );
139 tr(
"1 selected lambda" ) :
140 tr(
"%1 selected lambdas" ).arg( nbr_select ) );
149 le_selected->setText( tr(
"0 selected lambdas" ) );