Hallo,
I have two entries (say, entry1 and entry2) in one menu. What I would like is to execute plotData() when entry1 is selected, and to execute paintEvent(QPaintEvent *e) when entry2 is selecetd. I am using Qt creator (ver 2.7.0) Signal and Slot editor to connect slots to signal. I have done it successfully with entry1 by using triggered() and plotData() (it appears automatically when I right-click slot) for signal and slot respectively. However, I can not do the same with the other function- it does not appear on slot list (I am using triggered() as signal).

Any help would be greatly appreciated.
In traffic.h:
Qt Code:
  1. public slots:
  2. void plotData();
  3. void paintEvent(QPaintEvent *e);
To copy to clipboard, switch view to plain text mode 

In traffic.cpp
Qt Code:
  1. void Traffic::plotData()
  2. {
  3. .......
  4. }
To copy to clipboard, switch view to plain text mode 

Qt Code:
  1. void Traffic::paintEvent(QPaintEvent *e)
  2. {
  3. QWidget::paintEvent(e);
  4. QPainter painter;
  5. QFont font;
  6. painter.begin(this);
  7. Nightcharts PieChart;
  8. PieChart.setType(Nightcharts::Dpie);//{Histogramm,Pie,DPie};
  9. PieChart.setLegendType(Nightcharts::Vertical);//{Round,Vertical}
  10. PieChart.setCords(100,100,this->width()/1.5,this->height()/1.5);
  11. PieChart.addPiece("Item1",QColor(200,10,50),34);
  12. PieChart.addPiece("Item2",Qt::green,27);
  13. PieChart.addPiece("Item3",Qt::cyan,14);
  14. PieChart.addPiece("Item4",Qt::yellow,7);
  15. PieChart.addPiece("Item5",Qt::blue,4);
  16. PieChart.draw(&painter);
  17. PieChart.drawLegend(&painter);
  18. }
To copy to clipboard, switch view to plain text mode