In the customMenuRequested slot of right click, I can add item to the end of the standard Context Menu of the qtextedit. But this "I'm new!" item is at the bottom of the context menu after all standard stuff. How can I put it on top above all items in standard Context Menu? Thanks.
void MainWindow::customMenuRequested( QPoint pos)
{
QMenu stdMenu=QMenu(ui->textedit->createStandardContextMenu());
QMenu *newMenu = stdMenu->addMenu("I'm new!");
menu->popup(ui->textedit->viewport()->mapToGlobal(pos));
}