File: qspinbox_hook.h

package info (click to toggle)
libqtpas 2.6%2B2.0.8%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 5,860 kB
  • sloc: cpp: 56,595; pascal: 13,727; sh: 44; makefile: 18
file content (111 lines) | stat: -rw-r--r-- 4,002 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//******************************************************************************
//  Copyright (c) 2005-2013 by Jan Van hijfte
//
//  See the included file COPYING.TXT for details about the copyright.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//******************************************************************************


#ifndef QSPINBOX_HOOK_H
#define QSPINBOX_HOOK_H

#include <qspinbox.h>

#include "qabstractspinbox_hook.h"

class QSpinBox_hook : public QAbstractSpinBox_hook {
  Q_OBJECT
  public:
    QSpinBox_hook(QObject *handle) : QAbstractSpinBox_hook(handle) {
      valueChanged_event.func = NULL;
      valueChanged2_event.func = NULL;
    }
    void hook_valueChanged(QHook &hook) { 
      if ( !valueChanged_event.func )
        connect(handle, SIGNAL(valueChanged(int)), this, SLOT(valueChanged_hook(int)));
      valueChanged_event = hook;
      if ( !hook.func )
        disconnect(handle, SIGNAL(valueChanged(int)), this, SLOT(valueChanged_hook(int)));
    }
    void hook_valueChanged2(QHook &hook) { 
      if ( !valueChanged2_event.func )
        connect(handle, SIGNAL(valueChanged(const QString&)), this, SLOT(valueChanged2_hook(const QString&)));
      valueChanged2_event = hook;
      if ( !hook.func )
        disconnect(handle, SIGNAL(valueChanged(const QString&)), this, SLOT(valueChanged2_hook(const QString&)));
    }

  private slots:
    void valueChanged_hook(int AnonParam1) {
      if ( valueChanged_event.func ) {
        typedef void (*func_type)(void *data, int AnonParam1);
	(*(func_type)valueChanged_event.func)(valueChanged_event.data, AnonParam1);
      }
    }
    void valueChanged2_hook(const QString& AnonParam1) {
      if ( valueChanged2_event.func ) {
        typedef void (*func_type)(void *data, PWideString AnonParam1);
	PWideString t_AnonParam1;
	initializePWideString(t_AnonParam1);
	copyQStringToPWideString(AnonParam1, t_AnonParam1);
	(*(func_type)valueChanged2_event.func)(valueChanged2_event.data, t_AnonParam1);
	finalizePWideString(t_AnonParam1);
      }
    }
  private:
    QHook valueChanged_event;
    QHook valueChanged2_event;
};


#include "qabstractspinbox_hook.h"

class QDoubleSpinBox_hook : public QAbstractSpinBox_hook {
  Q_OBJECT
  public:
    QDoubleSpinBox_hook(QObject *handle) : QAbstractSpinBox_hook(handle) {
      valueChanged_event.func = NULL;
      valueChanged2_event.func = NULL;
    }
    void hook_valueChanged(QHook &hook) { 
      if ( !valueChanged_event.func )
        connect(handle, SIGNAL(valueChanged(double)), this, SLOT(valueChanged_hook(double)));
      valueChanged_event = hook;
      if ( !hook.func )
        disconnect(handle, SIGNAL(valueChanged(double)), this, SLOT(valueChanged_hook(double)));
    }
    void hook_valueChanged2(QHook &hook) { 
      if ( !valueChanged2_event.func )
        connect(handle, SIGNAL(valueChanged(const QString&)), this, SLOT(valueChanged2_hook(const QString&)));
      valueChanged2_event = hook;
      if ( !hook.func )
        disconnect(handle, SIGNAL(valueChanged(const QString&)), this, SLOT(valueChanged2_hook(const QString&)));
    }

  private slots:
    void valueChanged_hook(double AnonParam1) {
      if ( valueChanged_event.func ) {
        typedef void (*func_type)(void *data, double AnonParam1);
	(*(func_type)valueChanged_event.func)(valueChanged_event.data, AnonParam1);
      }
    }
    void valueChanged2_hook(const QString& AnonParam1) {
      if ( valueChanged2_event.func ) {
        typedef void (*func_type)(void *data, PWideString AnonParam1);
	PWideString t_AnonParam1;
	initializePWideString(t_AnonParam1);
	copyQStringToPWideString(AnonParam1, t_AnonParam1);
	(*(func_type)valueChanged2_event.func)(valueChanged2_event.data, t_AnonParam1);
	finalizePWideString(t_AnonParam1);
      }
    }
  private:
    QHook valueChanged_event;
    QHook valueChanged2_event;
};


#endif