Ok so when I run this (wrote it up just to display the problem) :
#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QtGUI>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QWidget *window = new QWidget;
QPushButton *MainInter = new QPushButton("Push me!",window);
QObject::connect(MainInter,SIGNAL(released()),MainInter,SLOT(move(100,100)));
window->resize(900,500);
window->show();
return a.exec();
}
Why doesn’t the button move when clicked? 🙂
moveis not a slot, but an accessor to change theposproperty, it can’t be connected directly to a signal. But you can connect the signal to thestart()slot ofQPropertyAnimationwhich will change that property:or make that property value part of a state of a
QStateMachineand use the signal to transition to that state: