Nominate our 2022 Qt Champions!

Qt Chat - auto scroll to bottom when you receive and send a new message.

  • Hi. I'm trying to implement a small feature in chat, like its said in the title. I tried a few ways to implement it, but none of them worked. Does anyone know how to do it in this piece of code? Thanks in advance for any help.

    QString result = "<!doctype html><head><meta charset='utf-8'><title></title></head><style>";
      result += "body, html {padding: 5px; background: #fff; font-family: sans-serif;} .me, .you {display: table: margin: auto; margin-top: 15px; margin-bottom: 15px;padding: 10px; width: 88%; border-radius: 7px; box-shadow: 5px 5px 5px 0px rgba(50, 50, 50, 0.75);}";
      result += ".me {background: #2f77fa; color: #fff; border:  solid #fff 1px; border-style: inset}";
      result += ".you {background: #279b23; color: #fff; border:  solid #fff 1px; border-style: inset}</style><body>";
      result += text;
      result += "</body>";

  • Lifetime Qt Champion

  • No. From what i know im supossed to add a javascript line between <HEAD></HEAD> tag. Like i said before i tried a few ways to do it, but maybe someone else may know how to do it.
    EDIT: Alright i figured out how to do it. The topic can be closed.

Log in to reply