The code looks ok, the problem is probably elsewhere in your code.

By the way, you can replace the for loop with:
Qt Code:
  1. for(int i=0; i<80; ++i) {
  2. comboPortFilter->addItem(QString("%1").arg(i+1, 2, 10, '0'), i+1);
  3. }
To copy to clipboard, switch view to plain text mode