我正在尝试制作一些自定义插槽,但它抱怨自定义插槽不存在。
我用谷歌搜索,但找不到任何类似情况的东西。没有解决方案对我有用。
QObject::connect: No such slot QSlider::setMinimum(int)
墨水木偶.cpp
#include "inkpuppet.h"
#include "ui_inkpuppet.h"
#include "aboutdialog.h"
#include <QDialog>
#include <QWidget>
#include <QtCore>
#include <QtGui>
#include <QButtonGroup>
#include <QSlider>
InkPuppet::InkPuppet(QWidget *parent) :
QWidget(parent),
ui(new Ui::InkPuppet)
{
ui->setupUi(this);
connect(ui->lowerFrameBox, SIGNAL(valueChanged(int)), ui->timeSlider, SLOT(setMinimum(int)));
connect(ui->upperFrameBox, SIGNAL(valueChanged(int)), ui->timeSlider, SLOT(setMaximum(int)));
//connect(ui->lowerFrameBox, SIGNAL(valueChanged(int)), ui->timeSlider, SLOT(setRange(int,int)));
}
InkPuppet::~InkPuppet()
{
delete ui;
}
void InkPuppet::on_aboutButton_clicked()
{
}
void InkPuppet::setMinimum(int value)
{
ui->timeSlider->setMinimum(value);
}
void InkPuppet::setMaximum(int value)
{
ui->timeSlider->setMaximum(value);
}
墨水木偶.h
#ifndef WIDGET_H
#define WIDGET_H
#include <QWidget>
#include <QtCore>
#include <QtGui>
#include "aboutdialog.h"
namespace Ui {
class InkPuppet;
}
class InkPuppet : public QWidget
{
Q_OBJECT
public:
explicit InkPuppet(QWidget *parent = 0);
~InkPuppet();
public slots:
void on_aboutButton_clicked();
void setMinimum(int value);
void setMaximum(int value);
private:
Ui::InkPuppet *ui;
AboutDialog *aDialog;
};
#endif // WIDGET_H