Projet

Général

Profil

Révision b489456c original.cpp

Voir les différences:

original.cpp
62 62
        item->setText(0, list.at(i).fileName());
63 63
        item->setData(1,0,list.at(i).absoluteFilePath());
64 64
    }
65

  
66
    //============== le menu contextuel du treewidget (gauche)
67
    m_menu = new QMenu(ui->treeWidget);
68
    QList<QAction*> actions;
69

  
70
    QAction *a_nouveau = new QAction(QIcon(":/images/folder_add.png"),trUtf8("&Nouvel album"),m_menu);
71
    a_nouveau->setIconVisibleInMenu(true);
72
    a_nouveau->connect(a_nouveau, SIGNAL(triggered()), this, SLOT(on_action_Nouvel_album_triggered()));
73

  
74
    QAction *a_renommer = new QAction(QIcon(":/images/folder_edit.png"),trUtf8("&Renommer..."),m_menu);
75
    a_renommer->setIconVisibleInMenu(true);
76
    //a_renommer->connect(a_renommer, SIGNAL(triggered()), this, SLOT(on_action_Nouvel_album_triggered()));
77

  
78
    QAction *a_supprimer = new QAction(QIcon(":/images/folder_delete.png"),trUtf8("&Supprimer..."),m_menu);
79
    a_supprimer->setIconVisibleInMenu(true);
80
    //a_supprimer->connect(a_supprimer, SIGNAL(triggered()), this, SLOT(on_action_Nouvel_album_triggered()));
81

  
82
    actions << a_nouveau << a_renommer << a_supprimer;
83
    m_menu->addActions(actions);
65 84
}
66 85

  
67 86
original::~original()
......
286 305
    out << data;
287 306
    file.close();
288 307
}
308

  
309

  
310
void original::on_treeWidget_customContextMenuRequested(const QPoint &pos)
311
{
312
    m_menu->exec(ui->treeWidget->mapToGlobal(pos));
313
}

Formats disponibles : Unified diff

Redmine Appliance - Powered by TurnKey Linux