No values from QSlider ?

Coding + IDE + Code-Editor + Syntax + User-Functions + Anything else

No values from QSlider ?

Postby akejohan » Thu Jan 03, 2013 8:39 pm

I try to use slider to set RGB values 0-255 that i will send via udp to my microcontroller but I am unable to get any values from my QSliders.

I created an QSlider named redSlider in QT designer I set min and max values and
the slider is enabled.
In Q7Basic MainWindow.QMainWindow i enter the following code:

Outlet red_label As QLabel
Outlet redSlider As QSlider
Signal on_redSlider_sliderMoved(red_value As Integer )
' Dim red_value As Integer
'red_value_slider = 125
Dim red_string As String
red_string = ( Str (red_value))
red_label.Text = red_string
End Signal

The program never enter the Signal on_redSlider_sliderMoved().
I also tryed Signal on_redSlider_valueChanged() but the program never enter to this signal. :|

How can this problem be solved?
akejohan
 
Posts: 7
Joined: Tue Jan 01, 2013 2:13 pm

Re: No values from QSlider ?

Postby Henning » Fri Jan 04, 2013 12:16 am

This works.

Code: Select all
' this is the mainwindow scope
Outlet red_Slider As QSlider

Outlet red_label As QLabel


Signal on_red_Slider_sliderMoved(Value As Integer)
   red_label.text = String(Value)
End Signal



/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: No values from QSlider ?

Postby akejohan » Fri Jan 04, 2013 9:43 am

Hi Henning, Thank you for your reply. I tryed your code but i still can't get any values. When I debug my code i never enter in to the
Signal on_redSlider_sliderMoved(Value As Integer) it seems that this is wrong signal ? :( Any idea?
akejohan
 
Posts: 7
Joined: Tue Jan 01, 2013 2:13 pm

Re: No values from QSlider ?

Postby Slowdown » Fri Jan 04, 2013 10:51 am

QSlider example,
it's the same as Henning posted but now a complete project.

QSlider.zip
(1.51 KiB) Downloaded 56 times
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: No values from QSlider ?

Postby Slowdown » Sat Jan 05, 2013 2:06 pm

Better use this in the example above,
Code: Select all
Signal on_Hor_Slider_valueChanged(Value As Integer)
  Hor_Label.text = String(Value)
End Signal

Signal : sliderMoved (Value As Integer) only returns a value if Slider Button is clicked and hold-down by the mouse.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: No values from QSlider ?

Postby akejohan » Sat Jan 05, 2013 2:10 pm

Thank you for your reply I have tryed to open your project in Q7Basic windows version but I can't.
I opend in ubuntu 12.10 but when I run the project the window never opens. :o
Everything looks ok in devekopment mode but when I run the project no window opens.
Do I have to compile Q7Basic in Ubuntu?
How do you run a project in linux?

I am going to use this project in windows.
Maybe you could send a version that I can run on windows platform?

Thank you.
Best regards
akejohan
akejohan
 
Posts: 7
Joined: Tue Jan 01, 2013 2:13 pm

Re: No values from QSlider ?

Postby Slowdown » Sat Jan 05, 2013 3:59 pm

Hi akejohan,

I wrote the small example using Q7B with Ubuntu 12.04 64bit.
The same code is running fine with Q7B with Windows XP.
Can you run any of the examples ?
Do I have to compile Q7Basic in Ubuntu?

If you use Ubuntu 64 bit use http://www.q7basic.org/64bit_Ubuntu_Q7Basic.zip
and when using the 32 bit version you can use http://www.q7basic.org/Q7Basic.tar.gz or http://www.q7basic.org/Q7Basic_Mandriva.zip
I have messed up my Ubuntu 12.04 32 bit installation so i can't test it for you.
You can compile Q7B yourself but you must have Qt 4.7 or higher installed and don't forget the phonon libs.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: No values from QSlider ?

Postby Henning » Sat Jan 05, 2013 5:54 pm

All is running fine here in XP.

/Henning
Henning
 
Posts: 523
Joined: Fri Aug 13, 2010 6:29 pm

Re: No values from QSlider ?

Postby Slowdown » Sat Jan 05, 2013 6:58 pm

Thanks Henning.

Will re-install tonight Ubuntu 12.10 32 bit.
After that i check the binary's from the Q7B download page and report back.
If they are not working i'll compile a 32 bit Ubuntu version perhaps in that case is Bernd willing to provide it on Q7B.
Kind regards,
Slowdown

OSX 10.8.x, VBox Xp, Ubuntu 32/64 bit, EOS 64 bit
Slowdown
 
Posts: 465
Joined: Sat May 01, 2010 7:11 pm
Location: Netherlands

Re: No values from QSlider ?

Postby akejohan » Sat Jan 05, 2013 7:53 pm

I just want you to know that I run on Windows 7 32 bit.
I created a new project and I added only one vertical slider and one label to my project. But I still get no values from QSlider.
I can set Enable to True and False with pushbuttons.

Regards
akejohan
akejohan
 
Posts: 7
Joined: Tue Jan 01, 2013 2:13 pm

Next

Return to Questions & Answers

Who is online

Users browsing this forum: No registered users and 1 guest

cron