|
|
|
QT4 узнать в вызванно методе кто его вызвал
|
|||
|---|---|---|---|
|
#18+
Както странно после .Net работать с QT4.3.3 скажу я вам. Все по другому есть метод pushBtn_clicked(), его вешаем на нажатие кнопок http://]QtCore.QObject.connect(self.pushButton,QtCore.SIGNAL("clicked()"),self.pushBtn_clicked) QtCore.QObject.connect(self.pushButton2,QtCore.SIGNAL("clicked()"),self.pushBtn_clicked) как узнать в pushBtn_clicked() какая кнопка его вызвала? в дотнете сендер передается в событиях и проблем нет, а тут я в замешательстве. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2008, 16:49 |
|
||
|
QT4 узнать в вызванно методе кто его вызвал
|
|||
|---|---|---|---|
|
#18+
сорри не тот тег Код: plaintext 1. 2. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2008, 16:50 |
|
||
|
QT4 узнать в вызванно методе кто его вызвал
|
|||
|---|---|---|---|
|
#18+
QObject * QObject::sender () const [protected] Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. The pointer is valid only during the execution of the slot that calls this function. The pointer returned by this function becomes invalid if the sender is destroyed, or if the slot is disconnected from the sender's signal. Warning: This function violates the object-oriented principle of modularity. However, getting access to the sender might be useful when many signals are connected to a single slot. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 20.06.2008, 17:29 |
|
||
|
|

start [/forum/topic.php?fid=16&msg=35385766&tid=1345217]: |
0ms |
get settings: |
5ms |
get forum list: |
13ms |
check forum access: |
2ms |
check topic access: |
2ms |
track hit: |
154ms |
get topic data: |
7ms |
get forum data: |
3ms |
get page messages: |
26ms |
get tp. blocked users: |
1ms |
| others: | 238ms |
| total: | 451ms |

| 0 / 0 |
