lorin
8th January 2011, 19:00
How can i return any value when i will click to button. It is possible to use QObject::connect(&get, SIGNAL(clicked()), &give, SLOT(return value)?
int main(int argc, char *argv[]) {
int a = 10;
QApplication app(int argc, char *argv[]);
QWidget wid1;
wid1.resize(100, 100);
QWidget wid2;
wid2.resize(100,100);
QPushButton but1("Text", &wid1);
but1.geometry(0,0,100,100);
QObject::connect(&but1, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
QPushButton but2("Text", &wid2);
but2.geometry(0.0.100.100);
QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
}
(ignore the code errors... i want only know, if i can použÃ*t QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(return a = 50;));
int main(int argc, char *argv[]) {
int a = 10;
QApplication app(int argc, char *argv[]);
QWidget wid1;
wid1.resize(100, 100);
QWidget wid2;
wid2.resize(100,100);
QPushButton but1("Text", &wid1);
but1.geometry(0,0,100,100);
QObject::connect(&but1, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
QPushButton but2("Text", &wid2);
but2.geometry(0.0.100.100);
QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(>>return value<<));
}
(ignore the code errors... i want only know, if i can použÃ*t QObject::connect(&but2, SIGNAL(clicked()), &wid1, SLOT(return a = 50;));