[Qt-interest] Why I can't see the Menu on my Widget?

Kermit Mei kermit.mei at gmail.com
Tue Jun 9 04:32:59 CEST 2009


Hello, I create a Menu in the constructor of my MainWidget class, The
code is like this:

MainWidget::MainWidget(QWidget *parent)
  : QWidget(parent)
{
  setWindowFlags(Qt::CustomizeWindowHint);
  setGeometry(0,0,320,224);
  setMinimumSize(320,224);
  setMaximumSize(320,224);

  loadActions("mainmenu");
  confBar = new QMenuBar();
  confMenu =
confBar->addMenu(QPixmap(":/newPrefix/images/config.png"),"test");

confBar->setGeometry(0,192,32,32);                                                            

  foreach(QAction *act,confActions)
    confMenu->addAction(act);
}

But when I run it, I can't see the Menu, there's just one empty widget. 
Why?


Thanks




More information about the Qt-interest-old mailing list