greetings,
i am using a component usign multiple inhritance approach. I has got a tabWidget, a push button and a table widget. On press of a push button i want this table widget to appear and go.

here is how my code look like.

ui file for dialog
Qt Code:
  1. <ui version="4.0" >
  2. <author></author>
  3. <comment></comment>
  4. <exportmacro></exportmacro>
  5. <class>TitleForm2</class>
  6. <widget class="QWidget" name="TitleForm2" >
  7. <property name="geometry" >
  8. <rect>
  9. <x>0</x>
  10. <y>0</y>
  11. <width>401</width>
  12. <height>302</height>
  13. </rect>
  14. </property>
  15. <property name="windowTitle" >
  16. <string>Form</string>
  17. </property>
  18. <widget class="QTabWidget" name="tabWidget" >
  19. <property name="geometry" >
  20. <rect>
  21. <x>40</x>
  22. <y>40</y>
  23. <width>301</width>
  24. <height>80</height>
  25. </rect>
  26. </property>
  27. <widget class="QWidget" name="tab" >
  28. <attribute name="title" >
  29. <string>Tab 1</string>
  30. </attribute>
  31. </widget>
  32. <widget class="QWidget" name="tab_2" >
  33. <attribute name="title" >
  34. <string>Tab 2</string>
  35. </attribute>
  36. </widget>
  37. </widget>
  38. <widget class="QPushButton" name="pbnOk" >
  39. <property name="geometry" >
  40. <rect>
  41. <x>250</x>
  42. <y>130</y>
  43. <width>87</width>
  44. <height>29</height>
  45. </rect>
  46. </property>
  47. <property name="text" >
  48. <string>More</string>
  49. </property>
  50. </widget>
  51. <widget class="QWidget" name="" >
  52. <property name="geometry" >
  53. <rect>
  54. <x>60</x>
  55. <y>180</y>
  56. <width>258</width>
  57. <height>101</height>
  58. </rect>
  59. </property>
  60. <layout class="QVBoxLayout" >
  61. <property name="margin" >
  62. <number>0</number>
  63. </property>
  64. <property name="spacing" >
  65. <number>6</number>
  66. </property>
  67. <item>
  68. <widget class="Line" name="line" >
  69. <property name="orientation" >
  70. <enum>Qt::Horizontal</enum>
  71. </property>
  72. </widget>
  73. </item>
  74. <item>
  75. <widget class="QTableWidget" name="tableWidget" />
  76. </item>
  77. </layout>
  78. </widget>
  79. </widget>
  80. <pixmapfunction></pixmapfunction>
  81. <resources/>
  82. <connections>
  83. <connection>
  84. <sender>pbnOk</sender>
  85. <signal>toggled(bool)</signal>
  86. <receiver>TitleForm2</receiver>
  87. <slot>setVisible(bool)</slot>
  88. <hints>
  89. <hint type="sourcelabel" >
  90. <x>275</x>
  91. <y>158</y>
  92. </hint>
  93. <hint type="destinationlabel" >
  94. <x>270</x>
  95. <y>178</y>
  96. </hint>
  97. </hints>
  98. </connection>
  99. </connections>
  100. </ui>
To copy to clipboard, switch view to plain text mode 

.h file

Qt Code:
  1. #include"ui_titleForm2.h"
  2. #include<QDialog>
  3.  
  4. class TF2 : public QDialog, public Ui::TitleForm2
  5. {Q_OBJECT
  6. public:
  7. TF2(QWidget *parent=0);
  8. public slots:
  9. void hide(bool);
  10. };
To copy to clipboard, switch view to plain text mode 

and .cpp file
Qt Code:
  1. #include "titleForm2.h"
  2. #include<QTableWidget>
  3. #include<iostream>
  4. TF2::TF2(QWidget *parent):QDialog(parent),TitleForm2()
  5. { setupUi(this);
  6. tableWidget->setVisible(false);
  7. connect(pbnOk,SIGNAL(toggled(bool)),tableWidget,SLOT(setVisible(bool)));
  8. connect(pbnOk,SIGNAL(toggled(bool)),this,SLOT(hide(bool)));
  9.  
  10. }
  11.  
  12. void TF2::hide(bool b)
  13. { //control not reaching here
  14. tableWidget->setVisible(b);
  15. std::cout<<" "<<b<<" |";
  16. }
To copy to clipboard, switch view to plain text mode 
i has debugged that my code is not reaching to respective commented line. I has connected this signal in designer also.

and main is

Qt Code:
  1. #include<QApplication>
  2. #include"titleForm2.h"
  3.  
  4. int main(int argc, char**argv)
  5. {
  6. QApplication a(argc,argv);
  7.  
  8. TF2 t;
  9. t.show();
  10.  
  11. return a.exec();
  12. }
To copy to clipboard, switch view to plain text mode 

In this i couldn't figure outt why this signal is not getting connected.

quickNitin