[webkit-dev] Webkit-Qt: how to transfer data from LineEdit1 to LineEdit2 ???

Arun Patole webkit.arunp at gmail.com
Thu Mar 19 22:38:44 PDT 2009


It has nothing to do with webkit, it's your pure qt app. refer qt
signals/slots documentation.

btw, here are things that could help you...
    -you could pass data from LineEdit1 is  to LineEdit2 with:
               "LineEdit2->setText(LineEdit1->text());"
    -If you want to do it on PushButton1 click, you will have to define new
slot and connect it to click event.
         to do this, create new class derived from QWidget, have all ui
setup inside it and also define new slot and connect PushButton1 click to
it.
    -you could also look at webkit-qt demo browser source <<source
root>/WebKit/qt/QtLauncher/main.cpp> which comes with webkt source incase
you are trying to build qt-webkit browser.

-Arun
2009/3/20 nguyen hai <deuxliquid at yahoo.com>

> Hi all,
> I am building webkit through Qt port. But I am new to Qt.
> I am designing a basic interface.
> My program has three components: PushButton, LineEdit1, LineEdit2;
> I want to do thing : when I press on "PushButton" , data from LineEdit1 is
> passed to LineEdit2.
>
> Here is my code but I met error while compile:
>
> int main(int argc, char *argv[])
>
> {
>
>  QApplication app(argc, argv);
>
> QWidget *cuaso = new QWidget();
>
>  QPushButton *PushButton1 = new QPushButton;
>
> QLineEdit *LineEdit1 = new QLineEdit;
>
> QLineEdit *LineEdit2 = new QLineEdit;
>
> QString chuoi = "rat chi la ki la";
>
> QVBoxLayout *vitri = new QVBoxLayout;
>
> vitri->addWidget(PushButton1);
>
> vitri->addWidget(LineEdit1);
>
> vitri->addWidget(LineEdit2);
>
> cuaso->setLayout(vitri);
>
>
> QObject::connect(PushButton1,SIGNAL(clicked()),LineEdit2,SLOTsetText(LineEdit1->text()));
>
>   cuaso->show();
>
> return app.exec();
>
> };
>
> The line
> :QObject::connect(PushButton1,SIGNAL(clicked()),LineEdit2,SLOTsetText(LineEdit1->text()));
>
> is not correct.
> Someone can help me to correct ?
> thanks in advance!
>
> Hai
>
> ------------------------------
>  Vui vẻ chat thêm trên nhiều blog và website<http://sg.rd.yahoo.com/vn/messenger/pingbox/mailtagline/*http://vn.messenger.yahoo.com/pingbox/>
> Hãy thử dùng ứng dụng Pingbox online.
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090320/46a9a1f9/attachment.html>


More information about the webkit-dev mailing list