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. [solved] adding Qt to existing program
Forum Updated to NodeBB v4.3 + New Features

[solved] adding Qt to existing program

Scheduled Pinned Locked Moved General and Desktop
45 Posts 6 Posters 21.4k Views 1 Watching
  • 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.
  • G Offline
    G Offline
    giesbert
    wrote on 30 Mar 2011, 16:41 last edited by
    #41

    a qstring object has a method called arg which replaces %1 by its value and returns a temporary object. if on this temp object, another arg is called, it replaces all instances of %2 by its value and so on. Afaik, up to 99 :-)

    Nokia Certified Qt Specialist.
    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mzimmers
      wrote on 30 Mar 2011, 16:44 last edited by
      #42

      Interesting...thanks.

      So...how do I mark this solved? With a tag?

      1 Reply Last reply
      0
      • G Offline
        G Offline
        giesbert
        wrote on 30 Mar 2011, 16:46 last edited by
        #43

        go to your first post, click edit and change the title :-)
        Just add [Solved] in front

        Nokia Certified Qt Specialist.
        Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on 30 Mar 2011, 17:18 last edited by
          #44

          [quote author="Gerolf" date="1301503305"]a qstring object has a method called arg which replaces %1 by its value and returns a temporary object. if on this temp object, another arg is called, it replaces all instances of %2 by its value and so on. Afaik, up to 99 :-)[/quote]

          The rationale behind the %1 %2 and so on is, that these strings are regularly translatable and the placeholders need not be integers or numbers but also strings. In some languages, things must be reordered to result in a valid sentence. So you can the write

          @
          QString x = QString("%2 is before %1).arg("first").arg("second");
          @

          The resulting string is "second is before first".

          http://www.catb.org/~esr/faqs/smart-questions.html

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            ZapB
            wrote on 30 Mar 2011, 21:21 last edited by
            #45

            [quote author="mzimmers" date="1301501568"]Oh, this is OUTSTANDING. Thanks so much to everyone for their help in this thread. It may not seem like much to anyone else, but this is a major step forward for me.[/quote]

            You're welcome. The initial steps are often the most confusing with a new technology. I will shortly post a modified example that performs the calculations in a separate thread and uses signals to let the main GUI thread know about the current status. That way you;ll have an example on which you can build if you do need to do some seriously time consuming number crunching without blocking the GUI.

            Nokia Certified Qt Specialist
            Interested in hearing about Qt related work

            1 Reply Last reply
            0

            41/45

            30 Mar 2011, 16:41

            • Login

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