Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [SOLVED] How to connect QFileSystemWatcher Signals to SLOTS in derived QApplication

    General and Desktop
    2
    3
    1541
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • jensen82
      jensen82 last edited by

      Hi!

      As the title might say...is it possible to connect the QFileSysWatcher-SIGNALS to SLOT in a derived QApplication?

      @QObject::connect(FileWatcher, SIGNAL(fileChanged(QString)), this, SLOT(fileChangedSlot(QString)));@
      this is MyApplication, derived from QApplication. I always get the message that the SIGNALS and SLOTS could not connect. But why? Is it not possible?

      Thank you an have a nice weekend!

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        Do you have the Q_OBJECT keyword in your derived QApplication ?
        Did you declare and implement the slot ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • jensen82
          jensen82 last edited by

          Thank you! That's the problem. I've added Q_OBJECT in the header file before public, private.

          You helped me out. Stupid failure...i do not work with Qt since a time...

          1 Reply Last reply Reply Quote 0
          • First post
            Last post