Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit 8e2fd472 authored by Frédéric Larue's avatar Frédéric Larue
Browse files

Item renaming by pressing F2 in the TreeView enabled.

parent ec7b4f33
......@@ -336,14 +336,32 @@ void UIDataWidget::keyPressEvent( QKeyEvent *evt )
switch( evt->key() )
{
case Qt::Key_Delete:
case Qt::Key_Backspace: emit removalAsked(); break;
{
emit removalAsked();
return;
}
case Qt::Key_A:
{
if( evt->modifiers() == Qt::ControlModifier )
{
selectAll();
break;
return;
}
break;
}
case Qt::Key_F2:
{
QList<QTreeWidgetItem*> selected = selectedItems();
if( selected.size() == 1 )
{
editItem( selected.front(), 0 );
return;
}
break;
}
}
QTreeWidget::keyPressEvent( evt );
}
......
......@@ -21,6 +21,7 @@ class GUIMAIN_API UIDataWidgetItem : public QTreeWidgetItem
public:
inline UIDataWidgetItem( GenericUIData *uiData ) : QTreeWidgetItem()
{
setFlags( flags() | Qt::ItemIsEditable );
setText( 0, uiData->GetFileName() );
setText( 1, uiData->GetTypeString() );
setData( 0, Qt::UserRole, QVariant::fromValue<void*>(uiData) );
......
......@@ -198,7 +198,7 @@ void UIMainWindow::init()
ui->actionToggleShading->setChecked( true );
connect( ui->tableCurrentProjContent, SIGNAL(contentDropped(QDropEvent*)), this, SLOT(tableItemsContentDropped(QDropEvent*)) );
//connect( ui->tableCurrentProjContent, SIGNAL(visibilityChanged(QList<QTreeWidgetItem*>)), this, SLOT(modifyItem(QTreeWidgetItem*)) );
connect( ui->tableCurrentProjContent, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(modifyItem(QTreeWidgetItem*,int)) );
connect( ui->tableCurrentProjContent, SIGNAL(visibilityChanged(QList<QTreeWidgetItem*>)), this, SLOT(modifyVisibility(QList<QTreeWidgetItem*>)) );
connect( ui->tableCurrentProjContent, SIGNAL(removalAsked()), this, SLOT(removeFromCurrentProject()) );
connect( ui->tableCurrentProjContent, SIGNAL(itemDoubleClicked(GenericUIData*)), this, SLOT(onItemDoubleClicked(GenericUIData*)) );
......@@ -580,7 +580,7 @@ bool UIMainWindow::closeAllProjects()
}
void UIMainWindow::modifyItem( QTreeWidgetItem* entryInTable )
void UIMainWindow::modifyItem( QTreeWidgetItem* entryInTable, int column )
{
GenericUIData *item = ((UIDataWidgetItem*) entryInTable)->getUIData();
......
......@@ -148,7 +148,7 @@ public slots:
void updateTypeFilters();
bool closeCurrentProject();
bool closeAllProjects();
void modifyItem( QTreeWidgetItem *entryInTable );
void modifyItem( QTreeWidgetItem *entryInTable, int column );
void modifyVisibility( const QList<QTreeWidgetItem*>& entriesInTable );
void showAboutDialog();
void displayPluginsList();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment