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
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    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, 15:54
  2. Qtreeview not displaying data (data() is called)
    By mraww in forum Qt Programming
    Replies: 1
    Last Post: 13th April 2013, 21:19
  3. displaying data
    By willief in forum Newbie
    Replies: 4
    Last Post: 10th March 2011, 07:33
  4. Displaying YUV data through Phonon
    By heminm in forum Qt Programming
    Replies: 0
    Last Post: 10th October 2009, 17:16
  5. Displaying data in QTable
    By raghvendramisra in forum Qt Tools
    Replies: 1
    Last Post: 6th September 2007, 13: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.