Skip to content

Commit e9de5d1

Browse files
Add Qt6 support. [skip ci]
1 parent fccf749 commit e9de5d1

10 files changed

+51
-10
lines changed

actions/raypick.cpp.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ static SoCoordinate3 * pickpoints = NULL;
5353

5454
// Calculates azimuth angle for the "directionvec" input argument. An
5555
// azimuth angle is the angle of a vector versus the direction of
56-
// compass north, where 0 means the input vector points straight
57-
// north, 90 is east, 180 south and 270 is west.
56+
// compass north, where 0° means the input vector points straight
57+
// north, 90° is east, 180° south and 270° is west.
5858
static float
5959
azimuth_angle(SbVec3f north, SbVec3f east, SbVec3f directionvec)
6060
{

actions/tesselate.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ find_coord3_idx(const SoCoordinate3 * c, const SbVec3f & v)
6969
#else // __COIN__
7070

7171
// FIXME: the run-time of this algorithm could quickly get very
72-
// ugly.. like O(n²)-time ugly. Use an oct-tree or something to
72+
// ugly.. like O(n^2)-time ugly. Use an oct-tree or something to
7373
// fix. 20011009 mortene.
7474
int size = c->point.getNum();
7575
for (int i=0; i < size; i++) {

components/backgroundimg.cpp.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ MyExaminerViewer::actualRedraw(void)
230230
So@Gui@ExaminerViewer::actualRedraw();
231231

232232

233-
// Increase arrow angle with 1/1000 every frame.
233+
// Increase arrow angle with 1/1000 ° every frame.
234234
arrowrotation->angle = arrowrotation->angle.getValue() + (0.001f / float(M_PI) * 180);
235235
// Render overlay front scenegraph.
236236
glClear(GL_DEPTH_BUFFER_BIT);

eyecandy/mandelzoom.cpp.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ Landscape::~Landscape(void)
208208

209209
void
210210
Landscape::createJulia(int n) {
211-
register double zr, zr_old, zi, cr, ci;
211+
double zr, zr_old, zi, cr, ci;
212212
int w,minw=293284296;
213213
static int oldw = 0;
214214

eyecandy/moirepatterns.cpp.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ main(
9090
}
9191

9292
(void)fprintf( stdout, "PointSet contains a total of %d points.\n\n", num );
93-
(void)fprintf( stdout, "Spin the pointset to see the moir� patterns change.\n" );
93+
(void)fprintf( stdout, "Spin the pointset to see the moirè patterns change.\n" );
9494
(void)fprintf( stdout, "You can also change between perspective camera and\n" );
9595
(void)fprintf( stdout, "orthographic camera to get different types of patterns.\n" );
9696
(void)fprintf( stdout, "\n" );
@@ -128,7 +128,7 @@ main(
128128
// set up viewer
129129
So@Gui@ExaminerViewer * viewer = new So@Gui@ExaminerViewer( window );
130130
viewer->setSceneGraph( root );
131-
viewer->setTitle( "Moir� Patterns" );
131+
viewer->setTitle( "Moirè Patterns" );
132132
viewer->show();
133133

134134
So@Gui@::show( window );

volumerendering/Cute/curvep/ColorTableEditor.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,11 @@ SoQtColorTableEditor::SoQtColorTableEditor(int numcolors, QWidget * parent, cons
154154
this->setSizePolicy(sizepolicy);
155155

156156
QGridLayout * toplayout = new QGridLayout(this);
157+
#if QT_VERSION >= 0x050000
158+
toplayout->setContentsMargins(10, 10, 10, 10);
159+
#else
157160
toplayout->setMargin(10);
161+
#endif
158162
QVBoxLayout * buttonlayout = new QVBoxLayout();
159163

160164
QGroupBox * controlgroup = new QGroupBox(this);

volumerendering/Cute/curvep/CurveView.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ void CurveView::contentsMousePressEvent(QMouseEvent* e)
141141
if (e->button() == Qt::LeftButton) {
142142
this->mousepressed = TRUE;
143143
}
144+
#if QT_VERSION >= 0x050D00
145+
QPoint p = transform().inverted().map(e->pos());
146+
#else
144147
QPoint p = matrix().inverted().map(e->pos());
148+
#endif
145149
this->movingstart = p;
146150
this->lastpos = p;
147151
QList<QGraphicsItem*> list = this->canvas->items(p);

volumerendering/Cute/curvep/CurveView.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,12 @@ class CurveView : public QGraphicsView
6060
QGraphicsScene * canvas,
6161
QWidget * parent = 0,
6262
const char * name = 0,
63-
Qt::WindowFlags flags = 0);
64-
63+
#if QT_VERSION >= 0x050F00
64+
Qt::WindowFlags flags = Qt::WindowFlags()
65+
#else
66+
Qt::WindowFlags flags = 0
67+
#endif
68+
);
6569
~CurveView();
6670

6771
enum CurveType { SMOOTH, FREE };

volumerendering/Cute/gradientp/GradientView.cpp

+24
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ GradientView::updateView(void)
171171
void
172172
GradientView::mousePressEvent(QMouseEvent * e)
173173
{
174+
#if QT_VERSION >= 0x050D00
175+
QPoint p = transform().inverted().map(e->pos());
176+
#else
174177
QPoint p = matrix().inverted().map(e->pos());
178+
#endif
175179

176180
switch (e->button()) {
177181
case Qt::LeftButton:
@@ -206,7 +210,11 @@ GradientView::mousePressEvent(QMouseEvent * e)
206210
case Qt::RightButton:
207211
if ((this->currenttick != -1) || (this->segmentidx != -1)) {
208212
this->buildMenu();
213+
#if QT_VERSION >= 0x060000
214+
if (this->menu->exec(e->globalPosition().toPoint())) {
215+
#else
209216
if (this->menu->exec(e->globalPos())) {
217+
#endif
210218
// FIXME: this seems unnecessary. 20031008 mortene.
211219
delete this->menu;
212220
this->menu = NULL;
@@ -230,7 +238,11 @@ GradientView::mouseMoveEvent(QMouseEvent * e)
230238
{
231239
if (this->mousepressed) {
232240
if (this->currenttick == -1) { return; }
241+
#if QT_VERSION >= 0x050D00
242+
QPoint p = transform().inverted().map(e->pos());
243+
#else
233244
QPoint p = matrix().inverted().map(e->pos());
245+
#endif
234246
int x = p.x();
235247

236248
assert(this->currenttick > 0);
@@ -253,21 +265,33 @@ GradientView::mouseMoveEvent(QMouseEvent * e)
253265

254266
const float value = t * (this->max - this->min) + 0.5f;
255267
QString s;
268+
#if QT_VERSION >= 0x050E00
269+
s = QString("Color table index: %1").arg((int)(value + 0.5f));
270+
#else
256271
s.sprintf("Color table index: %d", (int)(value + 0.5f));
272+
#endif
257273
this->statusbar->showMessage(s);
258274

259275
emit this->viewChanged();
260276
}
261277
} else {
278+
#if QT_VERSION >= 0x050D00
279+
QPoint p = transform().inverted().map(e->pos());
280+
#else
262281
QPoint p = matrix().inverted().map(e->pos());
282+
#endif
263283
float t = (float)p.x() / (float)this->width();
264284
// this test should not be necessary, however the mouse coordinates from
265285
// the mouse event can sometimes be out of bounds, i.e. they can sometimes
266286
// be smaller than 0 or larger than canvas.width or canvas.height.
267287
if ((t >= 0.0f) && (t <= 1.0f)) {
268288
QRgb col = this->grad.eval(t);
269289
QString s;
290+
#if QT_VERSION >= 0x050E00
291+
s = QString("RGBA: 0x%1%2%3%4").arg(qRed(col), 2, 16, '0').arg(qGreen(col), 2, 16, '0').arg(qBlue(col, 2, 16, '0').arg(qAlpha(col, 2, 16, '0'));
292+
#else
270293
s.sprintf("RGBA: 0x%02x%02x%02x%02x", qRed(col), qGreen(col), qBlue(col), qAlpha(col));
294+
#endif
271295
this->statusbar->showMessage(s);
272296
}
273297
}

volumerendering/Cute/gradientp/GradientView.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ class GradientView : public QGraphicsView
5656
const Gradient & g = Gradient(),
5757
QWidget * parent = 0,
5858
const char * name = 0,
59-
Qt::WindowFlags f = 0);
59+
#if QT_VERSION >= 0x050F00
60+
Qt::WindowFlags f = Qt::WindowFlags()
61+
#else
62+
Qt::WindowFlags f = 0
63+
#endif
64+
);
6065

6166
~GradientView();
6267

0 commit comments

Comments
 (0)