qt:wiring_up_signals_and_slots
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
qt:wiring_up_signals_and_slots [2011/03/31 12:54] – mithat | qt:wiring_up_signals_and_slots [2011/03/31 15:02] – mithat | ||
---|---|---|---|
Line 3: | Line 3: | ||
===== Creating signal→slot connections ===== | ===== Creating signal→slot connections ===== | ||
Qt uses a signals and slots system to process events. If you use Qt Creator for development, | Qt uses a signals and slots system to process events. If you use Qt Creator for development, | ||
- | * Create an "event handler" | + | * [[#Create an "event handler" |
* Do it " | * Do it " | ||
* Do it in the *.ui file | * Do it in the *.ui file | ||
* Do it in the constructor | * Do it in the constructor | ||
- | If you use Qt Designer with some other IDE for development, | + | If you use Qt Designer with some other IDE for development, |
==== Create an "event handler" | ==== Create an "event handler" | ||
Line 29: | Line 29: | ||
=== Behind the scenes === | === Behind the scenes === | ||
How does the build system know that that '' | How does the build system know that that '' | ||
+ | == Question == | ||
+ | If the above is true, then it should be possible to create event handlers just by writing code. Two tests are indicated: | ||
+ | * Write the handlers manually in Qt Creator. | ||
+ | * Write the handlers manually in a project managed by something other than Qt Creator. | ||
==== Do it " | ==== Do it " | ||
Line 89: | Line 93: | ||
// | // | ||
- | If your project uses '' | + | If your project uses '' |
- | + | <code xml> | |
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
==== Do it in the constructor ==== | ==== Do it in the constructor ==== | ||
// | // | ||
Line 101: | Line 114: | ||
widget.setupUi(this); | widget.setupUi(this); | ||
- | connect(widget.button_quit, | + | connect(widget.button_quit, |
- | | + | |
}</ | }</ | ||
===== Runtime signal→slot connection modifications ===== | ===== Runtime signal→slot connection modifications ===== | ||
I don't know. But it should be possible. | I don't know. But it should be possible. |
qt/wiring_up_signals_and_slots.txt · Last modified: 2011/04/03 13:14 by mithat