Or something like this:
Qt Code:
  1. QFileDialog::getOpenFileName(this, tr("Open TXT File"),
  2. "",
  3. tr("Plain text file (*.txt)"));
To copy to clipboard, switch view to plain text mode