35 #include <QStringListModel>
36 #include <QStringList>
37 #include <QTreeWidget>
38 #include <QListWidget>
39 #include <QListWidgetItem>
40 #include <QVBoxLayout>
41 #include <QSortFilterProxyModel>
42 #include <QDialogButtonBox>
43 #include <QMessageBox>
44 #include <QModelIndex>
49 (std::vector< std::string > iVectorEntities,
51 std::string iEntityName
54 this->SetUpUi(iEntityName);
55 this->SetItemsFromTheVector(iVectorEntities);
64 std::string iEntityName
82 std::vector< std::string > iVectorItems)
84 for (
size_t i = 0; i < iVectorItems.size(); ++i )
96 std::list< ItemColorComboboxData > iDataList)
98 std::list< ItemColorComboboxData >::iterator iter = iDataList.begin();
102 while ( iter != iDataList.end() )
104 if ( iter->second.isValid() )
125 if ( !ListEntitiesToDeleteSelected.
empty() )
129 tr(
"Are you sure you want to delete these %1s ?")
132 int r = msgBox.
exec();
147 tr(
"Please select at least one %1.")
159 std::vector< std::string > VectorNamesToDelete;
160 for (
int i = 0; i < iListEntitiesToDelete.
size(); i++ )
162 VectorNamesToDelete.push_back( iListEntitiesToDelete.
at(i)->text().toStdString() );
177 | QDialogButtonBox::Cancel);
void setSelectionMode(QAbstractItemView::SelectionMode mode)
void SetUpUi(std::string iEntityName)
set the layout with all the objects, the connections and the entity name
const T & at(int i) const
std::list< ItemColorComboboxData > ListOfItemColorComboboxData
QString tr(const char *sourceText, const char *disambiguation, int n)
void DeleteSelection(QList< QListWidgetItem * > iListEntitiesToDelete)
emit a signal which sends vector with the names of the entities the user selected to be deleted ...
void drawRect(const QRectF &rectangle)
QListWidget * m_ListWidget
void ListEntitiesToDelete(std::vector< std::string >)
void setPen(const QColor &color)
void setText(const QString &text)
virtual ~QGoDeleteFromListDialog()
void SelectionValidation()
ask the user to select at least one item if nothying has been selected and ask the user confirmation ...
void setBrush(const QBrush &brush)
void addPixmap(const QPixmap &pixmap, Mode mode, State state)
void SetItemsFromTheVector(std::vector< std::string > iVectorItems)
create the corresponding QListWidgetItems
QGoDeleteFromListDialog(std::vector< std::string > iVectorEntities, QWidget *iParent=0, std::string iEntityName="")
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void SetItemsInTheListWithColor(std::list< ItemColorComboboxData > iDataList)
create the corresponding QListWidgetItems with a QColor