Qt Virtual Chart Table (QVCT)
CSettingsEditView.cpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 // QT
20 #include <QDialog>
21 #include <QDialogButtonBox>
22 #include <QTabWidget>
23 #include <QVBoxLayout>
24 #include <QWidget>
25 
26 // QVCT
31 
32 
33 //------------------------------------------------------------------------------
34 // CONSTRUCTORS / DESTRUCTOR
35 //------------------------------------------------------------------------------
36 
38  : QDialog( _pqParent )
39 {
40  QDialog::setWindowTitle( tr("Settings")+"..." );
42 }
43 
45 {
46  // Create layout
47  QVBoxLayout* __pqVBoxLayout = new QVBoxLayout();
48 
49  // Add settings tabs
50  // ? BUG ? If (child) widget parent is not set before addTab, QDialog size is messed up
51  QTabWidget* __pqTabWidget = new QTabWidget();
52  // ... units
53  __pqTabWidget->addTab( new CSettingsUnitsEditView( __pqTabWidget ), tr("Units") );
54  // ... validity
55  __pqTabWidget->addTab( new CSettingsValidityEditView( __pqTabWidget ), tr("Validity") );
56  // ... misc. options
57  __pqTabWidget->addTab( new CSettingsMiscEditView( __pqTabWidget ), tr("Misc.") );
58  __pqVBoxLayout->addWidget( __pqTabWidget );
59 
60  // Add buttons
61  QDialogButtonBox* __pqDialogButtonBox = new QDialogButtonBox( QDialogButtonBox::Ok, Qt::Horizontal );
62  QDialog::connect( __pqDialogButtonBox, SIGNAL(accepted()), this, SLOT(accept()) );
63  __pqVBoxLayout->addWidget( __pqDialogButtonBox );
64 
65  // Set the layout
66  QDialog::setLayout( __pqVBoxLayout );
67 }
CSettingsEditView(QWidget *_pqParent=0)
void constructLayout()
Constructs the layout of the user interface.
[UI] Application settings - misc tab
[UI] Applciation settings - units tab
[UI] Applciation settings - validity tab