Skip to main content

Layout

Jia-YinAbout 1 mincoursecomm

GUI Hint

All QT GUI components have a parameter called GUI Hint. This parameter is used to arrange GUI components within the window and assign them to tabs in a QT GUI Tab Widget.

source: wiki.gnuradio.org
source: wiki.gnuradio.org

The format of the GUI Hint is: (row, column, row span, column span).
For example, we may have a 4x3 grid layout, with each GUI component arranged as shown in the figure on the right.

source: wiki.gnuradio.org
source: wiki.gnuradio.org

Let's see an Amplitude Modulation (AM) Signal Example:

Parameters:

  • samp_rate: 1e6
  • Wav File Source: Download file hereopen in new window (You can use an Audio source with sample rate=44.1k)
  • Signal Source: Frequency=400e3
  • GUI Range: Default=1, Start=0, Stop=2, Step=0.1, GUI Hint:0,0,1,8
  • Frequency Sink (Source): GUI Hint:1,0,4,8
  • Frequency Sink (AM): GUI Hint:5,0,4,8

Simulation result:

QT GUI Tab Widget

A Tab Widget, commonly seen in graphical user interface (GUI) applications, resembles the following figure.

The most important parameter for the QT GUI Tab Widget is Num Tabs, which is used to set the number of tabs. Suppose its name is qtab, and Num Tabs=2. Then, we can set a GUI component on tab 0 by using GUI Hint: qtab@0, and set on tab 1 by using GUI Hint: qtab@1.

Info

Note: The QT GUI Tab Widget is also a GUI component, so we can use the GUI Hint to set its size and position.

Let's utilize the QT GUI Tab Widget to create a simple system.

Simulation result:

We can set the GUI Hint for a GUI component on a specific tab by using the following syntax: tab_id@tab_index:row,col,row_span,col_span.


Exercise 3

Modify the system diagram shown above to produce the following result. Create two separate tabs: one labeled "Time" and another labeled "Frequency." For each tab, the top portion should display the original signal, while the bottom portion should display the corresponding amplitude-modulated (AM) signal.