How do you get a QStringList created in a function out so it can be used by other functions.

I have a function that gets the filenames from a pre-selected directory. I need to use this info in a number of functions. Here is my function:

Qt Code:
  1. void ImagePreview::getFiles(const QString &dir)
  2. {
  3. QString filename = "*.TIF";
  4. QDir directory = QDir(dir);
  5. files = directory.entryList(QStringList(filename),
  6. QDir::Files | QDir::NoSymLinks);
  7.  
  8. loadImage();
  9. }
To copy to clipboard, switch view to plain text mode 

How do I get this out of this function.

Thanks,