Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5994699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:51:19+00:00 2026-05-22T23:51:19+00:00

I am wanting to have a place where i can store all the strings

  • 0

I am wanting to have a place where i can store all the strings used in my applicaton, so i can modify them in one place and not all the places. Something like a resource file, where i can put a label on the strings and just call the label.

I am not aware of anything offered by QT for this, so would I just need to create a header file with all those strings and include it everywhere I need it? What is the appropriate way to do this and could you offer a small example?

Thanks!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:51:19+00:00Added an answer on May 22, 2026 at 11:51 pm

    I haven’t used it yet, but I think, that the Qt Internationalization would allow you to do something like this, since one of it’s options is to take all strings out of the application code so they can be replaced by translations. Even if you don’t want to use any other features of this module, it would allow you to solve your problem. Replacing a string for a label would look like this:

    QLabel *label = new QLabel(tr("Password:"));
    

    The tr() function is already part of the Qt classes and you get a few more functions and macros for free that help to search and replace strings.
    The strings to be replaced can then be managed with QtLinguist.
    You can find a more detailed explanation here: Internationalization with Qt

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a file server and wanting to optimize it the best I can,
can anyone help? I have created a WCF library (not application) and i will
I have the following snippet wherein I'm wanting to grab all entries from SMSGateway
I am wanting to have a typedef within in a typedef and wonder if
I'm wanting to have a strongly typed user control that accepts the class PaginatedList<T>
I am wanting to have the EXACT same data across two WordPress sites that
EDIT: See my answer below--> I am wanting to have a view that when
I'm using scrollto, and I'm wanting to have a class added when it scrolls
I have been wanting to make a circular preloader in my iPhone app, but
I have a valid reason for wanting to do this, but it's a long

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.