c++ - Qt 4: How implement a "Go" button to the QWebView -
i have 3 objects: qwebview, qpushbutton , qlineedit.
my question is: how create connection when click qpushbutton, url address in qlineedit , so, load url page in qwebview.
you need connect worker slot clicked signal follows:
class myclass : public qwidget { q_object public: explicit myclass(qwidget *parent) : qwidget(parent) , mypushbutton("press me", this) , qlineedit(this) , mywebview(this) { connect(mypushbutton, signal(clicked(bool)), slot(handleclicked(bool)); } public slots: void handleclicked(bool) { mywebview->load(mylineedit->text()); } private: qwebview *mywebview; qlineedit *lineedit; qpushbutton *mypushbutton; }
Comments
Post a Comment