Thanks for the quick reply.

So I have been reading everything I can find but I'm still missing something.

I have some working code but I'm still unsure how I can get the user inputted text into a variable so that I can load the file.
this is what I have so far:

Qt Code:
  1. #include <QtGui>
  2. #include <QApplication>
  3. #include <QVBoxLayout>
  4. #include <QLineEdit>
  5. #include <QPushButton>
  6. #include "qobjectdefs.h"
  7.  
  8. class myCanvas : public QWidget{
  9. Q_OBJECT
  10. public:
  11. myCanvas (QWidget * parent = 0);
  12. public Q_SLOTS:
  13. void copyText(const QString & text);// maybe I need to create a slot that copies the text....
  14. };
  15.  
  16. myCanvas::myCanvas(QWidget *parent):QWidget(parent){
  17. QLineEdit * lineedit = new QLineEdit;
  18. QPushButton * pushbutton = new QPushButton("Enter");
  19.  
  20. connect(pushbutton, SIGNAL(clicked()), lineedit, SLOT(copyText()));
  21.  
  22. QVBoxLayout * layout = new QVBoxLayout;
  23. layout->addWidget(lineedit);
  24. layout->addWidget(pushbutton);
  25. setLayout(layout);
  26. }
  27.  
  28. void myCanvas::copyText (const QString & text)
  29. {
  30. ////I don't know....
  31.  
  32. }
  33.  
  34. int main (int argc, char * argv[])
  35. {
  36. QApplication app (argc, argv);
  37. myCanvas bob;
  38. bob.show();
  39. return app.exec();
  40. }
To copy to clipboard, switch view to plain text mode 


Thanks for the help