Qt Forum

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

    Update: Forum Guidelines & Code of Conduct

    Solved Emojis und Icons

    German
    3
    14
    573
    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.
    • D
      Dany last edited by

      Hi!

      Unicode hat ja bereits jede Menge Icons und Emojis dabei. Auf Emojipedia findet sich ja unglaublich viel. Wie kann ich die denn in Qt nutzen? Zum Beispiel U+274C?

      1 Reply Last reply Reply Quote 0
      • Christian Ehrlicher
        Christian Ehrlicher Lifetime Qt Champion last edited by

        Finde einen Font der dieses Zeichen hat und benutze diesen in deinem Programm.

        Qt has to stay free or it will die.

        1 Reply Last reply Reply Quote 0
        • D
          Dany last edited by

          Okay und wie setze ich so einZeichen?

          raven-worx Christian Ehrlicher 2 Replies Last reply Reply Quote 0
          • raven-worx
            raven-worx Moderators @Dany last edited by

            @Dany
            könnte dich auch interessieren:
            https://forum.qt.io/topic/123515/qrwemoticons

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            1 Reply Last reply Reply Quote 1
            • D
              Dany last edited by

              Das klingt in der Tat interessant! Danke!

              1 Reply Last reply Reply Quote 0
              • Christian Ehrlicher
                Christian Ehrlicher Lifetime Qt Champion @Dany last edited by

                @Dany said in Emojis und Icons:

                Okay und wie setze ich so einZeichen?

                Was meinst Du damit? Es ist ein normaler string mit einem Unicode-Zeichen. Den kannst Du direkt eingeben (nicht unbedingt empfehlenswert) oder als hex-representation in der Form \x247c.

                Qt has to stay free or it will die.

                1 Reply Last reply Reply Quote 0
                • D
                  Dany last edited by

                  @Christian-Ehrlicher So einfach geht das? Also das wäre ja super!

                  Allerdings hab ich das gerade versucht und der Compiler meldet:

                  Hex-Escape-Sequenz außerhalb des Wertebereiches
                  chatInsert("Ich", "Jetzt", "\x274c", false);
                                              ^~~~~~~~
                  
                  1 Reply Last reply Reply Quote 0
                  • Christian Ehrlicher
                    Christian Ehrlicher Lifetime Qt Champion last edited by

                    Sorry \x24\x7c

                    Qt has to stay free or it will die.

                    1 Reply Last reply Reply Quote 0
                    • D
                      Dany last edited by

                      Da kommt bei mir dann

                      'L

                      raus ;)

                      1 Reply Last reply Reply Quote 0
                      • Christian Ehrlicher
                        Christian Ehrlicher Lifetime Qt Champion last edited by

                        @Dany said in Emojis und Icons:

                        U+274C

                        Stimmt, Du erzeugst es ja nicht über QChar sondern in einem string. Demnach muss man die UTF-8 - Kodierung des Zeichens benutzen.

                        "\xE2\x9D\x8C"

                        Qt has to stay free or it will die.

                        1 Reply Last reply Reply Quote 0
                        • D
                          Dany last edited by

                          @Christian-Ehrlicher said in Emojis und Icons:

                          \xE2\x9D\x8C

                          Ja das funktioniert hervorragen! Und wie mache ich jetzt aus U-274c \xE2\x9D\x8C

                          Christian Ehrlicher raven-worx 2 Replies Last reply Reply Quote 0
                          • Christian Ehrlicher
                            Christian Ehrlicher Lifetime Qt Champion @Dany last edited by

                            @Dany Meinen link folgen?

                            Qt has to stay free or it will die.

                            1 Reply Last reply Reply Quote 0
                            • raven-worx
                              raven-worx Moderators @Dany last edited by raven-worx

                              @Dany
                              Sollte ebenfalls funktionieren (nicht getestet)

                              uint u = 0x274c;
                              QString::fromUcs4(&u, 1)
                              

                              --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                              If you have a question please use the forum so others can benefit from the solution in the future

                              1 Reply Last reply Reply Quote 0
                              • D
                                Dany last edited by

                                @Christian-Ehrlicher

                                Tatsächlich hab ich gar nicht gesehen, dass da ein Link ist :(. Auf jeden Fall danke für die Hilfe!

                                @raven-worx

                                Hab ich probiert, funktioniert einwandfrei. Danke!

                                1 Reply Last reply Reply Quote 0
                                • First post
                                  Last post