Results 1 to 3 of 3

Thread: Integrating Qt3 Designer with code based application

  1. #1
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Integrating Qt3 Designer with code based application

    Hi all,

    Im trying to use Qt3 Designer to implement the .ui files only, and implement all signals / slots functionality etc in my subclasses so that i can port to Qt4 in the future.

    I have been able to implement all the subclass functionality successfully, although when i try to make a connection within my subclass from a simple button on a form to display "button press" within a terminal window i get the following error:

    error: no matching function for call to 'mainformsub::connect(QPushButton*&, const char [11], mainformsub* const, const char*)
    candidates are: static bool QObject:: connect(const QObject*, const char*, const QObject*, const char*)

    My connection string is as follows:
    QObject::connect( pushButton1, SIGNAL (clicked()), this, SLOT( newSlot());

    where newSlot is a function i have created in my subclass "mainformsub.cpp"

    and pushbutton1 is a button i placed on my form.

    Questions for the learned Qt Developers:

    1) My idea was to create the .ui files within Qt designer and then create all the connections and slots etc within the subclass so i minimise the linkage with Qt Designer. Is this methodology sound?

    2) The connection string i used (as above) is exactly the same as the auto generated connection string that is produce when running "uic -impl mainform.ui.h mainform.ui" and yet it does not compile when it is implemented within the subclass?

    3) I have implemented my connection string within an initialise() function that is called within my subclass constructor, is this generally an appropriate place for the connection string.

    ie mainformsub::mainformsub( xxx) : mainform
    {
    initialise()
    }

    void mainformsub::initialise()
    {
    QObject::connect( pushButton1, SIGNAL (clicked()), this, SLOT( newSlot());
    }

    Kind Regards

    nlev.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating Qt3 Designer with code based application

    Quote Originally Posted by nleverin View Post
    error: no matching function for call to 'mainformsub::connect(QPushButton*&, const char [11], mainformsub* const, const char*)
    candidates are: static bool QObject:: connect(const QObject*, const char*, const QObject*, const char*)
    It seems that the compiler doesn't know what a QPushButton is. Try adding #include <qpushbutton.h>.

  3. The following 2 users say thank you to jacek for this useful post:

    Nathan Leverington (27th June 2007), nleverin (27th June 2007)

  4. #3
    Join Date
    Jun 2007
    Posts
    21
    Thanks
    25
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Integrating Qt3 Designer with code based application

    Thanks mate, fixed the problems perfectly,

    cheers,

    nlev.

Similar Threads

  1. How to import an old application code ?
    By yellowmat in forum Qt Tools
    Replies: 6
    Last Post: 12th September 2006, 15:27
  2. problem with linking
    By mickey in forum Qt Programming
    Replies: 49
    Last Post: 12th August 2006, 21:41

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.