Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Radio button and Display Widgets on qt4-designer
QtWS25 Last Chance

Radio button and Display Widgets on qt4-designer

Scheduled Pinned Locked Moved Qt Creator and other tools
6 Posts 3 Posters 2.6k Views
  • 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.
  • M Offline
    M Offline
    martinbach
    wrote on last edited by
    #1

    Hi all.

    I have a shell script with an old text-based user interface: I want to replace my shell code with python and create a graphical user interface using qt designer tool and pyside.

    I was able to add a menu bar, a tab and some radio buttons.

    When a user selects a radio button I would like to show in a text box a brief description of what that selection means; when it selects another radio button a different description on the same text box should appear and so on.

    My questions are:

    What widget should I use as text box ? I was thinking at Text Browser as Display Widget, but I'm not sure. A Label ? A Text Edit ?
    When I connect a radio button to the Text Browser I can see some interesting slots under the Text Browser such as insertHtml or insertPlainText, but as soon as I select the signal clicked() on the radio button they disappear and I'm not even able to find them again.
    I tried also to connect a button with a Label widget, but I'm not able to find any kind of setText slot. Reading the documentation I know setText exists, but I cannot use it inside my code.
    

    Thanks for any kind of your support.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You can't connect the radio button directly to your label or text browser. You have to use an intermediated slot e.g. in your MainWindow where you will load your text and call setText or insertPlainText (depending on the widget you will choose)

      You should take a look at Qt's documentation Examples and Demos, there is a lot of good information there to get you started

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        martinbach
        wrote on last edited by
        #3

        Thanks for your reply.

        Do you have any link for me ?
        I'm trying to follow this guide, but I'm not able to solve my issue
        http://qt-project.org/wiki/PySideTutorials_Simple_Dialog

        1 Reply Last reply
        0
        • C Offline
          C Offline
          clochydd
          wrote on last edited by
          #4

          What if you use the toolTip for that purpose? You may modify the duration to give your user enough time to read.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            martinbach
            wrote on last edited by
            #5

            I need to describe what the radio button does and that description is quite long.
            And in the descrption I would like the user copy some commands.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You can use a QButtonGroup and connect the buttonClicked(int) signal to a slot so based on the button id you can update the label with the explanation

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/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