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. QMessagebox buttons in local language
Forum Updated to NodeBB v4.3 + New Features

QMessagebox buttons in local language

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 1.9k 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.
  • A Offline
    A Offline
    Alexandre Camelo
    wrote on 26 Dec 2019, 00:50 last edited by
    #1

    Hello friends!

    Is there any way to configure the buttons of a QMessagebox for the local language? Example: The "Yes" and "No" buttons contain these same words in Brazilian Portuguese.

    J 1 Reply Last reply 26 Dec 2019, 09:07
    0
    • A Alexandre Camelo
      26 Dec 2019, 00:50

      Hello friends!

      Is there any way to configure the buttons of a QMessagebox for the local language? Example: The "Yes" and "No" buttons contain these same words in Brazilian Portuguese.

      J Offline
      J Offline
      JonB
      wrote on 26 Dec 2019, 09:07 last edited by
      #2

      @Alexandre-Camelo
      https://stackoverflow.com/questions/31533019/how-to-translate-the-buttons-in-qmessagebox should show you how to do this correctly.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on 26 Dec 2019, 09:08 last edited by
        #3

        You have to load the Qt translations, see e.g. here: https://wiki.qt.io/How_to_create_a_multi_language_application

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        1 Reply Last reply
        3
        • A Offline
          A Offline
          avinash.r.p
          wrote on 31 Dec 2019, 06:32 last edited by
          #4

          QMessageBox messageBox(QMessageBox::Question,
          tr("Sure want to quit?"),
          tr("Sure to quit?"),
          QMessageBox::Yes | QMessageBox::No,
          this);
          messageBox.setButtonText(QMessageBox::Yes, tr("Yes"));
          messageBox.setButtonText(QMessageBox::No, tr("No"));

          1 Reply Last reply
          1

          1/4

          26 Dec 2019, 00:50

          • Login

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