Skip to content
Snippets Groups Projects
Commit ea5516c6 authored by Guillaume Pasero's avatar Guillaume Pasero
Browse files

ENH: slot for drop in ListEditWidget

parent 49e8a187
No related branches found
No related tags found
No related merge requests found
......@@ -126,7 +126,7 @@ public:
//
// Public SLOTS.
public slots:
void OnFilenameDropped(const QString &);
/*-[ SIGNALS SECTION ]-----------------------------------------------------*/
//
......
......@@ -76,6 +76,8 @@ ListEditWidget
{
m_UI->setupUi( this );
setAcceptDrops(true);
assert( m_UI->treeView->selectionModel()==nullptr );
//
......@@ -303,6 +305,29 @@ ListEditWidget
/*******************************************************************************/
/* SLOTS */
/*******************************************************************************/
void
ListEditWidget
::OnFilenameDropped(const QString & filename)
{
ListEditItemModel * itemModel = GetItemModel();
assert( itemModel!=nullptr );
if( filename.isEmpty() )
return;
int row = itemModel->rowCount();
assert( row>=0 );
if( !itemModel->insertRow( row ) )
return;
itemModel->setData(
itemModel->index( row, ListEditItemModel::COLUMN_NAME ),
filename
);
}
void
ListEditWidget
::on_addButton_clicked()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment