Results 1 to 2 of 2

Thread: Displaying data variables with .

  1. #1
    Join Date
    Jan 2021
    Posts
    20
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Displaying data variables with .

    Hi All,

    In my program, uint16_t swMajorVer = 1, swMinorVer = 24; variables. And I want to display them in this format ex: version = 1.24
    How can I put "." in between two variables while displaying?

    Thanks,
    Anita

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,884
    Thanks
    274
    Thanked 794 Times in 784 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Displaying data variables with .

    Try

    Qt Code:
    1. QString( "%1.%2" ).arg( swMajorVer ).arg( swMinorVer );
    To copy to clipboard, switch view to plain text mode 
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 3
    Last Post: 27th August 2014, 14:54
  2. Qtreeview not displaying data (data() is called)
    By mraww in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2013, 20:19
  3. displaying data
    By willief in forum Newbie
    Replies: 4
    Last Post: 10th March 2011, 06:33
  4. Displaying YUV data through Phonon
    By heminm in forum Qt Programming
    Replies: 0
    Last Post: 10th October 2009, 16:16
  5. Displaying data in QTable
    By raghvendramisra in forum Qt Tools
    Replies: 1
    Last Post: 6th September 2007, 12:48

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.