Results 1 to 3 of 3

Thread: Qt Designer & Qt4, connect to my own slot.

  1. #1
    Join Date
    Feb 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Qt Designer & Qt4, connect to my own slot.

    I'm having a problem connecting a user defined slot to my widgets created in Qt Designer.

    I followed the example in the online Qt3 book in the chapter 'rapid dialog design'. On p25 I noticed a difference between Qt Designer for Qt4 and Qt3. The Qt4 version doesn't have the code editor.

    I am having difficulties connecting a widget to a slot that doesn't appear in Qt Designer. Any suggestion for a nice way of doing this (except for not using Designer) ?
    It looked like it happened automatically in Qt3.
    This will effectively save two files: the user interface file gotocelldialog.ui, and the C++ source file gotocelldialog.ui.h . Make the application once more and run it again.
    one file generated by Qt and the other written in the code editor, integrated automatically the next time you ran (qmake and (?)) make, it seems.

    (Btw I just started looking at Qt today, but I have looked through a lot of doc's and not found anything about this. I probably just don't know where to begin...)

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Qt Designer & Qt4, connect to my own slot.

    Quote Originally Posted by geitosten View Post
    Any suggestion for a nice way of doing this (except for not using Designer) ?
    There is no way to do it within Designer. You can only use an automatic connection by naming the slot (in the implementation class) according to the on_objectname_signalname(signalparams) convention.

    Alternatively look here:
    http://www.qtcentre.org/forum/faq.ph...igner_category

    It looked like it happened automatically in Qt3.
    I don't think anything happened automatically in Qt3...

    one file generated by Qt and the other written in the code editor, integrated automatically the next time you ran (qmake and (?)) make, it seems.
    Ah, you mean the ".ui.h" approach... It's not used in Qt4 anymore as it was a terrible hack to avoid using real development environments. In Qt4 Designer is only a layout editor and default signal-slot connector. Everything else has to be done by your development environment.

    (Btw I just started looking at Qt today, but I have looked through a lot of doc's and not found anything about this. I probably just don't know where to begin...)
    You can start here:
    http://doc.trolltech.com/4.2/designe...component.html

  3. #3
    Join Date
    Feb 2007
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: Qt Designer & Qt4, connect to my own slot.

    Thank's for a quick reply. Now I can continue spending my day doing something useful

Similar Threads

  1. Replies: 13
    Last Post: 15th December 2006, 11:52
  2. custom slot + Designer
    By bashamehboob in forum Qt Tools
    Replies: 1
    Last Post: 28th April 2006, 15:17
  3. SLOT and QPushButton
    By mickey in forum Qt Programming
    Replies: 15
    Last Post: 15th February 2006, 06:46
  4. signal slot conection using a string, not a SLOT
    By rianquinn in forum Qt Programming
    Replies: 6
    Last Post: 5th February 2006, 18:52
  5. How to create custom slot in Qt Designer 4.1?
    By jamadagni in forum Qt Tools
    Replies: 31
    Last Post: 18th January 2006, 20:46

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.