Results 1 to 3 of 3

Thread: no matching function for call to setupUi

  1. #1
    Join Date
    Jan 2010
    Posts
    23
    Qt products
    Qt4
    Platforms
    Windows

    Default no matching function for call to setupUi

    Hi everyone,

    My app keeps giving me this error (at line 6 of sortdialog.cpp):

    Qt Code:
    1. Sort/sortdialog.cpp:6: error: no matching function for call to `SortDialog::setupUi(SortDialog* const)'
    To copy to clipboard, switch view to plain text mode 

    I'm not sure why though - my files are
    • main.cpp
    • sortdialog.h
    • sortdialog.cpp
    • sortdialog.ui


    Here is the accompanying code:

    main.cpp
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include "sortdialog.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7. SortDialog *dialog = new SortDialog;
    8. dialog->setColumnRange('C', 'F') ;
    9. dialog->show();
    10. return a.exec();
    11. }
    To copy to clipboard, switch view to plain text mode 

    sortdialog.h
    Qt Code:
    1. #ifndef SORTDIALOG_H
    2. #define SORTDIALOG_H
    3.  
    4. #include <QDialog>
    5. #include "ui_sortdialog.h"
    6.  
    7. class SortDialog : public QDialog, public Ui::SortDialog
    8. {
    9. Q_OBJECT
    10. public:
    11. SortDialog(QWidget *parent = 0) ;
    12. void setColumnRange(QChar first, QChar last) ;
    13. };
    14.  
    15. #endif // SORTDIALOG_H
    To copy to clipboard, switch view to plain text mode 

    sortdialog.cpp
    Qt Code:
    1. #include <QtGui>
    2. #include "sortdialog.h"
    3.  
    4. SortDialog::SortDialog(QWidget *parent) : QDialog(parent)
    5. {
    6. setupUi(this) ;
    7.  
    8. secondaryGroupBox->hide();
    9. tertiaryGroupBox->hide();
    10. layout()->setSizeConstraint(QLayout::SetFixedSize) ;
    11.  
    12. setColumnRange('A', 'Z') ;
    13. }
    14.  
    15. void SortDialog::setColumnRange(QChar first, QChar last)
    16. {
    17. primaryColumnCombo->clear();
    18. secondaryColumnCombo->clear();
    19. tertiaryColumnCombo->clear();
    20.  
    21. secondaryColumnCombo->addItem(tr("None"));
    22. tertiaryColumnCombo->addItem(tr("None"));
    23. primaryColumnCombo->setMinimumSize(secondaryColumnCombo->sizeHint());
    24.  
    25. QChar ch = first ;
    26. while (ch <= last)
    27. {
    28. primaryColumnCombo->addItem(QString(ch));
    29. secondaryColumnCombo->addItem(QString(ch));
    30. tertiaryColumnCombo->addItem(QString(ch));
    31. ch = ch.unicode() + 1 ;
    32. }
    33. }
    To copy to clipboard, switch view to plain text mode 


    Any help would be greatly appreciated! Thanks

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

    Default Re: no matching function for call to setupUi

    Do you get a "candidates are..." line from the compiler as well? Also what is the base class for your Designer form?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,499
    Thanked 277 Times in 272 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: no matching function for call to setupUi

    Can You show sortdialog.ui file ? Without them this is uncompilable.

Similar Threads

  1. no matching function error
    By arpspatel in forum Qt Programming
    Replies: 4
    Last Post: 16th October 2009, 15:47
  2. Replies: 7
    Last Post: 16th August 2009, 09:03
  3. No Matching function to call...
    By weepdoo in forum Qt Programming
    Replies: 2
    Last Post: 7th November 2008, 17:30
  4. function call
    By Walsi in forum Qt Programming
    Replies: 3
    Last Post: 12th June 2007, 09:13
  5. Cannot call function without object
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 11th June 2007, 14:55

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.