Results 1 to 5 of 5

Thread: trouble with signals and slots

  1. #1
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy trouble with signals and slots

    hey there, i have created a push button inside a tab called demandsTab() and i have connected the button to a method. the method and the connection is shown below:

    QPushButton *shortestPathButton = new QPushButton(tr("Shortest Path"));
    connect(shortestPathButton, SIGNAL(clicked()), this, SLOT(PermissionsTab:utputTable()));

    the slot function that i created is shown below:

    void PermissionsTab:utputTable()
    {

    int result = 5;
    display->setText(QString::number(result));
    }

    i basically just want the display to output the number 5 in the permissions tab when i press the button from the demands tab, but it isnt working....any idea's??? Jag

  2. The following user says thank you to therealjag for this useful post:


  3. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    85
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: trouble with signals and slots

    Try omitting PermissionsTab:
    Qt Code:
    1. connect(shortestPathButton, SIGNAL(clicked()), this, SLOT(outputTable()));
    To copy to clipboard, switch view to plain text mode 
    If that does not help build in debug mode and run your app so that you can see the standard (error) output - if your IDE does not support it - from the commandline. Qt will then warn about non-existing signals and slots.

  4. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: trouble with signals and slots

    Quote Originally Posted by Codepoet
    If that does not help build in debug mode and run your app so that you can see the standard (error) output - if your IDE does not support it - from the commandline.
    To see those messages on windows console, you will have to add "CONFIG += console" to your .pro file.
    Last edited by jacek; 23rd February 2006 at 21:21.

  5. #4
    Join Date
    Feb 2006
    Posts
    87
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: trouble with signals and slots

    i tried adding CONFIG += console to my .pro file but it isnt working, i dont understand why and its really annoying.

  6. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 975 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: trouble with signals and slots

    Quote Originally Posted by therealjag
    i tried adding CONFIG += console to my .pro file but it isnt working, i dont understand why and its really annoying.
    Do you have Qt libraries compiled in debug mode? Did you compile your program in debug mode?

Similar Threads

  1. Signals and Slots Problem
    By GenericProdigy in forum Qt Programming
    Replies: 4
    Last Post: 2nd February 2009, 09:06
  2. Signals and Slots
    By 83.manish in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2008, 10:31
  3. Problem with SpinBox signals and slots
    By ramstormrage in forum Newbie
    Replies: 4
    Last Post: 2nd May 2008, 01:45
  4. signals and slots in plugins
    By anderl in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 13:57
  5. Signals and Slots in dll
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 29th March 2006, 08:12

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.