PDA

View Full Version : no matching function for call to setupUi



ctote
29th January 2010, 18:45
Hi everyone,

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


Sort/sortdialog.cpp:6: error: no matching function for call to `SortDialog::setupUi(SortDialog* const)'

I'm not sure why though - my files are

main.cpp
sortdialog.h
sortdialog.cpp
sortdialog.ui


Here is the accompanying code:

main.cpp

#include <QtGui/QApplication>
#include "sortdialog.h"

int main(int argc, char *argv[])
{
QApplication a(argc, argv);
SortDialog *dialog = new SortDialog;
dialog->setColumnRange('C', 'F') ;
dialog->show();
return a.exec();
}


sortdialog.h

#ifndef SORTDIALOG_H
#define SORTDIALOG_H

#include <QDialog>
#include "ui_sortdialog.h"

class SortDialog : public QDialog, public Ui::SortDialog
{
Q_OBJECT
public:
SortDialog(QWidget *parent = 0) ;
void setColumnRange(QChar first, QChar last) ;
};

#endif // SORTDIALOG_H


sortdialog.cpp

#include <QtGui>
#include "sortdialog.h"

SortDialog::SortDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this) ;

secondaryGroupBox->hide();
tertiaryGroupBox->hide();
layout()->setSizeConstraint(QLayout::SetFixedSize) ;

setColumnRange('A', 'Z') ;
}

void SortDialog::setColumnRange(QChar first, QChar last)
{
primaryColumnCombo->clear();
secondaryColumnCombo->clear();
tertiaryColumnCombo->clear();

secondaryColumnCombo->addItem(tr("None"));
tertiaryColumnCombo->addItem(tr("None"));
primaryColumnCombo->setMinimumSize(secondaryColumnCombo->sizeHint());

QChar ch = first ;
while (ch <= last)
{
primaryColumnCombo->addItem(QString(ch));
secondaryColumnCombo->addItem(QString(ch));
tertiaryColumnCombo->addItem(QString(ch));
ch = ch.unicode() + 1 ;
}
}



Any help would be greatly appreciated! Thanks

wysota
30th January 2010, 10:30
Do you get a "candidates are..." line from the compiler as well? Also what is the base class for your Designer form?

Lesiok
30th January 2010, 15:20
Can You show sortdialog.ui file ? Without them this is uncompilable.