Fix clang warning: 'RSGraphWidget::sizeHint' hides overloaded virtual

function

/retroshare-gui/src/gui/common/RSGraphWidget.h:173: warning:
'RSGraphWidget::sizeHint' hides overloaded virtual function [-
Woverloaded-virtual]
        virtual QSizeF sizeHint( Qt::SizeHint which, const QSizeF &
constraint = QSizeF() ) const;
/usr/include/qt4/QtGui/qframe.h:76: hidden overloaded virtual function
'QFrame::sizeHint' declared here: different number of parameters (0 vs
2)
    QSize sizeHint() const;
This commit is contained in:
Phenom 2017-07-15 18:32:53 +02:00 committed by csoler
parent 300359863e
commit 1f39789f2e
2 changed files with 17 additions and 16 deletions

View File

@ -362,21 +362,21 @@ void RSGraphWidget::paintEvent(QPaintEvent *)
_painter->end();
}
QSizeF RSGraphWidget::sizeHint(Qt::SizeHint which, const QSizeF& /* constraint */) const
{
float FS = QFontMetricsF(font()).height();
//float fact = FS/14.0 ;
switch(which)
{
default:
case Qt::MinimumSize:
case Qt::PreferredSize:
return QSizeF(70*FS,12*FS);
case Qt::MaximumSize:
return QSizeF(700*FS,120*FS);
}
}
//QSizeF RSGraphWidget::sizeHint(Qt::SizeHint which, const QSizeF& /* constraint */) const
//{
// float FS = QFontMetricsF(font()).height();
// //float fact = FS/14.0 ;
//
// switch(which)
// {
//default:
// case Qt::MinimumSize:
// case Qt::PreferredSize:
// return QSizeF(70*FS,12*FS);
// case Qt::MaximumSize:
// return QSizeF(700*FS,120*FS);
// }
//}
QColor RSGraphWidget::getColor(const std::string& name)
{

View File

@ -170,7 +170,8 @@ protected:
/** Overloaded QWidget::paintEvent() */
void paintEvent(QPaintEvent *event);
virtual QSizeF sizeHint( Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const;
//QSize QFrame::sizeHint() const;
// virtual QSizeF sizeHint( Qt::SizeHint which, const QSizeF & constraint = QSizeF() ) const;
protected slots:
void updateIfPossible() ;