~ubuntu-branches/ubuntu/oneiric/soqt/oneiric

« back to all changes in this revision

Viewing changes to src/Inventor/Qt/viewers/FullViewer.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2006-02-06 22:34:00 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060206223400-g69m5soqa4zh0gkc
Tags: 1.3.0-3
debian/control: update libsoqt-dev depends.  Closes: #351700.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/**************************************************************************\
2
2
 *
3
3
 *  This file is part of the Coin 3D visualization library.
4
 
 *  Copyright (C) 1998-2004 by Systems in Motion.  All rights reserved.
 
4
 *  Copyright (C) 1998-2005 by Systems in Motion.  All rights reserved.
5
5
 *
6
6
 *  This library is free software; you can redistribute it and/or
7
7
 *  modify it under the terms of the GNU General Public License
16
16
 *
17
17
 *  See <URL:http://www.coin3d.org/> for more information.
18
18
 *
19
 
 *  Systems in Motion, Teknobyen, Abels Gate 5, 7030 Trondheim, NORWAY.
 
19
 *  Systems in Motion, Postboks 1283, Pirsenteret, 7462 Trondheim, NORWAY.
20
20
 *  <URL:http://www.sim.no/>.
21
21
 *
22
22
\**************************************************************************/
42
42
#include <config.h>
43
43
#endif // HAVE_CONFIG_H
44
44
 
45
 
#include <qpushbutton.h>
 
45
// FIXME: get rid of this define. We should fix up the compile issues
 
46
// wrt Qt 4 properly. 20050629 mortene.
 
47
#define QT3_SUPPORT
 
48
 
 
49
#include <qbuttongroup.h>
 
50
#include <qcheckbox.h>
 
51
#include <qframe.h>
 
52
#include <qlabel.h>
46
53
#include <qlayout.h>
47
 
#include <qlabel.h>
 
54
#include <qlineedit.h>
 
55
#include <qmetaobject.h>
48
56
#include <qpixmap.h>
49
 
#include <qlineedit.h>
50
 
#include <qbuttongroup.h>
 
57
#include <qpushbutton.h>
51
58
#include <qradiobutton.h>
52
 
#include <qframe.h>
53
59
#include <qslider.h>
54
 
#include <qcheckbox.h>
55
 
#include <qmetaobject.h>
56
60
 
57
61
#ifdef HAVE_QSTYLEFACTORY_H
58
62
#include <qstylefactory.h>
80
84
#include <Inventor/Qt/common/pixmaps/view_all.xpm>
81
85
#include <Inventor/Qt/common/pixmaps/seek.xpm>
82
86
 
 
87
 
 
88
// ************************************************************************
 
89
 
 
90
// Take care of namespace incompatibilities between Qt 3 and Qt 4.
 
91
 
 
92
#if QT_VERSION < 0x040000 // pre Qt 4
 
93
#define QTWIDGET_NOFOCUS QWidget::NoFocus
 
94
#else // Qt 4.0.0+
 
95
#define QTWIDGET_NOFOCUS Qt::NoFocus
 
96
#endif // Qt 4.0.0+
 
97
 
83
98
// *************************************************************************
84
99
 
85
100
SOQT_OBJECT_ABSTRACT_SOURCE(SoQtFullViewer);
86
101
 
87
102
// *************************************************************************
88
103
 
89
 
// *************************************************************************
90
 
 
91
104
static const int VIEWERBORDER = 2;
92
105
static const int ZOOMSLIDERRESOLUTION = 200;
93
106
 
571
584
 
572
585
  const int numViewerButtons = PRIVATE(this)->viewerbuttons->getLength();
573
586
  for (int i = 0; i < numViewerButtons; i++) {
574
 
    QButton * b = PRIVATE(this)->getViewerbutton(i);
 
587
    QPushButton * b = PRIVATE(this)->getViewerbutton(i);
575
588
    b->setFixedSize(30, 30);
576
 
    b->setFocusPolicy(QWidget::NoFocus);
 
589
    b->setFocusPolicy(QTWIDGET_NOFOCUS);
577
590
    l->addWidget(b, i, 0);
578
591
  }
579
592
 
591
604
    QPushButton * p = new QPushButton(parent);
592
605
    // Button focus doesn't really make sense in the way we're using
593
606
    // the pushbuttons.
594
 
    p->setFocusPolicy(QWidget::NoFocus);
 
607
    p->setFocusPolicy(QTWIDGET_NOFOCUS);
 
608
 
 
609
#if QT_VERSION >= 0x040000 // Qt 4.*
 
610
    // In some GUI styles in Qt4, a default button is drawn with an
 
611
    // extra frame around it, up to 3 pixels or more. This causes
 
612
    // pixmaps on buttons to look tiny, which is not what we want.
 
613
    p->setIconSize(QSize(24, 24));
 
614
#endif
595
615
 
596
616
#if (defined Q_WS_MAC && QT_VERSION >= 0x030100) && defined(HAVE_QSTYLEFACTORY_H)
597
617
    // Since Qt/Mac 3.1.x, all pushbuttons (even those < 32x32) are drawn