# QT Gui Sink

**URL:** <https://www.ruby-forum.com/t/qt-gui-sink/205269>\
**Category:** GNU Radio\
**Created:** [April 2, 2011, 2:12pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269 "2011-04-02T14:12:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [April 2, 2011, 2:12pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269/1 "2011-04-02T14:12:07Z")

</div>

Is there a way to control the update rate on the QT Gui sink? I have it  
running on the E100, but it would be helpful if I could slow down the  
update rate.

Philip

---

<div class="post-metadata">

**Author:** ![stedwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Post date:** [April 3, 2011, 5:58pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269/2 "2011-04-03T17:58:32Z")

</div>

On 04/02/2011 08:11 AM, Philip B. wrote:

> 

There’s a set\_update\_time() method, but it’s not exported through  
SWIG. The default is 0.1second.

–  
Marcus L.  
Principal Investigator  
Shirleys Bay Radio Astronomy Consortium

> **[Live Draw HK Tercepat | Result HK | HK Pools | Live HK | HK Prize Hari Ini](https://www.sbrac.org)**
>
> Temukan live draw hk tercepat melalui halaman hk pools yang resmi dan dapatkan result hk prize melalui live hk secara langsung di situs kami.

---

<div class="post-metadata">

**Author:** ![stedwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Post date:** [April 4, 2011, 2:08pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269/3 "2011-04-04T14:08:41Z")

</div>

On Sun, Apr 3, 2011 at 11:57 AM, Marcus D. Leech [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > Principal Investigator  
> > Shirleys Bay Radio Astronomy Consortium  
> > [http://www.sbrac.org](http://www.sbrac.org)

Right, and I believe it even works correctly now… The original API had  
the  
update time information as part of the constructor, but I didn’t see  
that as  
the correct thing to do, but I also did not think to export it.

I am working on updating the QtGUI, hopefully to resolve the  
segmentation  
fault issue when you close it. I’ll wrap this function and export it so  
you  
can use it later.

Tom

---

<div class="post-metadata">

**Author:** ![stedwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Post date:** [April 4, 2011, 4:29pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269/4 "2011-04-04T16:29:38Z")

</div>

On 04/04/2011 08:06 AM, Tom R. wrote:

> Right, and I believe it even works correctly now… The original API had the  
> update time information as part of the constructor, but I didn’t see that as  
> the correct thing to do, but I also did not think to export it.
> 
> I am working on updating the QtGUI, hopefully to resolve the segmentation  
> fault issue when you close it. I’ll wrap this function and export it so you  
> can use it later.

On further study, it appears the sink constantly does the fft  
calculation and only updates the display periodically.

What would be helpful for me is only run the fft when you update the  
display. Calculating the fft continuously is a waste of time. (Well, for  
an fft you display)

Philip

---

<div class="post-metadata">

**Author:** ![stedwick](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/90ced4/32.png) [@stedwick](https://www.ruby-forum.com/u/stedwick)\
**Post date:** [April 5, 2011, 1:23pm UTC](https://www.ruby-forum.com/t/qt-gui-sink/205269/5 "2011-04-05T13:23:35Z")

</div>

Hi Philip,

As Marcus and Tom have noted the SetUpdateTime() method can be used to  
set  
the display update time (but not the FFT calculation rate, which I think  
is  
what you want).

As this method is a slot it is possible to call it from your application  
without any mods to the QT Gui sink, here’s a simple example of how to  
do  
it:-

In pyqt\_example.py

def **init** (self, display, control):  
QtGui.QWidget. **init** (self, None)  
self.setWindowTitle(‘PyQt Test GUI’)

```
  self.boxlayout = QtGui.QBoxLayout(QtGui.QBoxLayout.LeftToRight, 

```

self)  
self.boxlayout.addWidget(display, 1)  
self.boxlayout.addWidget(control)

```
  self.resize(800, 500)

```

# 

# Change update rate to 1 second

# 

self.connect(self, QtCore.SIGNAL(“SetUpdateTime(double)”),  
display, QtCore.SLOT(“SetUpdateTime(double)”))

self.emit(QtCore.SIGNAL(“SetUpdateTime(double)”), 1)

I’m not sure if that’s helpful in your case however it may be  
interesting as  
the same technique can be used for any of the slots in  
spectrumdisplayform.h

BR,

Mike VK2XMC
