Commit cbdbf7a5 authored by Mathias Goldau's avatar Mathias Goldau

[FIX] Double and Int PropertyWidgets will no display some space under Mac OS X...

[FIX] Double and Int PropertyWidgets will no display some space under Mac OS X too. Reset the spacing policy back to default in the hope that it will work on other platforms as well. The reason why it does not worked was propbably that the maximumSize was set to the suggested minimum size, I do not know WHY this has been working under OTHER platforms...
parent 7ef40c73
......@@ -42,10 +42,6 @@ WPropertyDoubleWidget::WPropertyDoubleWidget( WPropDouble property, QGridLayout*
m_asText( &m_informationWidgets ),
m_infoLayout( &m_informationWidgets )
{
// initialize members
m_edit.resize( m_edit.minimumSizeHint().width() *.8 , m_edit.size().height() );
m_edit.setMaximumWidth( m_edit.minimumSizeHint().width() );
// layout both against each other
m_layout.addWidget( &m_slider );
m_layout.addWidget( &m_edit );
......@@ -120,24 +116,10 @@ void WPropertyDoubleWidget::update()
m_slider.setMinimum( 0 );
m_slider.setMaximum( 100 );
// calculate maximum size of the text widget.
// XXX: this is not the optimal way but works for now
// int length = m_min < 0 ? 5 : 4; // reserve some extra space for the "-" in negative numbers
// double fmax = std::max( std::abs( m_min ), std::abs( m_max ) ); // use the number with the most numbers
// while ( ( fmax / 10 ) >= 1.0 )
// {
// ++length;
// fmax /= 10.0;
// }
int length = 6; // use fixed length to have a uniform look among several widgets
// resize the text widget
//m_edit.setMaxLength( length );
m_edit.setMaximumWidth( m_edit.minimumSizeHint().width() * length / 2 );
// m_edit.setMinimumWidth( m_edit.minimumSizeHint().width() * length / 4 );
// m_edit.resize( m_edit.minimumSizeHint().width() * length / 2, m_edit.size().height() );
// set the initial values
// // calculate maximum size of the text widget.
// // XXX: this is not the optimal way but works for now
// NO, it doesn't work on Mac OS X: You won't be able to any digits in it!, So I reset it to default which should work on other platforms too
QString valStr = QString( toString( m_doubleProperty->get() ).c_str() );
m_edit.setText( valStr );
m_slider.setValue( toPercent( m_doubleProperty->get() ) );
......
......@@ -43,10 +43,6 @@ WPropertyIntWidget::WPropertyIntWidget( WPropInt property, QGridLayout* property
m_asText( &m_informationWidgets ),
m_infoLayout( &m_informationWidgets )
{
// initialize members
m_edit.resize( m_edit.minimumSizeHint().width(), m_edit.size().height() );
m_edit.setMaximumWidth( m_edit.minimumSizeHint().width() );
// layout both against each other
m_layout.addWidget( &m_slider );
m_layout.addWidget( &m_edit );
......@@ -105,22 +101,9 @@ void WPropertyIntWidget::update()
m_slider.setMinimum( min );
m_slider.setMaximum( max );
// calculate maximum size of the text widget.
// XXX: this is not the optimal way but works for now
// int length = min < 0 ? 3 : 2; // reserve some extra space for the "-" in negative numbers
// float fmax = static_cast<float>( std::max( std::abs( min ), std::abs( max ) ) ); // use the number with the most numbers
// while ( ( fmax / 10 ) >= 1.0 )
// {
// ++length;
// fmax /= 10.0;
// }
int length = 6; // use fixed length to have a uniform look among several widgets
// resize the text widget
// m_edit.setMaxLength( length );
m_edit.setMaximumWidth( m_edit.minimumSizeHint().width() * length / 2 );
// m_edit.setMinimumWidth( m_edit.minimumSizeHint().width() * length / 4 );
// m_edit.resize( m_edit.minimumSizeHint().width() * length / 4, m_edit.size().height() );
// // calculate maximum size of the text widget.
// // XXX: this is not the optimal way but works for now
// Same as in WPropertyDouble.cpp: This does not work as expected on Mac OS X => reset to default
// set the initial values
QString valStr = QString( boost::lexical_cast< std::string >( m_intProperty->get() ).c_str() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment