Pārlūkot izejas kodu

Removed QT3Support dependecies

Clemens-Alexander Brust 11 gadi atpakaļ
vecāks
revīzija
6a54ebf882

+ 1 - 1
core/imagedisplay/ArrayPlot.cpp

@@ -28,7 +28,7 @@ ArrayPlot::ArrayPlot ( std::vector<double> probs,
                        QWidget* parent,
                        const char* name ,
                        Qt::WFlags flags )
-    : QGLWidget ( parent, name, NULL, flags ),
+    : QGLWidget ( parent, NULL, flags ),
     m_width ( width ),
     m_height ( height ),
     m_maxProb ( -std::numeric_limits<double>::infinity() ),

+ 4 - 5
core/imagedisplay/CaptureDialog.cpp

@@ -1,19 +1,18 @@
 #include "CaptureDialog.h"
 
 #include <qlayout.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
 
 namespace NICE {
 
 CaptureDialog::CaptureDialog(QWidget* parent, const char* name, 
                              bool modal, Qt::WFlags fl)
-    : QDialog( parent, name, modal, fl ) {
+    : QDialog( parent, fl ) {
   if (name == NULL) {
-    setName("CaptureDialog");
+    setWindowTitle("CaptureDialog");
   }
   
-  Q3VBoxLayout* layout = new Q3VBoxLayout( this, 11, 6, "layout"); 
+  QVBoxLayout* layout = new QVBoxLayout( this ); 
   
   m_capture = new CaptureWidget(this);
   m_capture->showCancelButton();

+ 43 - 109
core/imagedisplay/CaptureWidget.cpp

@@ -2,115 +2,63 @@
 
 #include <qvariant.h>
 #include <qpushbutton.h>
-#include <q3buttongroup.h>
 #include <qradiobutton.h>
 #include <qcheckbox.h>
 #include <qlabel.h>
 #include <qlineedit.h>
 #include <qlayout.h>
 #include <qtooltip.h>
-#include <q3whatsthis.h>
 #include <qcombobox.h>
-//Added by qt3to4:
-#include <Q3HBoxLayout>
-#include <Q3VBoxLayout>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <QFileDialog>
 
 namespace NICE {
 
 CaptureWidget::CaptureWidget(QWidget* parent, const char* name, Qt::WFlags fl)
-        : QWidget(parent, name, fl) {
-    if (name == NULL) {
-      setName("CaptureWidget");
-    }
-    //setSizeGripEnabled( TRUE );
-    CaptureWidgetLayout = new Q3VBoxLayout( this, 11, 6, "CaptureWidgetLayout");
+        : QWidget(parent, fl) {
+    CaptureWidgetLayout = new QVBoxLayout( this );
 
-    layout15 = new Q3HBoxLayout( 0, 0, 6, "layout15");
+    layout15 = new QHBoxLayout( );
 
-    textLabel1 = new QLabel( this, "textLabel1" );
+    textLabel1 = new QLabel( this );
     layout15->addWidget( textLabel1 );
 
-    editFormat = new QComboBox( true, this, "editFormat" );
-    editFormat->insertItem("ppm");
-    editFormat->insertItem("pgm");
-    editFormat->insertItem("png");
-    editFormat->insertItem("jpg");
-    QToolTip::add(editFormat,
-                  "Format specified by filename extension (without dot)");
+    editFormat = new QComboBox( this );
+    editFormat->addItem("ppm");
+    editFormat->addItem("pgm");
+    editFormat->addItem("png");
+    editFormat->addItem("jpg");
+    editFormat->setToolTip("Format specified by filename extension (without dot)");
     layout15->addWidget( editFormat );
 
-    checkBuffered = new QCheckBox( this, "checkBuffered" );
-    QToolTip::add(checkBuffered,
-                  "Buffer images in memory and write after capturing (stop)");
+    checkBuffered = new QCheckBox( this );
+    checkBuffered->setToolTip( "Buffer images in memory and write after capturing (stop)");
     layout15->addWidget( checkBuffered );
 
-    buttonStart = new QPushButton( this, "buttonStart" );
+    buttonStart = new QPushButton( this );
     layout15->addWidget( buttonStart );
 
-    buttonStop = new QPushButton( this, "buttonStop" );
+    buttonStop = new QPushButton( this );
     buttonStop->setEnabled( FALSE );
     layout15->addWidget( buttonStop );
 
-    buttonCancel = new QPushButton( this, "buttonCancel" );
+    buttonCancel = new QPushButton( this );
     buttonCancel->setAutoDefault( TRUE );
     buttonCancel->hide();
     layout15->addWidget( buttonCancel );
-    //spacer5 = new QSpacerItem( 20, 44, QSizePolicy::Minimum, QSizePolicy::Expanding );
-    //layout15->addItem( spacer5 );
-
-
-
-//     layout15 = new QHBoxLayout( 0, 0, 6, "layout15");
-//
-//     boxFormat = new QButtonGroup( this, "boxFormat" );
-//     //boxFormat->setInsideMargin(0);
-//     //boxFormat->setInsideSpacing(2);
-//
-//     radioPPM = new QRadioButton( boxFormat, "radioPPM" );
-//     radioPPM->setGeometry( QRect( 11, 26, 267, 25 ) );
-//     radioPPM->setChecked( TRUE );
-//
-//     radioJPG = new QRadioButton( boxFormat, "radioJPG" );
-//     radioJPG->setGeometry( QRect( 11, 119, 267, 25 ) );
-//
-//     radioPGM = new QRadioButton( boxFormat, "radioPGM" );
-//     radioPGM->setGeometry( QRect( 11, 57, 267, 25 ) );
-//
-//     radioPNG = new QRadioButton( boxFormat, "radioPNG" );
-//     radioPNG->setGeometry( QRect( 11, 88, 267, 25 ) );
-//     layout15->addWidget( boxFormat );
-//
-//     layout14 = new QVBoxLayout( 0, 0, 6, "layout14");
-//
-//     buttonStart = new QPushButton( this, "buttonStart" );
-//     layout14->addWidget( buttonStart );
-//
-//     buttonStop = new QPushButton( this, "buttonStop" );
-//     buttonStop->setEnabled( FALSE );
-//     layout14->addWidget( buttonStop );
-//
-//     buttonCancel = new QPushButton( this, "buttonCancel" );
-//     buttonCancel->setAutoDefault( TRUE );
-//     buttonCancel->hide();
-//     layout14->addWidget( buttonCancel );
-//     spacer5 = new QSpacerItem( 20, 44, QSizePolicy::Minimum, QSizePolicy::Expanding );
-//     layout14->addItem( spacer5 );
-//
-//     checkBuffered = new QCheckBox( this, "checkBuffered" );
-//     layout14->addWidget( checkBuffered );
-//     layout15->addLayout( layout14 );
-
+    
     CaptureWidgetLayout->addLayout( layout15 );
 
-    layout11 = new Q3HBoxLayout( 0, 0, 6, "layout11");
+    layout11 = new QHBoxLayout();
 
-    textLabel2 = new QLabel( this, "textLabel2" );
+    textLabel2 = new QLabel( this );
     layout11->addWidget( textLabel2 );
 
-    editDirectory = new QLineEdit( this, "editDirectory" );
+    editDirectory = new QLineEdit( this );
     layout11->addWidget( editDirectory );
 
-    buttonBrowse = new QPushButton( this, "buttonBrowse" );
+    buttonBrowse = new QPushButton( this );
     layout11->addWidget( buttonBrowse );
     CaptureWidgetLayout->addLayout( layout11 );
 
@@ -124,11 +72,7 @@ CaptureWidget::CaptureWidget(QWidget* parent, const char* name, Qt::WFlags fl)
 
     languageChange();
     resize( QSize(542, 253).expandedTo(minimumSizeHint()) );
-//     clearWState( WState_Polished ); // Qt4
 
-    // signals and slots connections
-//     connect(buttonCancel, SIGNAL(clicked()),
-//             this, SLOT(buttonCancelClicked()));
     connect(buttonCancel, SIGNAL(clicked()),
             this, SIGNAL(cancelled()));
     connect(buttonBrowse, SIGNAL(clicked()),
@@ -157,35 +101,31 @@ CaptureWidget::~CaptureWidget()
  */
 void CaptureWidget::languageChange()
 {
-    setCaption( tr( "Capture Image Sequence" ) );
-//     boxFormat->setTitle( tr( "Image file format" ) );
-//     radioPPM->setText( tr( "PPM" ) );
-//     radioJPG->setText( tr( "JPEG" ) );
-//     radioPGM->setText( tr( "PGM (gray)" ) );
-//     radioPNG->setText( tr( "PNG" ) );
+    setWindowTitle( tr( "Capture Image Sequence" ) );
     buttonStart->setText( tr( "Start" ) );
     buttonStop->setText( tr( "Stop" ) );
     buttonCancel->setText( tr( "&Cancel" ) );
-    buttonCancel->setAccel( QKeySequence( QString::null ) );
+    buttonCancel->setShortcut( QKeySequence( QString::null ) );
     checkBuffered->setText( tr( "Buffer" ) );
     textLabel1->setText( tr( "Format" ) );
     textLabel2->setText( tr( "Directory" ) );
     buttonBrowse->setText( tr( "..." ) );
 }
 
-#include <q3filedialog.h>
-
 void CaptureWidget::buttonBrowseClicked()
 {
-  Q3FileDialog dialog("",
-                     "",
-                     this,
-                     "Save to directory dialog");
-  dialog.setCaption("Choose an output directory");
-  dialog.setMode(Q3FileDialog::AnyFile); // QFileDialog::DirectoryOnly
+/*
+  QFileDialog dialog( this );
+  dialog.setWindowTitle("Choose an output directory");
+  dialog.setMode(QFileDialog::AnyFile); 
   if (dialog.exec() == QDialog::Accepted) {
     editDirectory->setText(dialog.selectedFile());
   }
+*/
+  QString directory = QFileDialog::getExistingDirectory(this);
+  if(!directory.isNull()) {
+    editDirectory->setText(directory);
+  }
 }
 
 void CaptureWidget::buttonStartClicked()
@@ -215,13 +155,12 @@ void CaptureWidget::enableGUI(bool enable)
   editDirectory->setEnabled(value);
   buttonBrowse->setEnabled(value);
   checkBuffered->setEnabled(value);
-//   boxFormat->setEnabled(value);
   buttonStop->setEnabled(!value);
 }
 
 std::string CaptureWidget::directoryName()
 {
-  return std::string(editDirectory->text().local8Bit());
+  return std::string(editDirectory->text().toLocal8Bit());
 }
 
 bool CaptureWidget::isBuffered() {
@@ -231,18 +170,7 @@ bool CaptureWidget::isBuffered() {
 
 std::string CaptureWidget::extensionName()
 {
-//   if (radioPPM->isChecked()) {
-//     return ".ppm";
-//   } else if (radioPGM->isChecked()) {
-//     return ".pgm";
-//   } else if (radioPNG->isChecked()) {
-//     return ".png";
-//   } else if (radioJPG->isChecked()) {
-//     return ".jpg";
-//   } else {
-//     return ".ppm";
-//   }
-  return "." + std::string(editFormat->currentText().local8Bit());
+  return "." + std::string(editFormat->currentText().toLocal8Bit());
 }
 
 bool CaptureWidget::isCapturing() {
@@ -254,7 +182,13 @@ void CaptureWidget::setDirectoryName(const std::string& dir) {
 }
 
 void CaptureWidget::setExtensionName(const std::string& ext) {
-  editFormat->setCurrentText(ext.c_str());
+  std::string extension_end = ext.substr(1);
+  int extension_index = editFormat->findText(extension_end.c_str());
+  if(extension_index > 0) {
+    editFormat->addItem(extension_end.c_str());
+  } 
+
+  editFormat->setCurrentIndex(extension_index);
 }
 
 void CaptureWidget::setBuffered(bool buffer) {

+ 7 - 12
core/imagedisplay/CaptureWidget.h

@@ -3,19 +3,14 @@
 
 #include <qvariant.h>
 #include <qdialog.h>
-#include <q3filedialog.h>
-//Added by qt3to4:
-#include <Q3VBoxLayout>
-#include <Q3GridLayout>
-#include <Q3HBoxLayout>
+#include <QFileDialog>
 #include <QLabel>
 #include <memory>
 
-class Q3VBoxLayout;
-class Q3HBoxLayout;
-class Q3GridLayout;
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
 class QSpacerItem;
-class Q3ButtonGroup;
 class QRadioButton;
 class QPushButton;
 class QCheckBox;
@@ -53,11 +48,11 @@ public slots:
   virtual void buttonStopClicked();
 
 protected:
-  Q3VBoxLayout* CaptureWidgetLayout;
-  Q3HBoxLayout* layout15;
+  QVBoxLayout* CaptureWidgetLayout;
+  QHBoxLayout* layout15;
 //   QVBoxLayout* layout14;
   QSpacerItem* spacer5;
-  Q3HBoxLayout* layout11;
+  QHBoxLayout* layout11;
 
 //   QButtonGroup* boxFormat;
 //   QRadioButton* radioPPM;

+ 3 - 3
core/imagedisplay/DefaultMainWindow.cpp

@@ -13,14 +13,14 @@
 namespace NICE {
 
 DefaultMainWindow::DefaultMainWindow(const char* title) : QWidget(NULL, NULL) {
-  setCaption(title);
+  setWindowTitle(title);
 
   // create a timer waking us regularly
   timer.reset(new QTimer(this));
   timer->connect(timer.get(), SIGNAL(timeout()),
                  this, SLOT(timerSlot()));
   timerIntervalMS = 0;
-  timer->start(timerIntervalMS, false);
+  timer->start(timerIntervalMS);
 
   //ImageDisplayManagerWidget* manager =
       //new ImageDisplayManagerWidget(this, "image manager");
@@ -43,7 +43,7 @@ void DefaultMainWindow::timerSlot() {
     timer->stop();
   } else if (nextSleepMS != timerIntervalMS) {
     timerIntervalMS = nextSleepMS;
-    timer->start(timerIntervalMS, false);
+    timer->start(timerIntervalMS);
   }
 }
 

+ 18 - 28
core/imagedisplay/ImageDisplay.cpp

@@ -10,15 +10,14 @@
 #include <GL/glut.h>
 #endif
 #include <qcursor.h>
-#include <q3filedialog.h>
+#include <QFileDialog>
 #include <qapplication.h>
 #include <qpushbutton.h>
 #include <qlineedit.h>
-#include <q3buttongroup.h>
 #include <qcheckbox.h>
-//Added by qt3to4:
 #include <QContextMenuEvent>
 #include <QMouseEvent>
+#include <QMenu>
 
 #include <core/basics/Exception.h>
 #include <core/basics/FileName.h>
@@ -33,7 +32,7 @@
 namespace NICE {
 
 ImageDisplay::ImageDisplay ( QWidget* parent, const char* name, Qt::WFlags flags )
-    : QGLWidget ( parent, name, NULL, flags ),
+    : QGLWidget ( parent, NULL, flags ),
     image ( NULL ),
     colorImageBuffer ( NULL ),
     grayImageBuffer ( NULL ),
@@ -386,30 +385,23 @@ void ImageDisplay::makeDrop ( int x, int y ) {
 
 void ImageDisplay::contextMenuEvent ( QContextMenuEvent* event ) {
 
-  Q3PopupMenu* popupMenu = new Q3PopupMenu ( this );
+  QMenu* popupMenu = new QMenu ( this );
 
-  //   CHECK_PTR(popupMenu); // Qt4
-  //popupMenu->insertTearOffHandle();
   addExtraMenuItems ( popupMenu );
 
-  int saveID = popupMenu->insertItem ( "&Save image", this, SLOT ( menuSave() ) );
-  popupMenu->setAccel ( Qt::CTRL + Qt::Key_S, saveID );
+  popupMenu->addAction("&Save Image", this, SLOT ( menuSave() ), Qt::CTRL + Qt::Key_S);
+  popupMenu->addAction("&Restore aspect ratio", this, SLOT ( menuAspectRatio ), Qt::CTRL + Qt::Key_A);
 
-  int aspectID = popupMenu->insertItem ( "&Restore aspect ratio",
-                                         this, SLOT ( menuAspectRatio() ) );
-  popupMenu->setAccel ( Qt::CTRL + Qt::Key_A, aspectID );
-
-  popupMenu->insertSeparator();
-  popupMenu->insertItem ( "Start &capturing image sequence",
-                          this, SLOT ( menuStartCapture() ) );
-  popupMenu->insertItem ( "Sto&p capturing", this, SLOT ( menuStopCapture() ) );
+  popupMenu->addSeparator();
 
+  popupMenu->addAction ( "Start &capturing image sequence", this, SLOT ( menuStartCapture() ) );
+  popupMenu->addAction ( "Sto&p capturing", this, SLOT ( menuStopCapture() ) );
 
   popupMenu->exec ( QCursor::pos() );
   delete popupMenu;
 }
 
-void ImageDisplay::addExtraMenuItems ( Q3PopupMenu *popupMenu )
+void ImageDisplay::addExtraMenuItems ( QMenu *popupMenu )
 {
 }
 
@@ -420,17 +412,15 @@ void ImageDisplay::menuAspectRatio() {
 }
 
 void ImageDisplay::menuSave() {
-  QString s = Q3FileDialog::getSaveFileName (
-                "",
-                "Images (*.ppm *.pgm *.png *.jpg)",
-                this,
-                "Save file dialog",
-                "Choose a filename" );
-  if ( s.local8Bit().size() == 0 ) {
+  QString s = QFileDialog::getSaveFileName(this,
+		"Save file dialog",
+		"",
+		"Images (*.ppm, *.pgm, *.png, *.jpg)");
+  if ( s.isNull() ) {
     return;
   }
 
-  NICE::FileName filename ( s.local8Bit() );
+  NICE::FileName filename ( s.toLocal8Bit() );
   const std::string ext = filename.extractExtension().str();
   const bool extensionOk
   = ( ext == std::string ( ".ppm" ) || ext == std::string ( ".pgm" )
@@ -448,7 +438,7 @@ void ImageDisplay::menuSave() {
 void ImageDisplay::menuStartCapture() {
   if ( dialog.get() == NULL ) {
     dialog.reset ( new CaptureDialog ( this, "Capture Dialog" ) );
-    dialog->setCaption ( "Capture: " + captionBuffer );
+    dialog->setWindowTitle ( "Capture: " + captionBuffer );
     connect ( ( QObject* ) dialog->capture(), SIGNAL ( started() ),
               this, SLOT ( dialogStartCapture() ) );
     connect ( ( QObject* ) dialog->capture(), SIGNAL ( stopped() ),
@@ -485,7 +475,7 @@ void ImageDisplay::doSetCaption() {
   s << std::fixed << captionBuffer.toAscii().constData()
   << " (FPS: " << frameRateCounter.getFrameRate() << ")";
   //std::cerr << "ImageDisplay::doSetCaption(): " << s.str() << std::endl;
-  QWidget::setCaption ( s.str().c_str() );
+  QWidget::setWindowTitle ( s.str().c_str() );
 }
 
 

+ 2 - 3
core/imagedisplay/ImageDisplay.h

@@ -8,11 +8,10 @@
 
 #include <qgl.h>
 #include <qevent.h>
-#include <q3popupmenu.h>
-//Added by qt3to4:
 #include <QMouseEvent>
 #include <QContextMenuEvent>
 #include <QGLWidget>
+#include <QMenu>
 
 #include <vector>
 
@@ -258,7 +257,7 @@ protected:
    * called by contextMenuEvent(), use this to include additional
    * menu items
    */
-  virtual void addExtraMenuItems ( Q3PopupMenu *popupMenu );
+  virtual void addExtraMenuItems ( QMenu *popupMenu );
 
   //! receive mouse events
   virtual void mousePressEvent(QMouseEvent* event);

+ 8 - 10
core/imagedisplay/ImageDisplayManagerWidget.cpp

@@ -4,28 +4,26 @@
 #include <qpushbutton.h>
 #include <qlayout.h>
 #include <qtooltip.h>
-#include <q3whatsthis.h>
+
 //Added by qt3to4:
-#include <Q3VBoxLayout>
+#include <QVBoxLayout>
 
 /*
  *  Constructs a ImageDisplayManagerWidget as a child of 'parent', with the
  *  name 'name' and widget flags set to 'f'.
  */
 ImageDisplayManagerWidget::ImageDisplayManagerWidget( QWidget* parent, const char* name, Qt::WFlags fl )
-    : QWidget( parent, name, fl )
+    : QWidget( parent, fl )
 {
-    if ( !name )
-  setName( "ImageDisplayManagerWidget" );
-    ImageDisplayManagerWidgetLayout = new Q3VBoxLayout( this, 11, 6, "ImageDisplayManagerWidgetLayout");
+    ImageDisplayManagerWidgetLayout = new QVBoxLayout( this );
 
-    buttonShowAll = new QPushButton( this, "buttonShowAll" );
+    buttonShowAll = new QPushButton( this );
     ImageDisplayManagerWidgetLayout->addWidget( buttonShowAll );
 
-    buttonHideAll = new QPushButton( this, "buttonHideAll" );
+    buttonHideAll = new QPushButton( this );
     ImageDisplayManagerWidgetLayout->addWidget( buttonHideAll );
 
-    buttonDeleteAll = new QPushButton( this, "buttonDeleteAll" );
+    buttonDeleteAll = new QPushButton( this );
     ImageDisplayManagerWidgetLayout->addWidget( buttonDeleteAll );
     languageChange();
     resize( QSize(205, 133).expandedTo(minimumSizeHint()) );
@@ -51,7 +49,7 @@ ImageDisplayManagerWidget::~ImageDisplayManagerWidget()
  */
 void ImageDisplayManagerWidget::languageChange()
 {
-    setCaption( tr( "Image displays" ) );
+    setWindowTitle( tr( "Image displays" ) );
     buttonShowAll->setText( tr( "Show all images" ) );
     buttonHideAll->setText( tr( "Hide all images" ) );
     buttonDeleteAll->setText( tr( "Release (!) all images" ) );

+ 5 - 9
core/imagedisplay/ImageDisplayManagerWidget.h

@@ -3,14 +3,10 @@
 
 #include <qvariant.h>
 #include <qwidget.h>
-//Added by qt3to4:
-#include <Q3GridLayout>
-#include <Q3HBoxLayout>
-#include <Q3VBoxLayout>
-
-class Q3VBoxLayout;
-class Q3HBoxLayout;
-class Q3GridLayout;
+#include <QGridLayout>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+
 class QSpacerItem;
 class QPushButton;
 
@@ -32,7 +28,7 @@ public slots:
     virtual void buttonDeleteAll_clicked();
 
 protected:
-    Q3VBoxLayout* ImageDisplayManagerWidgetLayout;
+    QVBoxLayout* ImageDisplayManagerWidgetLayout;
 
 protected slots:
     virtual void languageChange();

+ 2 - 2
core/imagedisplay/QtFramework.cpp

@@ -94,8 +94,8 @@ int QtFramework::nonstaticExec(QWidget* _mainWindow, bool showMainWindow) {
 }
 
 int QtFramework::doExec(bool showMainWindow) {
-  //application->setMainWidget(mainWindow.get());
-  application->setMainWidget(mainWindow);
+  mainWindow->setAttribute(Qt::WA_QuitOnClose, true);
+
   if (showMainWindow) {
     mainWindow->show();
   }

+ 6 - 6
core/imagedisplay/SimpleSelector.cpp

@@ -39,27 +39,27 @@ void SimpleSelector::rectSelect(float left, float top, float right, float bottom
     updateGL();
 }
   
-void SimpleSelector::addExtraMenuItems ( Q3PopupMenu *popupMenu )
+void SimpleSelector::addExtraMenuItems ( QMenu *popupMenu )
 {
     colorMenuMap.clear();
     for ( int color = 1 ; color <= m_maxColors ; color++ )
     {
 		string caption = "Color/Class " + itostr(color);
-		int id = popupMenu->insertItem ( QString(caption.c_str()), this, SLOT(dummy()) );
-		colorMenuMap.insert ( pair<int, int> ( id, color ) );
+		QAction* action = popupMenu->addAction ( QString(caption.c_str()), this, SLOT(dummy()) );
+		colorMenuMap.insert ( pair<QAction*, int> ( action, color ) );
     }
 
     connect (popupMenu, SIGNAL(activated(int)), this, SLOT(menuActivated(int)));
-    popupMenu->insertSeparator();
+    popupMenu->addSeparator();
 }
   
 void SimpleSelector::dummy(void)
 {
 }
 
-void SimpleSelector::menuActivated ( int id ) 
+void SimpleSelector::menuActivated (QAction* action) 
 {
-    map<int, int>::const_iterator i = colorMenuMap.find(id);
+    map<QAction*, int>::const_iterator i = colorMenuMap.find(action);
     if ( i != colorMenuMap.end()  ) 
 		setCurrentColor(i->second);
 }

+ 3 - 3
core/imagedisplay/SimpleSelector.h

@@ -65,7 +65,7 @@ protected:
    * called by contextMenuEvent(), use this to include additional
    * menu items
    */
-  void addExtraMenuItems ( Q3PopupMenu *popupMenu );
+  void addExtraMenuItems ( QMenu *popupMenu );
 
   //! set current marker color
   void setCurrentColor ( int color );
@@ -81,7 +81,7 @@ private slots:
   void rectSelect(float left, float top, float right, float bottom);
 
   //! slot needed for the context menu
-  void menuActivated ( int id );
+  void menuActivated ( QAction* action );
 
   //! dummy slot for menu item insertion
   void dummy(void);
@@ -106,7 +106,7 @@ private:
   std::vector<int> m_rectanglesColor;
 
   //! this map maps menu item ids to colors
-  std::map<int, int> colorMenuMap;
+  std::map<QAction*, int> colorMenuMap;
 
 };