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.
//GETTING ERROR ON THE FOLLOWING TWO LINES
int width = sizeHint().width();
int height = sizeHint().height();
//set width and height of the glwindow - WHICH IS THE WIDGET OF ANOTHER TYPE
m_glWindow->width->setValue(width);
m_glWindow->height->setValue(height);
setCentralWidget(m_glWindow);
//GETTING ERROR ON THE FOLLOWING TWO LINES
int width = sizeHint().width();
int height = sizeHint().height();
//set width and height of the glwindow - WHICH IS THE WIDGET OF ANOTHER TYPE
m_glWindow->width->setValue(width);
m_glWindow->height->setValue(height);
setCentralWidget(m_glWindow);
To copy to clipboard, switch view to plain text mode
The error that i got is :
H3DMainWindow.cpp:24: warning: when initialized here
H3DMainWindow.cpp:52: error: request for member ‘width’ is ambiguous
/usr
/local
/Trolltech
/Qt
-4.8.0
/include
/QtGui
/qpaintdevice.
h:91: error
: candidates are
: int QPaintDevice::width() const /usr
/local
/Trolltech
/Qt
-4.8.0
/include
/QtGui
/qwidget.
h:1026: error
: int QWidget::width() const /usr/local/include/H3D/H3DWindowNode.h:267: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::width
H3DMainWindow.cpp:53: error: request for member ‘height’ is ambiguous
/usr
/local
/Trolltech
/Qt
-4.8.0
/include
/QtGui
/qpaintdevice.
h:92: error
: candidates are
: int QPaintDevice::height() const /usr
/local
/Trolltech
/Qt
-4.8.0
/include
/QtGui
/qwidget.
h:1029: error
: int QWidget::height() const /usr/local/include/H3D/H3DWindowNode.h:273: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::height
H3DMainWindow.cpp: At global scope:
H3DMainWindow.cpp:369: warning: unused parameter ‘fileName’
make: *** [H3DMainWindow.o] Error 1
sajjad@sajjad:~/Documents/H3DViewer$
H3DMainWindow.cpp:24: warning: when initialized here
H3DMainWindow.cpp:52: error: request for member ‘width’ is ambiguous
/usr/local/Trolltech/Qt-4.8.0/include/QtGui/qpaintdevice.h:91: error: candidates are: int QPaintDevice::width() const
/usr/local/Trolltech/Qt-4.8.0/include/QtGui/qwidget.h:1026: error: int QWidget::width() const
/usr/local/include/H3D/H3DWindowNode.h:267: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::width
H3DMainWindow.cpp:53: error: request for member ‘height’ is ambiguous
/usr/local/Trolltech/Qt-4.8.0/include/QtGui/qpaintdevice.h:92: error: candidates are: int QPaintDevice::height() const
/usr/local/Trolltech/Qt-4.8.0/include/QtGui/qwidget.h:1029: error: int QWidget::height() const
/usr/local/include/H3D/H3DWindowNode.h:273: error: std::auto_ptr<H3D::SFInt32> H3D::H3DWindowNode::height
H3DMainWindow.cpp: At global scope:
H3DMainWindow.cpp:369: warning: unused parameter ‘fileName’
make: *** [H3DMainWindow.o] Error 1
sajjad@sajjad:~/Documents/H3DViewer$
To copy to clipboard, switch view to plain text mode
Any hint to get around ?
Regards
Sajjad
Bookmarks