• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kopete/kopete

  • sources
  • kde-4.14
  • kdenetwork
  • kopete
  • kopete
  • config
  • avdevice
IdGuiElements.cpp
Go to the documentation of this file.
1 /*
2  IdGuiElements.cpp - Modified GUI-elements which send a selectable ID with their signals
3 
4  Copyright (c) 2010 by Frank Schaefer <fschaefer.oss@googlemail.com>
5 
6  Kopete (c) 2010 by the Kopete developers <kopete-devel@kde.org>
7 
8  *************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  *************************************************************************
16  */
17 #include "IdGuiElements.h"
18 
19 
20 
21 IdPushButton::IdPushButton(unsigned int id, QWidget * parent) : KPushButton(parent)
22 {
23  _id = id;
24  connect(this, SIGNAL(pressed()), this, SLOT(emitPressed()));
25 }
26 
27 IdPushButton::IdPushButton(unsigned int id, const QString text, QWidget * parent) : KPushButton(text, parent)
28 {
29  _id = id;
30  connect(this, SIGNAL(pressed()), this, SLOT(emitPressed()));
31 }
32 
33 IdPushButton::IdPushButton(unsigned int id, const KIcon icon, const QString text, QWidget * parent) : KPushButton(icon, text, parent)
34 {
35  _id = id;
36  connect(this, SIGNAL(pressed()), this, SLOT(emitPressed()));
37 }
38 
39 IdPushButton::IdPushButton(unsigned int id, KGuiItem item, QWidget * parent) : KPushButton(item, parent)
40 {
41  _id = id;
42  connect(this, SIGNAL(pressed()), this, SLOT(emitPressed()));
43 }
44 
45 void IdPushButton::emitPressed()
46 {
47  emit pressed(_id);
48 }
49 
50 
51 
52 IdComboBox::IdComboBox(unsigned int id, QWidget * parent) : KComboBox(parent)
53 {
54  _id = id;
55  connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(emitCurrentIndexChanged(int)));
56 }
57 
58 IdComboBox::IdComboBox(unsigned int id, bool rw, QWidget * parent) : KComboBox(rw, parent)
59 {
60  _id = id;
61  connect(this, SIGNAL(currentIndexChanged(int)), this, SLOT(emitCurrentIndexChanged(int)));
62 }
63 
64 void IdComboBox::emitCurrentIndexChanged(int index)
65 {
66  emit currentIndexChanged(_id, index);
67 }
68 
69 
70 
71 IdCheckBox::IdCheckBox(unsigned int id, QWidget * parent) : QCheckBox(parent)
72 {
73  _id = id;
74  connect(this, SIGNAL(stateChanged(int)), this, SLOT(emitStateChanged(int)));
75 }
76 
77 IdCheckBox::IdCheckBox(unsigned int id, const QString & text, QWidget * parent) : QCheckBox(text, parent)
78 {
79  _id = id;
80  connect(this, SIGNAL(stateChanged(int)), this, SLOT(emitStateChanged(int)));
81 }
82 
83 void IdCheckBox::emitStateChanged(int state)
84 {
85  if (state > 1) state = 1; // NOTE: Problem: state = Qt::Unchecked = 0 or Qt::Checked = 2;
86  emit stateChanged(_id, state);
87 }
88 
89 
90 
91 IdSlider::IdSlider(unsigned int id, QWidget * parent) : QSlider(parent)
92 {
93  _id = id;
94  connect(this, SIGNAL(valueChanged(int)), this, SLOT(emitValueChanged(int)));
95 
96 }
97 
98 IdSlider::IdSlider(unsigned int id, Qt::Orientation orientation, QWidget * parent) : QSlider(orientation, parent)
99 {
100  _id = id;
101  connect(this, SIGNAL(valueChanged(int)), this, SLOT(emitValueChanged(int)));
102 }
103 
104 void IdSlider::emitValueChanged(int value)
105 {
106  emit valueChanged(_id, value);
107 }
108 
IdCheckBox::stateChanged
void stateChanged(unsigned int id, int state)
KPushButton
QWidget
IdSlider::valueChanged
void valueChanged(unsigned int id, int value)
QSlider
IdPushButton::IdPushButton
IdPushButton(unsigned int id, QWidget *parent=0)
Definition: IdGuiElements.cpp:21
QCheckBox
IdCheckBox::IdCheckBox
IdCheckBox(unsigned int id, QWidget *parent=0)
Definition: IdGuiElements.cpp:71
IdGuiElements.h
QString
IdSlider::IdSlider
IdSlider(unsigned int id, QWidget *parent=0)
Definition: IdGuiElements.cpp:91
IdComboBox::currentIndexChanged
void currentIndexChanged(unsigned int id, int index)
IdPushButton::pressed
void pressed(unsigned int id)
KComboBox
IdComboBox::IdComboBox
IdComboBox(unsigned int id, QWidget *parent=0)
Definition: IdGuiElements.cpp:52
QObject::connect
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:29:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kopete/kopete

Skip menu "kopete/kopete"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal