Hi there!
I am trying to set Menu on Widget.
void Widget
::set_menu(QMenuBar * menuBar
) {
qDebug()<<"set menu"<<endl;
menuBar->addMenu(pmnu);
}
void Widget::set_menu(QMenuBar * menuBar)
{
qDebug()<<"set menu"<<endl;
QMenu* pmnu = new QMenu("&Menu");
menuBar->addMenu(pmnu);
}
To copy to clipboard, switch view to plain text mode
and call this function in constructor:
ui(new Ui::Widget)
{
ui->setupUi(this);
set_frame();
set_menu(/*????*/);
}
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
set_frame();
set_menu(/*????*/);
}
To copy to clipboard, switch view to plain text mode
What should I call as an argument in set_menu()?
And am I on the right way?
Bookmarks