Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Adding emojis

Adding emojis

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 858 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chaki
    wrote on last edited by
    #1

    Hello,
    I have written a ChatClient and currently I am trying to implement Emojis into the programm.
    I want to click on a button and afterwards a window opens up with some emojis you can choose from.
    Unfortunately I could not find anything helpful on the Internet and I have no Idea how to implement it.
    I hope somebody knows.

    1 Reply Last reply
    1
    • J Offline
      J Offline
      JackTr
      wrote on last edited by
      #2

      I would utelize the QInputDialog, something like this:

        QString name = QInputDialog::getText(this,
                 tr("Add task"),
                 tr("Task name"),
                 QTableWidget::Normal,
                 tr("Untitled task"),			&ok);
      

      You can fill the Table widget with emoticons and remove the borders and headers and fill the cells with QIcons and your emojis, maybe putting the QString paths tho the emojis in a QVector.

      Have fun :) Shouldn't be that difficult

      1 Reply Last reply
      1
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        @JackTr dialog suggestion is a good one however there are no pre-backed method for that. Still you can build your dialog with rather a QListView as it provides an easier setup to load your icons in a grid that you can size easily.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        2
        • J Offline
          J Offline
          JackTr
          wrote on last edited by JackTr
          #4

          Yeah, QListView is a nice one. Maybe without even a dialog but a scroll area, depending on how many icons he got. And than connecting a button to a function that toggles the widget between

          ->setHide(true)
          

          and

          ->setHide(false)
          

          Or a QTabWidget to show and switch between icon categories :) Qt is such a greate tool - freedom and fun :)

          SGaistS 1 Reply Last reply
          0
          • J JackTr

            Yeah, QListView is a nice one. Maybe without even a dialog but a scroll area, depending on how many icons he got. And than connecting a button to a function that toggles the widget between

            ->setHide(true)
            

            and

            ->setHide(false)
            

            Or a QTabWidget to show and switch between icon categories :) Qt is such a greate tool - freedom and fun :)

            SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @JackTr no need for a scroll area, it's already provided in the various item views subclasses.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved