c#+ HTML to implement the bubble effect like QQ chat interface

Source: Internet
Author: User

1 /* * Define two person's avatar */ 2     "  " ; 3     QString Strhead = QString ("c:/users/tax10_000/desktop/ql_184555_828078.jpg"  ); 4     Otherhead = QString (""). Arg (Strhead);

Loading HTML files

1 voidchatdemo::slot_btnpicclicked ()2 {3QString FilePath =qfiledialog::getopenfilename ();4 QFile file (FilePath);5     BOOLOK =File.Open (qiodevice::readonly);6     if(!ok) {return; }7QString msg = QString ("")8 . Arg (FilePath);9QString Myhead = QString (""). Arg (FilePath);TenQString MSG = QString (""); One sendmsgshow (msg,myhead); A revmsgshow (msg,otherhead); -  -}1 the 2 - 3 - 4 - 5 + 6 - 7 + 8 A 9 at Ten -  One -  A -  - -  - -  in  -  to The function below is that when there is content in Lineedit, the content in Lineedit is displayed on the interface and the content in the Lineedit is cleared, and if the message is "Hello" or "time", assume that the other person will answer you.  +  - voidchatdemo::slot_lineeditreturnpressed () the { *     if(M_ui.lineedit->text () = =NULL) $     {Panax NotoginsengQmessagebox::warning ( This,"Warning","Can ' t send an empty msg!" ); -         return; the     } +     /** Messages sent by yourself*/ ASendmsgshow (m_ui.lineedit->text (), myhead); the  +     if(M_ui.lineedit->text () = = Qstring::fromlocal8bit ("Hello") ) -     { $Revmsgshow (Qstring::fromlocal8bit ("is there anything I can do to help you ?"), otherhead); $     } -     Else if(M_ui.lineedit->text () = = Qstring::fromlocal8bit ("Time" ) ) -     { theRevmsgshow (Qstring::fromlocal8bit ("Beijing time:%1" ) -. Arg (Qtime::currenttime (). ToString ("Hh:mm:ss") ), otherhead);Wuyi     } the  -M_ui.lineedit->Clear (); Wu}

c#+ HTML to implement the bubble effect like QQ chat interface

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.