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. Which output (display) widget are available.
Qt 6.11 is out! See what's new in the release blog

Which output (display) widget are available.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 742 Views 3 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.
  • ACalcaterraA Offline
    ACalcaterraA Offline
    ACalcaterra
    wrote on last edited by
    #1

    Hi,
    sorry to ask a really simple question: but what if I want to display in a widget a float number produced in my code?
    The only thing I find for this is a LCD_display that i don't like much.
    Is not there something like a QtLineEdit (same fonts) that does not accept
    mouse focus, or keystrokes? (maybe with a grayed out background, but not essential)
    Thank you!
    I use QtCreator 2.5.2, Qt version is 4.8.6, last one that works in Scientific Linux 6. Going forward from this is quite painful because of upgrading gcc.

    miclandM kshegunovK 2 Replies Last reply
    0
    • ACalcaterraA ACalcaterra

      Hi,
      sorry to ask a really simple question: but what if I want to display in a widget a float number produced in my code?
      The only thing I find for this is a LCD_display that i don't like much.
      Is not there something like a QtLineEdit (same fonts) that does not accept
      mouse focus, or keystrokes? (maybe with a grayed out background, but not essential)
      Thank you!
      I use QtCreator 2.5.2, Qt version is 4.8.6, last one that works in Scientific Linux 6. Going forward from this is quite painful because of upgrading gcc.

      miclandM Offline
      miclandM Offline
      micland
      wrote on last edited by micland
      #2

      @ACalcaterra If your just want to show the value, take a QLabel and format the float value as string.

      QLabel *myLabel = new QLabel(this);
      myLayout->addWidget(myLabel);
      myLabel->setText(QString::number(myFloat, 'f', 2));
      
      1 Reply Last reply
      2
      • ACalcaterraA ACalcaterra

        Hi,
        sorry to ask a really simple question: but what if I want to display in a widget a float number produced in my code?
        The only thing I find for this is a LCD_display that i don't like much.
        Is not there something like a QtLineEdit (same fonts) that does not accept
        mouse focus, or keystrokes? (maybe with a grayed out background, but not essential)
        Thank you!
        I use QtCreator 2.5.2, Qt version is 4.8.6, last one that works in Scientific Linux 6. Going forward from this is quite painful because of upgrading gcc.

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on last edited by
        #3

        @ACalcaterra
        Hello,
        You probably want QLabel. It's simplistic, but it's the simplest display widget out there. You can also use a QLineEdit that has its readOnly property set.

        Kind regards.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0

        • Login

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