Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
xgroupboxes.cpp
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // xgroupboxes.cpp
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 #include "xwidgets/xgroupboxes.h"
10 
11 //======================================================
12 /* Extended groupBox with a Vertical Layout */
13 XGroupVBox::XGroupVBox(QString title, QWidget *parent) :
14  QGroupBox(parent)
15 {
16  setTitle(title);
17  xLayout = new QVBoxLayout();
18  setLayout(xLayout);
19 }
20 
22  xLayout->addWidget(widget);
23 }
24 void XGroupVBox::addWidget(QWidget *widget, int stretch){
25  xLayout->addWidget(widget, stretch);
26 }
27 void XGroupVBox::addLayout( QBoxLayout *lay){
28  xLayout->addLayout(lay);
29 }
30 void XGroupVBox::addLayout( QGridLayout *lay){
31  xLayout->addLayout(lay);
32 }
33 
34 
35 //======================================================
36 /* Extended groupBox with a Horizontal Layout */
37 XGroupHBox::XGroupHBox(QString title, QWidget *parent) :
38  QGroupBox(parent)
39 {
40  setTitle(title);
41  xLayout = new QHBoxLayout();
42  setLayout(xLayout);
43 }
44 
46  xLayout->addWidget(widget);
47 }
48 
49 void XGroupHBox::addWidget(QWidget *widget, int stretch){
50  xLayout->addWidget(widget, stretch);
51 }
52 void XGroupHBox::addLayout( QBoxLayout *lay){
53  xLayout->addLayout(lay);
54 }
55 void XGroupHBox::addLayout( QGridLayout *lay){
56  xLayout->addLayout(lay);
57 }
58 
59 
60 
61 //======================================================
62 /* Extended groupBox with a Grid Layout */
63 XGroupGBox::XGroupGBox(QString title, QWidget *parent) :
64  QGroupBox(parent)
65 {
66  setTitle(title);
67  gridLayout = new QGridLayout();
68  setLayout(gridLayout);
69 }
70 
71 void XGroupGBox::addWidget(QWidget *widget, int row, int col, int row_span, int col_span){
72  gridLayout->addWidget(widget, row, col, row_span, col_span);
73 }
74 void XGroupGBox::addWidget(QWidget *widget, int row, int col, int row_span, int col_span, Qt::AlignmentFlag align){
75  gridLayout->addWidget(widget, row, col, row_span, col_span, align);
76 }
77 
XGroupVBox(QString title, QWidget *parent=0)
Definition: xgroupboxes.cpp:13
QHBoxLayout * xLayout
Definition: xgroupboxes.h:45
QVBoxLayout * xLayout
Definition: xgroupboxes.h:26
XGroupGBox(QString title, QWidget *parent=0)
Definition: xgroupboxes.cpp:63
QGridLayout * gridLayout
Definition: xgroupboxes.h:65
void addWidget(QWidget *w, int row, int col, int row_span, int col_span)
Definition: xgroupboxes.cpp:71
void addWidget(QWidget *w)
Definition: xgroupboxes.cpp:21
void addLayout(QBoxLayout *lay)
Definition: xgroupboxes.cpp:52
XGroupHBox(QString title, QWidget *parent=0)
Definition: xgroupboxes.cpp:37
void addWidget(QWidget *w)
Definition: xgroupboxes.cpp:45
void addLayout(QBoxLayout *lay)
Definition: xgroupboxes.cpp:27