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

Popular posts from this blog

Change the color of an oval at click in Java AWT -

c# - Unity IoC Lifetime per HttpRequest for UserStore -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -