source: additional/scripts/OpenGLQT_exemple/src/window.cpp @ 1355

Last change on this file since 1355 was 561, checked in by garnier, 17 years ago

r563@mac-90108: laurentgarnier | 2007-08-14 12:28:16 +0200
mise a jour suite au plantage de svk (cheksum error) suite au crash du DD en juin

File size: 2.2 KB
Line 
1 #include <QtGui>
2
3 #include "glwidget.h"
4 #include "window.h"
5
6Window::Window(): QDialog(0,Qt::Dialog)
7 {
8   printf("Window::Window 1\n");
9     glWidget = new GLWidget;
10   printf("Window::Window 2\n");
11
12//      xSlider = createSlider();
13//      ySlider = createSlider();
14//      zSlider = createSlider();
15
16//      connect(xSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setXRotation(int)));
17//      connect(glWidget, SIGNAL(xRotationChanged(int)), xSlider, SLOT(setValue(int)));
18//      connect(ySlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setYRotation(int)));
19//      connect(glWidget, SIGNAL(yRotationChanged(int)), ySlider, SLOT(setValue(int)));
20//      connect(zSlider, SIGNAL(valueChanged(int)), glWidget, SLOT(setZRotation(int)));
21//      connect(glWidget, SIGNAL(zRotationChanged(int)), zSlider, SLOT(setValue(int)));
22
23     QHBoxLayout *mainLayout = new QHBoxLayout;
24
25     mainLayout->addWidget(glWidget);
26   printf("Window::Window 3\n");
27//      mainLayout->addWidget(xSlider);
28//      mainLayout->addWidget(ySlider);
29//      mainLayout->addWidget(zSlider);
30     setLayout(mainLayout);
31   printf("Window::Window 4\n");
32
33//      xSlider->setValue(15 * 16);
34//      ySlider->setValue(345 * 16);
35//      zSlider->setValue(0 * 16);
36     setWindowTitle(tr("Hello GL"));
37   printf("Window::Window 5\n");
38     glWidget->resize(300, 300);
39   printf("Window::Window 6\n");
40     glWidget->show();
41   printf("Window::Window 7 END\n");
42 }
43
44//  QSlider *Window::createSlider()
45//  {
46//      QSlider *slider = new QSlider(Qt::Vertical);
47//      slider->setRange(0, 360 * 16);
48//      slider->setSingleStep(16);
49//      slider->setPageStep(15 * 16);
50//      slider->setTickInterval(15 * 16);
51//      slider->setTickPosition(QSlider::TicksRight);
52//      return slider;
53//  }
54
55void Window::mousePressEvent(QMouseEvent *event)
56{
57  printf("Window::mousePressEvent \n");
58}
59
60void Window::mouseReleaseEvent(QMouseEvent *event)
61{
62  printf("Window::mouseReleaseEvent \n");
63}
64
65void Window::mouseMoveEvent(QMouseEvent *event)
66{
67  printf("Window::mouseMoveEvent \n");
68  //  int dx = event->x() - lastPos.x();
69  //  int dy = event->y() - lastPos.y();
70 
71  //  if (event->buttons() & Qt::LeftButton) {
72  //  } else if (event->buttons() & Qt::RightButton) {
73  //  }
74}
Note: See TracBrowser for help on using the repository browser.