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)'
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
#include <QtGui/QApplication>
#include "sortdialog.h"
int main(int argc, char *argv[])
{
SortDialog *dialog = new SortDialog;
dialog->setColumnRange('C', 'F') ;
dialog->show();
return a.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
sortdialog.h
#ifndef SORTDIALOG_H
#define SORTDIALOG_H
#include <QDialog>
#include "ui_sortdialog.h"
class SortDialog
: public QDialog,
public Ui
::SortDialog{
Q_OBJECT
public:
};
#endif // 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
To copy to clipboard, switch view to plain text mode
sortdialog.cpp
#include <QtGui>
#include "sortdialog.h"
{
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());
while (ch <= last)
{
primaryColumnCombo
->addItem
(QString(ch
));
secondaryColumnCombo
->addItem
(QString(ch
));
tertiaryColumnCombo
->addItem
(QString(ch
));
ch = ch.unicode() + 1 ;
}
}
#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 ;
}
}
To copy to clipboard, switch view to plain text mode
Any help would be greatly appreciated! Thanks
Bookmarks