Results 1 to 20 of 30

Thread: Problem with slot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #20
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Problem with slot

    I originally tried to explain that the process() function brings in all of this data and draws the polygons. I then explained the items I need to scale were stored and created under the process() function,
    At least I understood it defferently.
    Your original problem was getting the signal/slots to work.
    I didn't pay any attention to what you were trying to do IN your code, I was just trying to help you get your code to work, and to explain to you the syntax rules for connecting signal and slot.
    and if you are now telling I essentially need to re-input the data in the same data structures and essentially copy all the code from process() into processRight().
    I never said anything about that.
    If at all then this (more than once):
    You don't need to create new slots, make one slot that connects to the valueChangedRight(int) signal,
    This is true, provided you can do all the work in one slot, that reacts to hte valueChangedRight(int) signal.
    So basically you can do the following:
    Qt Code:
    1. test1::test1() {
    2. setupUi(this);
    3. //connect(pushButton, SIGNAL(clicked()), this, SLOT(process()));
    4. connect(horizontalSlider, SIGNAL(valueChangedRight(int)), this, SLOT(process(int)));
    5. }
    6.  
    7. void test1::process(int pos) {
    8. //adjust your original process() code so that it will remember the last pos,
    9. //and check based on current pos values if the movement is to the left or right.
    10. {
    To copy to clipboard, switch view to plain text mode 
    Last edited by jacek; 26th March 2007 at 18:58. Reason: wrapped too long line

Similar Threads

  1. QTimer problem ... it runs but never triggs
    By yellowmat in forum Newbie
    Replies: 4
    Last Post: 4th July 2006, 12:54
  2. Problem with signals and slots
    By conexion2000 in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2006, 10:20
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. Replies: 7
    Last Post: 15th February 2006, 11:34
  5. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.