Hi, i have created a context menu. But when i am hovering mouse over its item, the color of item becomes same as color of background and nothing is displayed.
Please help.
Here is my code:
m_TestViewQTreeView->setContextMenuPolicy(Qt::ActionsContextMenu);
menu->setStyleSheet("QMenu{background-color:red}");
connect(run,SIGNAL(triggered()),this,SLOT(Run_Click()));
m_TestViewQTreeView->addAction(run);
m_TestViewQTreeView=new QTreeView();
m_TestViewQTreeView->setContextMenuPolicy(Qt::ActionsContextMenu);
QMenu *menu=new QMenu();
menu->setStyleSheet("QMenu{background-color:red}");
QAction *run=new QAction(QIcon(":/Resources/TCstart.png"),"Run",menu);
connect(run,SIGNAL(triggered()),this,SLOT(Run_Click()));
m_TestViewQTreeView->addAction(run);
To copy to clipboard, switch view to plain text mode
Bookmarks