Results 1 to 7 of 7

Thread: QTextEdit chat app

  1. #1
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default QTextEdit chat app

    Hello fellow Qt programmers. After a lot of research I have concluded that I'd like to create a chat application using QTextEdit.

    What's needed:
    * Being able to send "messages" and format it like the following: http://i.imgur.com/VEdVagR.png (This one was done using QTreeView, only problem was that you can't select and copy more than 1 message).
    * Being able to insert clickable objects, such as images etc.
    * Paint the background text and adjust its alignment based on receive/sent message
    * Being able to copy text without copying the picture Frame that's on the left.

    Is there anyone out there that is willing to point me in the right direction of how I can achieve this result?

    I have read everything found here: http://doc.qt.io/qt-4.8/richtext.html
    Tips such as what to read and possible examples would be greatly appreciated!

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit chat app

    This looks and sounds like it would be easier with QtQuick instead of QtWidgets.

    Cheers,
    _

  3. #3
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit chat app

    Quote Originally Posted by anda_skoa View Post
    This looks and sounds like it would be easier with QtQuick instead of QtWidgets.

    Cheers,
    _
    Thanks a lot for answering. Yes, it may be easier using QtQuick, but I'll use that as the last resort.
    I'm thinking that I could create a custom QTextFrame and put an image on the left side (and make it nonselectable with copying etc) and the text on the right, but I'm not
    quite sure of how to do this. Like stated above, any tips would be highly valued!

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit chat app

    Ok, doing it the hard and complicated way is of course your choice

    Cheers,
    _

  5. #5
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit chat app

    Quote Originally Posted by anda_skoa View Post
    Ok, doing it the hard and complicated way is of course your choice

    Cheers,
    _
    I haven't used QTQuick yet, and I'm a bit afraid of the unknown . Would you recommend that I create my widget using Qt quick and that I integrate that window in
    my QWidget application? Or do you recommend that I scratch the project and use QtQuick instead?

    Cheers!

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextEdit chat app

    Well, if you already have a widget based application and you only need this last view, then perhaps using QGraphicView would be on option.

    For a new application and these requirements I would be going for QtQuick.

    Cheers,
    _

  7. #7
    Join Date
    Jan 2016
    Posts
    4
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QTextEdit chat app

    Quote Originally Posted by anda_skoa View Post
    Well, if you already have a widget based application and you only need this last view, then perhaps using QGraphicView would be on option.

    For a new application and these requirements I would be going for QtQuick.

    Cheers,
    _
    Okey, thank you.

Similar Threads

  1. chat application
    By prabhatjha in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2015, 20:44
  2. Qt Network Chat
    By Vivek1982 in forum Newbie
    Replies: 18
    Last Post: 1st October 2013, 06:11
  3. Simple chat
    By kernel.roy in forum Qt Programming
    Replies: 3
    Last Post: 9th September 2010, 12:41
  4. Simple chat
    By kernel.roy in forum Qt Programming
    Replies: 3
    Last Post: 9th September 2010, 06:37
  5. TCP Chat Problem
    By cooler123 in forum Qt Programming
    Replies: 2
    Last Post: 27th September 2007, 07:47

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.