PathDeformWidget Class Reference

#include <pathdeform.h>

Inheritance diagram for PathDeformWidget:

Inheritance graph
[legend]
Collaboration diagram for PathDeformWidget:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 98 of file pathdeform.h.

Public Member Functions

 PathDeformWidget (QWidget *parent)

Private Attributes

PathDeformRendererm_renderer


Constructor & Destructor Documentation

PathDeformWidget::PathDeformWidget ( QWidget parent  ) 

Definition at line 38 of file pathdeform.cpp.

References QBoxLayout::addStretch(), QBoxLayout::addWidget(), QAbstractButton::animateClick(), QObject::connect(), QSizePolicy::Expanding, QSizePolicy::Fixed, QGLFormat::hasOpenGL(), QWidget::hide(), Qt::Horizontal, ArthurFrame::loadDescription(), ArthurFrame::loadSourceFile(), m_renderer, QSizePolicy::Preferred, QWidget::setAttribute(), QAbstractButton::setCheckable(), QAbstractButton::setChecked(), ArthurFrame::setDescriptionEnabled(), QWidget::setFixedWidth(), QAbstractSlider::setRange(), QWidget::setSizePolicy(), QAbstractButton::setText(), QLineEdit::setText(), QGroupBox::setTitle(), QAbstractSlider::setValue(), QWidget::setWindowTitle(), SIGNAL, SLOT, and Qt::WA_ContentsPropagated.

00039     : QWidget(parent)
00040 {
00041     setWindowTitle("Vector Deformation");
00042 
00043     m_renderer = new PathDeformRenderer(this);
00044     m_renderer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
00045 
00046     QGroupBox *mainGroup = new QGroupBox(this);
00047     mainGroup->setTitle("Vector Deformation");
00048 
00049     QGroupBox *radiusGroup = new QGroupBox(mainGroup);
00050     radiusGroup->setAttribute(Qt::WA_ContentsPropagated);
00051     radiusGroup->setTitle("Lens Radius");
00052     QSlider *radiusSlider = new QSlider(Qt::Horizontal, radiusGroup);
00053     radiusSlider->setRange(50, 150);
00054     radiusSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
00055 
00056     QGroupBox *deformGroup = new QGroupBox(mainGroup);
00057     deformGroup->setAttribute(Qt::WA_ContentsPropagated);
00058     deformGroup->setTitle("Deformation");
00059     QSlider *deformSlider = new QSlider(Qt::Horizontal, deformGroup);
00060     deformSlider->setRange(-100, 100);
00061     deformSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
00062 
00063     QGroupBox *fontSizeGroup = new QGroupBox(mainGroup);
00064     fontSizeGroup->setAttribute(Qt::WA_ContentsPropagated);
00065     fontSizeGroup->setTitle("Font Size");
00066     QSlider *fontSizeSlider = new QSlider(Qt::Horizontal, fontSizeGroup);
00067     fontSizeSlider->setRange(16, 200);
00068     fontSizeSlider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
00069 
00070     QGroupBox *textGroup = new QGroupBox(mainGroup);
00071     textGroup->setAttribute(Qt::WA_ContentsPropagated);
00072     textGroup->setTitle("Text");
00073     QLineEdit *textInput = new QLineEdit(textGroup);
00074 
00075     QPushButton *animateButton = new QPushButton(mainGroup);
00076     animateButton->setText("Animated");
00077     animateButton->setCheckable(true);
00078 
00079     QPushButton *showSourceButton = new QPushButton(mainGroup);
00080     showSourceButton->setText("Show Source");
00081 //     showSourceButton->setCheckable(true);
00082 #ifdef QT_OPENGL_SUPPORT
00083     QPushButton *enableOpenGLButton = new QPushButton(mainGroup);
00084     enableOpenGLButton->setText("Use OpenGL");
00085     enableOpenGLButton->setCheckable(true);
00086     enableOpenGLButton->setChecked(m_renderer->usesOpenGL());
00087     if (!QGLFormat::hasOpenGL())
00088         enableOpenGLButton->hide();
00089 #endif
00090     QPushButton *whatsThisButton = new QPushButton(mainGroup);
00091     whatsThisButton->setText("What's This?");
00092     whatsThisButton->setCheckable(true);
00093 
00094     // Layouts
00095     QHBoxLayout *mainLayout = new QHBoxLayout(this);
00096     mainLayout->addWidget(m_renderer);
00097     mainLayout->addWidget(mainGroup);
00098     mainGroup->setFixedWidth(180);
00099 
00100     QVBoxLayout *mainGroupLayout = new QVBoxLayout(mainGroup);
00101     mainGroupLayout->addWidget(radiusGroup);
00102     mainGroupLayout->addWidget(deformGroup);
00103     mainGroupLayout->addWidget(fontSizeGroup);
00104     mainGroupLayout->addWidget(textGroup);
00105     mainGroupLayout->addWidget(animateButton);
00106     mainGroupLayout->addStretch(1);
00107     mainGroupLayout->addWidget(showSourceButton);
00108 #ifdef QT_OPENGL_SUPPORT
00109     mainGroupLayout->addWidget(enableOpenGLButton);
00110 #endif
00111     mainGroupLayout->addWidget(whatsThisButton);
00112 
00113     QVBoxLayout *radiusGroupLayout = new QVBoxLayout(radiusGroup);
00114     radiusGroupLayout->addWidget(radiusSlider);
00115 
00116     QVBoxLayout *deformGroupLayout = new QVBoxLayout(deformGroup);
00117     deformGroupLayout->addWidget(deformSlider);
00118 
00119     QVBoxLayout *fontSizeGroupLayout = new QVBoxLayout(fontSizeGroup);
00120     fontSizeGroupLayout->addWidget(fontSizeSlider);
00121 
00122     QVBoxLayout *textGroupLayout = new QVBoxLayout(textGroup);
00123     textGroupLayout->addWidget(textInput);
00124 
00125     connect(textInput, SIGNAL(textChanged(QString)), m_renderer, SLOT(setText(QString)));
00126     connect(radiusSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setRadius(int)));
00127     connect(deformSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setIntensity(int)));
00128     connect(fontSizeSlider, SIGNAL(valueChanged(int)), m_renderer, SLOT(setFontSize(int)));
00129     connect(animateButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setAnimated(bool)));
00130     connect(whatsThisButton, SIGNAL(clicked(bool)), m_renderer, SLOT(setDescriptionEnabled(bool)));
00131     connect(showSourceButton, SIGNAL(clicked()), m_renderer, SLOT(showSource()));
00132 #ifdef QT_OPENGL_SUPPORT
00133     connect(enableOpenGLButton, SIGNAL(clicked(bool)), m_renderer, SLOT(enableOpenGL(bool)));
00134 #endif
00135     connect(m_renderer, SIGNAL(descriptionEnabledChanged(bool)),
00136             whatsThisButton, SLOT(setChecked(bool)));
00137 
00138     animateButton->animateClick();
00139     deformSlider->setValue(80);
00140     radiusSlider->setValue(100);
00141     fontSizeSlider->setValue(120);
00142     textInput->setText("Qt");
00143 
00144     m_renderer->loadSourceFile(":res/pathdeform.cpp");
00145     m_renderer->loadDescription(":res/pathdeform.html");
00146     m_renderer->setDescriptionEnabled(false);
00147 }

Here is the call graph for this function:


Member Data Documentation

PathDeformRenderer* PathDeformWidget::m_renderer [private]

Definition at line 104 of file pathdeform.h.

Referenced by PathDeformWidget().


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 15:32:53 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1