pMenu
= new QMenu("Actions");
setupMenu(pMenu);
qDebug("action triggered : %s", a ? qPrintable(a->text()) : "");
//pMenu->deleteLater();
if ( a )
a->trigger();
pMenu = new QMenu("Actions");
setupMenu(pMenu);
QAction *a = pMenu->exec(p);
qDebug("action triggered : %s", a ? qPrintable(a->text()) : "");
//pMenu->deleteLater();
if ( a )
a->trigger();
To copy to clipboard, switch view to plain text mode
connect(a , SIGNAL( triggered() ),
this, SLOT ( deleteLater() ) );
m->addAction(a);
m->addSeparator();
a
= new QAction(QIcon(":/folder.png"), tr
("A&dd folder"), m
);
connect(a , SIGNAL( triggered() ),
this, SLOT ( addFolder() ) );
m->addAction(a);
connect(a , SIGNAL( triggered() ),
this, SLOT ( addFile() ) );
m->addAction(a);
connect(a , SIGNAL( triggered() ),
this, SLOT ( newFile() ) );
m->addAction(a);
m->addSeparator();
connect(a , SIGNAL( triggered() ),
this, SLOT ( clear() ) );
m->addAction(a);
QAction *a;
a = new QAction(QIcon(":/"), tr("&Remove"), m);
connect(a , SIGNAL( triggered() ),
this, SLOT ( deleteLater() ) );
m->addAction(a);
m->addSeparator();
a = new QAction(QIcon(":/folder.png"), tr("A&dd folder"), m);
connect(a , SIGNAL( triggered() ),
this, SLOT ( addFolder() ) );
m->addAction(a);
a = new QAction(QIcon(":/add.png"), tr("Add &file"), m);
connect(a , SIGNAL( triggered() ),
this, SLOT ( addFile() ) );
m->addAction(a);
a = new QAction(QIcon(":/file.png"), tr("&New file"), m);
connect(a , SIGNAL( triggered() ),
this, SLOT ( newFile() ) );
m->addAction(a);
m->addSeparator();
a = new QAction(QIcon(":/clear.png"), tr("&Clear"), m);
connect(a , SIGNAL( triggered() ),
this, SLOT ( clear() ) );
m->addAction(a);
To copy to clipboard, switch view to plain text mode
Bookmarks