Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QT Signals and Templates help!!

QT Signals and Templates help!!

Scheduled Pinned Locked Moved General and Desktop
4 Posts 4 Posters 3.8k Views
  • 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 Offline
    J Offline
    jrch2k10
    wrote on last edited by
    #1

    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
    0
    • A Offline
      A Offline
      anselmolsm
      wrote on last edited by
      #2

      @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
      0
      • G Offline
        G Offline
        guyd
        wrote on last edited by
        #3

        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
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          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
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved