Hello forum

I have subclass the QMainWindow and it contains another widget as a central widget. The size of the central widget depends on the size of the widget. I am trying to set the widget size inside the constructor of the subclassed QMainWindow.


Qt Code:
  1. //GETTING ERROR ON THE FOLLOWING TWO LINES
  2. int width = sizeHint().width();
  3. int height = sizeHint().height();
  4.  
  5. //set width and height of the glwindow - WHICH IS THE WIDGET OF ANOTHER TYPE
  6. m_glWindow->width->setValue(width);
  7. m_glWindow->height->setValue(height);
  8.  
  9. setCentralWidget(m_glWindow);
To copy to clipboard, switch view to plain text mode 


The error that i got is :


Qt Code:
  1. H3DMainWindow.cpp:24: warning: when initialized here
  2. H3DMainWindow.cpp:52: error: request for member ‘width’ is ambiguous
  3. /usr/local/Trolltech/Qt-4.8.0/include/QtGui/qpaintdevice.h:91: error: candidates are: int QPaintDevice::width() const
  4. /usr/local/Trolltech/Qt-4.8.0/include/QtGui/qwidget.h:1026: error: int QWidget::width() const
  5. /usr/local/include/H3D/H3DWindowNode.h:267: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::width
  6. H3DMainWindow.cpp:53: error: request for member ‘height’ is ambiguous
  7. /usr/local/Trolltech/Qt-4.8.0/include/QtGui/qpaintdevice.h:92: error: candidates are: int QPaintDevice::height() const
  8. /usr/local/Trolltech/Qt-4.8.0/include/QtGui/qwidget.h:1029: error: int QWidget::height() const
  9. /usr/local/include/H3D/H3DWindowNode.h:273: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::height
  10. H3DMainWindow.cpp: At global scope:
  11. H3DMainWindow.cpp:369: warning: unused parameter ‘fileName’
  12. make: *** [H3DMainWindow.o] Error 1
  13. sajjad@sajjad:~/Documents/H3DViewer$
To copy to clipboard, switch view to plain text mode 



Any hint to get around ?



Regards
Sajjad