Results 1 to 10 of 10

Thread: No Such Slot

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Nov 2012
    Posts
    5
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: No Such Slot

    Appear to be on lines 48 and 62
    moc_MainMenu.cpp;
    Qt Code:
    1. /****************************************************************************
    2. ** Meta object code from reading C++ file 'MainMenu.h'
    3. **
    4. ** Created: Tue 13. Nov 20:29:46 2012
    5. ** by: The Qt Meta Object Compiler version 63 (Qt 4.8.3)
    6. **
    7. ** WARNING! All changes made in this file will be lost!
    8. *****************************************************************************/
    9.  
    10. #include "MainMenu.h"
    11. #if !defined(Q_MOC_OUTPUT_REVISION)
    12. #error "The header file 'MainMenu.h' doesn't include <QObject>."
    13. #elif Q_MOC_OUTPUT_REVISION != 63
    14. #error "This file was generated using the moc from 4.8.3. It"
    15. #error "cannot be used with the include files from this version of Qt."
    16. #error "(The moc has changed too much.)"
    17. #endif
    18.  
    19. QT_BEGIN_MOC_NAMESPACE
    20. static const uint qt_meta_data_MainMenu[] = {
    21.  
    22. // content:
    23. 6, // revision
    24. 0, // classname
    25. 0, 0, // classinfo
    26. 6, 14, // methods
    27. 0, 0, // properties
    28. 0, 0, // enums/sets
    29. 0, 0, // constructors
    30. 0, // flags
    31. 0, // signalCount
    32.  
    33. // slots: signature, parameters, type, tag, flags
    34. 10, 9, 9, 9, 0x0a,
    35. 29, 9, 9, 9, 0x0a,
    36. 51, 9, 9, 9, 0x0a,
    37. 68, 9, 9, 9, 0x0a,
    38. 86, 9, 9, 9, 0x0a,
    39. 103, 9, 9, 9, 0x0a,
    40.  
    41. 0 // eod
    42. };
    43.  
    44. static const char qt_meta_stringdata_MainMenu[] = {
    45. "MainMenu\0\0runButtonClicked()\0"
    46. "browseButtonClicked()\0arRadioToggled()\0"
    47. "p2iRadioToggled()\0vfRadioToggled()\0"
    48. "menuBarTriggered(QAction*)\0"
    49. };
    50.  
    51. void MainMenu::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
    52. {
    53. if (_c == QMetaObject::InvokeMetaMethod) {
    54. Q_ASSERT(staticMetaObject.cast(_o));
    55. MainMenu *_t = static_cast<MainMenu *>(_o);
    56. switch (_id) {
    57. case 0: _t->runButtonClicked(); break;
    58. case 1: _t->browseButtonClicked(); break;
    59. case 2: _t->arRadioToggled(); break;
    60. case 3: _t->p2iRadioToggled(); break;
    61. case 4: _t->vfRadioToggled(); break;
    62. case 5: _t->menuBarTriggered((*reinterpret_cast< QAction*(*)>(_a[1]))); break;
    63. default: ;
    64. }
    65. }
    66. }
    67.  
    68. const QMetaObjectExtraData MainMenu::staticMetaObjectExtraData = {
    69. 0, qt_static_metacall
    70. };
    71.  
    72. const QMetaObject MainMenu::staticMetaObject = {
    73. { &QMainWindow::staticMetaObject, qt_meta_stringdata_MainMenu,
    74. qt_meta_data_MainMenu, &staticMetaObjectExtraData }
    75. };
    76.  
    77. #ifdef Q_NO_DATA_RELOCATION
    78. const QMetaObject &MainMenu::getStaticMetaObject() { return staticMetaObject; }
    79. #endif //Q_NO_DATA_RELOCATION
    80.  
    81. const QMetaObject *MainMenu::metaObject() const
    82. {
    83. return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject;
    84. }
    85.  
    86. void *MainMenu::qt_metacast(const char *_clname)
    87. {
    88. if (!_clname) return 0;
    89. if (!strcmp(_clname, qt_meta_stringdata_MainMenu))
    90. return static_cast<void*>(const_cast< MainMenu*>(this));
    91. return QMainWindow::qt_metacast(_clname);
    92. }
    93.  
    94. int MainMenu::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
    95. {
    96. _id = QMainWindow::qt_metacall(_c, _id, _a);
    97. if (_id < 0)
    98. return _id;
    99. if (_c == QMetaObject::InvokeMetaMethod) {
    100. if (_id < 6)
    101. qt_static_metacall(this, _c, _id, _a);
    102. _id -= 6;
    103. }
    104. return _id;
    105. }
    106. QT_END_MOC_NAMESPACE
    To copy to clipboard, switch view to plain text mode 

    Also, look at the error message - that slot DOES NOT exist on QMainWindow. It is (supposedly) on YOUR *MainMenu* class
    Should I perhaps try changing the MainMenu::<slot> thngies from MainMenu.cpp to QMainWindow? Although MainMenu is an instace of QMainWindow afaik
    Last edited by Geoffry31; 13th November 2012 at 21:24.

Similar Threads

  1. Replies: 8
    Last Post: 7th November 2012, 14:10
  2. Replies: 2
    Last Post: 26th August 2011, 08:51
  3. no such slot
    By JeanC in forum Qt Programming
    Replies: 4
    Last Post: 26th January 2008, 11:39
  4. Slot
    By mickey in forum Qt Programming
    Replies: 1
    Last Post: 22nd July 2006, 18:51
  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.