Developer documentation | Axl-2.5.1

axlInspectorSettings.cpp
Go to the documentation of this file.
1 /* axlInspectorSettings.cpp ---
2  *
3  * Author: Meriadeg Perrinel
4  * Copyright (C) 2008 - Meriadeg Perrinel, Inria.
5  * Created: Tue Mar 15 14:09:00 2011 (+0100)
6  * Version: $Id$
7  * Last-Updated: Wed Nov 9 17:06:56 2011 (+0100)
8  * By: Julien Wintz
9  * Update #: 117
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
20 #include "axlInspectorSettings.h"
21 #include "axlInspectorSeparator.h"
22 #include "axlInspectorStack.h"
23 
24 #include <dtkGuiSupport/dtkPluginsEditor.h>
25 #include <dtkGuiSupport/dtkSettingsEditor.h>
26 
27 #include <QtGui>
28 
29 class axlInspectorSettingsPrivate
30 {
31 public:
32  axlInspectorStack *stack;
33 
34 public:
35  dtkSettingsEditor *settings_editor;
36  dtkPluginsEditor *plugins_editor;
37 };
38 
39 axlInspectorSettings::axlInspectorSettings(QWidget *parent) : QFrame(parent), d(new axlInspectorSettingsPrivate)
40 {
41  QSettings settings("inria", "dtk");
42  settings.beginGroup("shader");
43  if(!settings.contains("path"))
44  settings.setValue("path", QDir::homePath());
45  settings.endGroup();
46 
47  d->settings_editor = new dtkSettingsEditor(this);
48  d->settings_editor->setSettings("inria", "dtk");
49 
50  d->plugins_editor = new dtkPluginsEditor(this);
51 
52  d->stack = new axlInspectorStack(this);
53  d->stack->addWidget("Settings", d->settings_editor);
54  d->stack->addWidget("Plugins", d->plugins_editor);
55 
56  QHBoxLayout *layout = new QHBoxLayout(this);
57  layout->setContentsMargins(0, 0, 0, 0);
58  layout->setSpacing(0);
59  layout->addWidget(new axlInspectorSeparator(this, Qt::Vertical));
60  layout->addWidget(d->stack);
61  this->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding);
62 }
63 
65 {
66  delete d;
67 
68  d = NULL;
69 }
70 
72 {
73  return QFrame::width();
74 }
75 
77 {
78  this->setFixedWidth(width);
79 }
80 
axlInspectorSettings(QWidget *parent=0)
int width(void) const