diff --git a/kmplot/calculator.cpp b/kmplot/calculator.cpp --- a/kmplot/calculator.cpp +++ b/kmplot/calculator.cpp @@ -42,9 +42,8 @@ QWidget * widget = new QWidget( this ); setWindowTitle( i18n("Calculator") ); - QVBoxLayout *layout = new QVBoxLayout( widget ); - layout->setMargin( 0 ); - + QVBoxLayout *layout = new QVBoxLayout( this ); + m_display = new KTextEdit( widget ); QSizePolicy displaySizePolicy = m_display->sizePolicy(); displaySizePolicy.setVerticalStretch( 10 ); diff --git a/kmplot/equationeditor.cpp b/kmplot/equationeditor.cpp --- a/kmplot/equationeditor.cpp +++ b/kmplot/equationeditor.cpp @@ -40,7 +40,9 @@ setWindowTitle(i18n("Equation Editor")); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, &QDialogButtonBox::rejected, this, &EquationEditor::reject); - m_widget->layout()->addWidget(buttonBox); + QVBoxLayout *dialogLayout = new QVBoxLayout (this); + dialogLayout->addWidget (m_widget); + dialogLayout->addWidget (buttonBox); connect(m_widget->edit, &EquationEdit::returnPressed, this, &EquationEditor::accept); } diff --git a/kmplot/functiontools.cpp b/kmplot/functiontools.cpp --- a/kmplot/functiontools.cpp +++ b/kmplot/functiontools.cpp @@ -45,10 +45,9 @@ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, &QDialogButtonBox::rejected, this, &FunctionTools::reject); - m_widget->layout()->addWidget(buttonBox); - - // Adjust margins - m_widget->layout()->setMargin( 0 ); + QVBoxLayout *dialogLayout = new QVBoxLayout (this); + dialogLayout->addWidget (m_widget); + dialogLayout->addWidget (buttonBox); init( CalculateArea ); diff --git a/kmplot/kconstanteditor.cpp b/kmplot/kconstanteditor.cpp --- a/kmplot/kconstanteditor.cpp +++ b/kmplot/kconstanteditor.cpp @@ -57,7 +57,9 @@ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, &QDialogButtonBox::rejected, this, &KConstantEditor::reject); - m_widget->gridLayout->addWidget(buttonBox, 4, 1, 1, 1); + QVBoxLayout *dialogLayout = new QVBoxLayout (this); + dialogLayout->addWidget(m_widget); + dialogLayout->addWidget(buttonBox); m_widget->cmdNew->setIcon( QIcon::fromTheme("document-new") ); m_widget->cmdDelete->setIcon( QIcon::fromTheme("edit-delete") ); diff --git a/kmplot/kgradientdialog.cpp b/kmplot/kgradientdialog.cpp --- a/kmplot/kgradientdialog.cpp +++ b/kmplot/kgradientdialog.cpp @@ -392,7 +392,7 @@ connect(buttonBox, &QDialogButtonBox::rejected, this, &KGradientDialog::reject); //BEGIN layout widgets - QVBoxLayout * layout = new QVBoxLayout( widget ); + QVBoxLayout * layout = new QVBoxLayout( this ); layout->setMargin( 0 ); m_gradient->setFixedHeight( 24 ); diff --git a/kmplot/ksliderwindow.cpp b/kmplot/ksliderwindow.cpp --- a/kmplot/ksliderwindow.cpp +++ b/kmplot/ksliderwindow.cpp @@ -95,14 +95,12 @@ setModal( false ); QWidget * widget = new QWidget( this ); setWindowTitle( i18n("Sliders") ); - QVBoxLayout *layout = new QVBoxLayout( widget ); - setLayout(layout); + + QVBoxLayout *layout = new QVBoxLayout( this ); layout->addWidget(widget); Q_ASSERT( SLIDER_COUNT == 4 ); // safety check, in case SLIDER_COUNT is increased but not this code - - layout->setMargin( 0 ); - + for ( int i = 0; i < SLIDER_COUNT; ++i ) { m_sliders[i] = new SliderWidget( widget, i ); diff --git a/kmplot/parameteranimator.cpp b/kmplot/parameteranimator.cpp --- a/kmplot/parameteranimator.cpp +++ b/kmplot/parameteranimator.cpp @@ -64,7 +64,10 @@ setWindowTitle( i18n("Parameter Animator") ); QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); connect(buttonBox, &QDialogButtonBox::rejected, this, &ParameterAnimator::reject); - m_widget->layout()->addWidget(buttonBox); + + QVBoxLayout *dialogLayout = new QVBoxLayout( this ); + dialogLayout->addWidget(m_widget); + dialogLayout->addWidget(buttonBox); m_mode = Paused; m_currentValue = 0;