Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Adding emojis

    General and Desktop
    3
    5
    523
    Loading More Posts
    • 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
      Chaki last edited by

      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 Reply Quote 1
      • J
        JackTr last edited by

        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 Reply Quote 1
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          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 Reply Quote 2
          • J
            JackTr last edited by 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 :)

            SGaist 1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion @JackTr last edited by

              @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 Reply Quote 1
              • First post
                Last post