Results 1 to 6 of 6

Thread: not a class, namespace, or enumeration??

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2019
    Posts
    3
    Thanks
    3
    Qt products
    Qt3 Qt4 Qt5

    Question not a class, namespace, or enumeration??

    So I have a class defined in a header file like so...

    Qt Code:
    1. #ifndef TIMER_H
    2. #define TIMER_H
    3. #include <QObject>
    4. class Timer : public QObject
    5. {
    6. Q_OBJECT
    7. public slots:
    8. void StartTimer();
    9. signals:
    10. void TimeOut();
    11. };
    12. #endif // TIMER_H
    To copy to clipboard, switch view to plain text mode 


    and what my main function does is simply create an instance of the timer class and make a connect with a signal from
    a textedit object

    Below is the main function

    Qt Code:
    1. #include "window.h"
    2. #include <QApplication>
    3. #include "timer.h"
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. window w;
    8. Timer t;
    9. t::connect(w, SIGNAL(w::on_textEdit_textChanged()),t,SLOT(t::StartTimer()));
    10. w.show();
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 


    So can anyone explain why I get the error message "'t' is not a class, namespace or enumeration"?
    Last edited by anda_skoa; 26th February 2019 at 07:23. Reason: changed [qtclass] to [code]

Similar Threads

  1. Access QML enumeration from C++
    By sedi in forum Qt Quick
    Replies: 3
    Last Post: 15th April 2016, 10:29
  2. How to use slots in the namespace class
    By gunturrohith in forum Newbie
    Replies: 6
    Last Post: 7th December 2015, 19:20
  3. How to avoid "class namespace" repetition?
    By arcull in forum General Programming
    Replies: 13
    Last Post: 3rd July 2015, 07:07
  4. Replies: 0
    Last Post: 3rd July 2014, 16:48
  5. Replies: 1
    Last Post: 13th September 2006, 12:14

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.