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:
#include <QtGui>
#include <QApplication>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include "qobjectdefs.h"
Q_OBJECT
public:
public Q_SLOTS:
void copyText
(const QString & text
);
// maybe I need to create a slot that copies the text.... };
connect(pushbutton, SIGNAL(clicked()), lineedit, SLOT(copyText()));
layout->addWidget(lineedit);
layout->addWidget(pushbutton);
setLayout(layout);
}
void myCanvas
::copyText (const QString & text
) {
////I don't know....
}
int main (int argc, char * argv[])
{
myCanvas bob;
bob.show();
return app.exec();
}
#include <QtGui>
#include <QApplication>
#include <QVBoxLayout>
#include <QLineEdit>
#include <QPushButton>
#include "qobjectdefs.h"
class myCanvas : public QWidget{
Q_OBJECT
public:
myCanvas (QWidget * parent = 0);
public Q_SLOTS:
void copyText(const QString & text);// maybe I need to create a slot that copies the text....
};
myCanvas::myCanvas(QWidget *parent):QWidget(parent){
QLineEdit * lineedit = new QLineEdit;
QPushButton * pushbutton = new QPushButton("Enter");
connect(pushbutton, SIGNAL(clicked()), lineedit, SLOT(copyText()));
QVBoxLayout * layout = new QVBoxLayout;
layout->addWidget(lineedit);
layout->addWidget(pushbutton);
setLayout(layout);
}
void myCanvas::copyText (const QString & text)
{
////I don't know....
}
int main (int argc, char * argv[])
{
QApplication app (argc, argv);
myCanvas bob;
bob.show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Thanks for the help
Bookmarks