# Two instances of QT GUI Sink in a single program

**URL:** <https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086>\
**Category:** GNU Radio\
**Created:** [August 25, 2011, 10:42am UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086 "2011-08-25T10:42:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [August 25, 2011, 10:42am UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086/1 "2011-08-25T10:42:54Z")

</div>

Is it possible to put two QT GUI Sinks (FFT displays) in a single  
application window? I want to use one to show the radio spectrum  
(to/from  
UHD) and another to show the audio spectrum, at the same time.

When I put two QT GUI Sink blocks in a GRC graph, I see only one of them  
in  
the application windows, unlike QT GUI Entries and other GUI elements  
that  
can have many instances in the same window.

Thanks, Sivan T.

---

<div class="post-metadata">

**Author:** ![Sivan\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sivan\_T](https://www.ruby-forum.com/u/Sivan_T)\
**Post date:** [August 27, 2011, 11:15pm UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086/2 "2011-08-27T23:15:25Z")

</div>

On Thu, Aug 25, 2011 at 4:41 AM, Sivan T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Is it possible to put two QT GUI Sinks (FFT displays) in a single  
> application window? I want to use one to show the radio spectrum (to/from  
> UHD) and another to show the audio spectrum, at the same time.
> 
> When I put two QT GUI Sink blocks in a GRC graph, I see only one of them in  
> the application windows, unlike QT GUI Entries and other GUI elements that  
> can have many instances in the same window.
> 
> Thanks, Sivan T.

You can definitely have more than one QT GUI blocks in a program. It’s  
probably an initialization problem that’s going wrong in your code.  
You can see multiple QT GUI’s used in  
gnuradio-examples/python/digital/benchmark\_qt\_loopback.py.

Also, gnuradio-companion now works with QT GUI (set in the Options  
block), and it handles multiple QT GUI blocks. You could create  
something there, build the flow graph, and then see how the QT GUI  
objects are manipulated to make sure they all get shown properly.

Tom

---

<div class="post-metadata">

**Author:** ![Sivan\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sivan\_T](https://www.ruby-forum.com/u/Sivan_T)\
**Post date:** [August 28, 2011, 6:44pm UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086/3 "2011-08-28T18:44:04Z")

</div>

> Thanks Tom. I guess I did not make myself clear. I do have several QT  
> GUI blocks in the program, which I indeed generate using GRC. I have  
> many sliders, a checkbox, and a sink (FFT). If I add a slider, I see  
> it on the screen when I run the new program. When when I add a sink  
> block, there is still only one FFT display, showing the results from  
> one of the FFT blocks. The problem is only with the QT Sink block, not  
> with all the QT blocks.
> 
> Sivan  
> The attached .grc file has TWO QT-GUI sinks, and they are both  
> displayed. Now, I have to grow the window in order to see them both,  
> since  
> they each take up a fair amount of real-estate.

---

<div class="post-metadata">

**Author:** ![Sivan\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sivan\_T](https://www.ruby-forum.com/u/Sivan_T)\
**Post date:** [August 28, 2011, 1:16pm UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086/4 "2011-08-28T13:16:56Z")

</div>

Thanks Tom. I guess I did not make myself clear. I do have several QT  
GUI  
blocks in the program, which I indeed generate using GRC. I have many  
sliders, a checkbox, and a sink (FFT). If I add a slider, I see it on  
the  
screen when I run the new program. When when I add a sink block, there  
is  
still only one FFT display, showing the results from one of the FFT  
blocks.  
The problem is only with the QT Sink block, not with all the QT blocks.

Sivan

---

<div class="post-metadata">

**Author:** ![Sivan\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7bcc69/32.png) [@Sivan\_T](https://www.ruby-forum.com/u/Sivan_T)\
**Post date:** [August 29, 2011, 6:21pm UTC](https://www.ruby-forum.com/t/two-instances-of-qt-gui-sink-in-a-single-program/211086/5 "2011-08-29T18:21:59Z")

</div>

On Sun, Aug 28, 2011 at 7:15 AM, Sivan T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Thanks Tom. I guess I did not make myself clear. I do have several QT GUI  
> blocks in the program, which I indeed generate using GRC. I have many  
> sliders, a checkbox, and a sink (FFT). If I add a slider, I see it on the  
> screen when I run the new program. When when I add a sink block, there is  
> still only one FFT display, showing the results from one of the FFT blocks.  
> The problem is only with the QT Sink block, not with all the QT blocks.
> 
> Sivan

When you create more than one GT GUI window, they get stacked  
vertically. It’s likely that one is just off screen. Look into using  
the QT GUI Tab Widget to be able to tab between windows. It helps  
clean up the desktop.

Tom
