June 5, 2012

Massinissa Massinissa
Lab Rat
20 posts

QlineEdit with selectionChanged()

 

Hi
I’m wondering if someone can help me with this problem in QDesigner, I tried to connect a signal (selectionChanged()) for an EditLine calling a function that can open a QFileDialog. It has been done already under a project using QDialog form but when it comes for a new project with MainMenu as a form type, it does nothing it can’t even enter in the called function. I didn’t code the signal but I added it in the Signal/Slot Editor.
Do I need to do something else under MainMenu?
Thank you for your help!

Massi

 Signature 

Massinissa Bandou Ing.jr

3 replies

June 6, 2012

Gerolf Gerolf
Area 51 Engineer
3210 posts

Hi,

It’s hard to say without seeing the code. Does the debug version print something as debug message? This typically happens if a signal/slot connect call fails (which could be a reason).
Did you implement the slot? Did you implement it in the correct class? Did you call connect or setupUI?

 Signature 

Nokia Certified Qt Specialist.
Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

June 6, 2012

Jeroentje@home Jeroentje@ho..
Hobby Entomologist
247 posts

Hi, usually when a slot isn’t called it is because the connect wasn’t correct. In QDesigner you are able the check the signal/slot editor. Might want to debug it with just a simple lineedit update next to it. If that works, the signal is issued. After that make sure you are able to call the desired slot (maybe private member of a different class?)
good luck, but as Gerolf says, we can’t do much without code.

 Signature 

Greetz, Jeroen

June 6, 2012

Massinissa Massinissa
Lab Rat
20 posts

Thank you it works!!!! sorry it’s my fault, public slot: instead of public: in my .h even if you added the functions manually by right clicking on the form and selecting change signals/slots:
thank you for your help!
Massi

 Signature 

Massinissa Bandou Ing.jr

 
  ‹‹ Deleted      [Solved] Could not parse stylesheet of widget ››

You must log in to post a reply. Not a member yet? Register here!