Hey!

I'm trying to connect the buttons on my form to the some slots that I have created in my subclassed form. Basically I'm not sure that the connection is happening to make the actions I need to happen...happen.

Right now it just changes a pixmap from one image to another. Both images are present...but nothing appears to happen here's my code.

Here's the class containing the UI form

Qt Code:
  1. #ifndef DECKSIMULATOR_H
  2. #define DECKSIMULATOR_H
  3.  
  4. #include <QtGui/QMainWindow>
  5.  
  6. #include "ui_simulator.h"
  7.  
  8. class DeckSimulator : public QMainWindow
  9. {
  10. Q_OBJECT
  11.  
  12. public:
  13. DeckSimulator(QMainWindow *parent = 0);
  14. ~DeckSimulator();
  15.  
  16.  
  17. private:
  18. Ui::MainWindow ui;
  19.  
  20. private slots:
  21. void startpump_TP();
  22. void stoppump_TP();
  23. void startpump_DP();
  24. void stoppump_DP();
  25. void startpump_ACP();
  26. void stoppump_ACP();
  27. void startpump_RP();
  28. void stoppump_RP();
  29. };
  30.  
  31. #endif
To copy to clipboard, switch view to plain text mode 

here's the cpp

Qt Code:
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <time.h>
  5. #include <QtGui>
  6. #include <QtDebug>
  7. #include "simulator.h"
  8.  
  9. DeckSimulator::DeckSimulator(QMainWindow *parent)
  10. : QMainWindow(parent)
  11.  
  12. {
  13. // Setup the GUI
  14. ui.setupUi(this);
  15.  
  16. // Connect to GUI signals
  17. connect(ui.btnStart_TP, SIGNAL(clicked()), this, SLOT(startpump_TP()));
  18. connect(ui.btnStop_TP, SIGNAL(clicked()), this, SLOT(stoppump_TP()));
  19.  
  20. }
  21.  
  22. // Destructor
  23. DeckSimulator::~DeckSimulator()
  24. {
  25.  
  26. }
  27.  
  28. void DeckSimulator::startpump_TP()
  29. {
  30. ui.pixTransferPump->setText("Hello");
  31. QPixmap pixmap(QString::fromUtf8("pump_start_image_100.png"));
  32. ui.pixTransferPump->setPixmap(pixmap);
  33. }
  34.  
  35. void DeckSimulator::stoppump_TP()
  36. {
  37. ui.pixTransferPump->setText("Goodbye");
  38. QPixmap pixmap(QString::fromUtf8("pump_stop_image_100.png"));
  39. ui.pixTransferPump->setPixmap(pixmap);
  40. }
  41.  
  42. void DeckSimulator::startpump_DP()
  43. {
  44.  
  45. }
  46.  
  47. void DeckSimulator::stoppump_DP()
  48. {
  49.  
  50. }
  51.  
  52. void DeckSimulator::startpump_ACP()
  53. {
  54.  
  55. }
  56.  
  57. void DeckSimulator::stoppump_ACP()
  58. {
  59.  
  60. }
  61.  
  62. void DeckSimulator::startpump_RP()
  63. {
  64.  
  65. }
  66.  
  67. void DeckSimulator::stoppump_RP()
  68. {
  69.  
  70. }
To copy to clipboard, switch view to plain text mode 

I've tried setting the text to change...but nothing happens...I've tried the images...nothing happens.

I'm out of ideas!