Results 1 to 3 of 3

Thread: Inline slots?

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Inline slots?

    Is there a problem in creating a inline slot (and using it in connection with a signal)?

    Qt Code:
    1. //.hpp
    2.  
    3. //...
    4.  
    5. signals:
    6. void signalDoSomething();
    7.  
    8. public slots:
    9. inline void slotDoSomething()
    10. {
    11. //Do something
    12. }
    13.  
    14. //...
    15.  
    16.  
    17. //.cpp
    18.  
    19. //...
    20.  
    21. connect(this,SIGNAL(signalDoSomething()),this,SLOT(slotDoSomething()));
    To copy to clipboard, switch view to plain text mode 


    Thanks,

    Momergil
    May the Lord be with you. Always.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Inline slots?

    Why don't you just try?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Inline slots?

    Quote Originally Posted by high_flyer View Post
    Why don't you just try?
    Because not all problems are evident by just writing the code and compiling
    May the Lord be with you. Always.

Similar Threads

  1. how to convert inline asm from VC++ to gcc ( Qt creator )
    By Thành Viên Mới in forum Qt Programming
    Replies: 4
    Last Post: 14th May 2011, 18:43
  2. QT + mingw and 'inline' functions?
    By tonnot in forum Newbie
    Replies: 6
    Last Post: 25th February 2011, 10:43
  3. How to start a thread (inline)
    By DiamonDogX in forum Qt Programming
    Replies: 4
    Last Post: 28th May 2009, 21:53
  4. inline function in qdatetime.h
    By jamadagni in forum Newbie
    Replies: 1
    Last Post: 17th March 2007, 09:28

Tags for this Thread

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.