KVIrc 5.2.4
Developer APIs
KviTalGroupBox.h
Go to the documentation of this file.
1#ifndef _KVI_TAL_GROUPBOX_H_
2#define _KVI_TAL_GROUPBOX_H_
3//=============================================================================
4//
5// File : KviTalGroupBox.h
6// Creation date : Mon Jan 22 2007 11:25:08 by Szymon Stefanek
7//
8// This file is part of the KVIrc IRC client distribution
9// Copyright (C) 2007-2010 Szymon Stefanek (pragma at kvirc dot net)
10//
11// This program is FREE software. You can redistribute it and/or
12// modify it under the terms of the GNU General Public License
13// as published by the Free Software Foundation; either version 2
14// of the License, or (at your option) any later version.
15//
16// This program is distributed in the HOPE that it will be USEFUL,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19// See the GNU General Public License for more details.
20//
21// You should have received a copy of the GNU General Public License
22// along with this program. If not, write to the Free Software Foundation,
23// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24//
25//=============================================================================
26
33#include "kvi_settings.h"
34
35#include <QGroupBox>
36#include <QLayout>
37
38class QChildEvent;
39
44class KVILIB_API KviTalGroupBox : public QGroupBox
45{
46 Q_OBJECT
47public:
54 KviTalGroupBox(QWidget * pParent, char * pcName = nullptr);
55
61 KviTalGroupBox(QWidget * pParent = nullptr);
62
69 KviTalGroupBox(const QString & szTitle, QWidget * pParent = nullptr);
70
77 KviTalGroupBox(Qt::Orientation orientation, QWidget * pParent = nullptr);
78
86 KviTalGroupBox(Qt::Orientation orientation, const QString & szTitle, QWidget * pParent = nullptr);
87
92
93protected:
94 Qt::Orientation mOrientation;
95 QLayout * m_pLayout;
96
97public:
103 void setInsideMargin(int iMargin)
104 {
105 if(layout())
106 layout()->setContentsMargins(iMargin, iMargin, iMargin, iMargin);
107 };
108
114 void setInsideSpacing(int iSpacing)
115 {
116 if(layout())
117 layout()->setSpacing(iSpacing);
118 };
119
125 {
126 if(layout())
127 return layout()->contentsMargins().top();
128 return 0;
129 };
130
136 {
137 if(layout())
138 return layout()->spacing();
139 return 0;
140 };
141
147 void addSpace(int iSpace);
148
154 void setOrientation(Qt::Orientation orientation);
155
161 void setLayout(QLayout * newLayout);
162
163protected:
164 void childEvent(QChildEvent * e) override;
165};
166
167#endif // _KVI_TAL_GROUPBOX_H_
Toolkit Abstraction Layer: groupbox class.
Definition KviTalGroupBox.h:45
Qt::Orientation mOrientation
Definition KviTalGroupBox.h:94
int insideSpacing()
Returns the inside spacing.
Definition KviTalGroupBox.h:135
QLayout * m_pLayout
Definition KviTalGroupBox.h:95
void setInsideMargin(int iMargin)
Sets the inside margin.
Definition KviTalGroupBox.h:103
int insideMargin()
Returns the inside margin.
Definition KviTalGroupBox.h:124
~KviTalGroupBox()
Destroys the groupbox object.
void setInsideSpacing(int iSpacing)
Sets the inside spacing.
Definition KviTalGroupBox.h:114
#define e
Definition detector.cpp:70
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124