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

nguyen hai deuxliquid at yahoo.com
Thu Mar 19 20:33:04 PDT 2009


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:



p, li { white-space: pre-wrap; }

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



      Địa chỉ email mới sẵn có trên Yahoo!
Chọn ngay một tên truy nhập bạn từng muốn lập với tên miền mới ymail và rocketmail. Nhanh nhanh trước khi có người xí mất!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20090320/2375a9d0/attachment.html>


More information about the webkit-dev mailing list