Michaël Lemaire
f3a0a72da2
git-svn-id: https://subversion.assembla.com/svn/thunderk/paysages@244 b1fd45b6-86a6-48da-8261-f70d1f35bdcc
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
#include "dialogwanderer.h"
|
|
|
|
#include <QWidget>
|
|
#include <QPushButton>
|
|
#include <QVBoxLayout>
|
|
#include "widgetwanderer.h"
|
|
|
|
DialogWanderer::DialogWanderer(QWidget* parent, CameraDefinition* camera, bool camera_validable) : QDialog(parent)
|
|
{
|
|
QWidget* panel;
|
|
QPushButton* button;
|
|
|
|
setModal(true);
|
|
setWindowTitle("Paysages 3D - Explore");
|
|
setLayout(new QHBoxLayout());
|
|
|
|
_wanderer = new WidgetWanderer(this, camera);
|
|
layout()->addWidget(_wanderer);
|
|
|
|
panel = new QWidget(this);
|
|
panel->setLayout(new QVBoxLayout());
|
|
panel->setMaximumWidth(200);
|
|
|
|
button = new QPushButton("Reset camera", panel);
|
|
panel->layout()->addWidget(button);
|
|
QObject::connect(button, SIGNAL(clicked()), _wanderer, SLOT(resetCamera()));
|
|
|
|
if (camera_validable)
|
|
{
|
|
button = new QPushButton("Validate as render camera", panel);
|
|
panel->layout()->addWidget(button);
|
|
QObject::connect(button, SIGNAL(clicked()), this, SLOT(validateCamera()));
|
|
}
|
|
|
|
button = new QPushButton("Close", panel);
|
|
panel->layout()->addWidget(button);
|
|
QObject::connect(button, SIGNAL(clicked()), this, SLOT(reject()));
|
|
|
|
layout()->addWidget(panel);
|
|
|
|
resize(900, 600);
|
|
}
|
|
|
|
DialogWanderer::~DialogWanderer()
|
|
{
|
|
}
|
|
|
|
void DialogWanderer::validateCamera()
|
|
{
|
|
_wanderer->validateCamera();
|
|
reject();
|
|
}
|
|
|