Qt Forum

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

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    QT Signals and Templates help!!

    General and Desktop
    4
    4
    3613
    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.
    • J
      jrch2k10 last edited by

      hi, guyz im trying to create a library with a set of parallel SSE x.x optimized functions for some heavy loops, since i wanna make the library very integrated to QT, containers + signals and slots are important to me here.

      the ovbious case here is that all my function inside that class are nested templates using QVector/QList/QLinkedList. for example
      @
      class my_example_class : public QObject
      Q_OBJECT
      public:

      template <class T>
      QVector<T> *myheavyloopfunction(QVector<T> &MyObject, + some other object for control){
      heavy loop ....
      }

      template <class T>
      QList<T> *myheavyloopfunction(QList<T> &MyObject, + some other object for control){
      heavy loop ....
      }

      signals:
      void myheaveloopfunctionSIGNAL(??); this is my issue

      public slot:
      void myheaveloopfunctionSLOT(??); here too
      @

      since im working with sse and prefecth in other parts of the code i want to provide aligned types with the library instead of using standard types to make sure the data is properly aligned to 16 bits or else my prefectch can go havoc with cache misses. for example
      @
      typedef float a_float32 attribute((aligned(16));
      @
      and the same with ints and uints ofc and other type of data with aligment, so templates and overload allow me to avoid the tedious job of writing N functions for every type.


      i would like the idea of passing a container with a template directly in the slots and signals to avoid the user of the library to link a signal for every possible type of data that can fill those containers, especially since my types are usable by QT without casting or much casting so far(need more test), so they just bother in process the result container like you normally do in QT containers

      so is this currently possible??

      im a newbie in qt4, maybe is just me paying the noobness

      thx in advance

      rafael castillo

      note the "" is because the forum eat my < T >

      [edit: syntax highlighting / Denis Kormalev]

      1 Reply Last reply Reply Quote 0
      • A
        anselmolsm last edited by

        @jrch2k10, edit your post and use the code markup, so it's better to read and you don't need to deal with < or > ;)

        Anselmo L. S. Melo (anselmolsm)

        1 Reply Last reply Reply Quote 0
        • G
          guyd last edited by

          HI, Is there a solution for this problem? I'm facing something similar and I could use your help on this. Maybe you could point me towards a good manual for combining Qt4 or Qt5 with templates, specifically templated signals and slots.

          Thanks in advance,
          Guy

          1 Reply Last reply Reply Quote 0
          • JKSH
            JKSH Moderators last edited by

            Hi,

            Unfortunately it is currently impossible to create templated QObjects, so you can't create templated signals and slots.

            Qt's engineers are investigating this feature (see http://lists.qt-project.org/pipermail/development/2013-March/010442.html ), but nothing conclusive has come of it yet.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

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