Active Topics

 


Reply
Thread Tools
Posts: 341 | Thanked: 57 times | Joined on Nov 2009
#1
Hey guys .. I had a simple question but one I've been unable to find a quick answer to .. I have a QDialog with many buttons and stuff in it ... A picture of it is shown here:



As you can see its very cluttered .. What I wanted to do was to make the controls layout scrollable, so that all the controls can be well sized, and to see the controls below, you simply scroll down .. That way it won't look so cluttered .. Can I set this setting using QDialog only preferably ?
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#2
With that much info, I'd be inclined to use a normal QWidget with Qt::WA_Maemo5StackedWindow set, rather than a QDialog.

Either way, I don't think you can make it scrollable as is - you'll need to put all the buttons, etc. onto another QWidget, and then interpose a QScrollArea between the top-level QWidget/QDialog and the QWidget with the buttons on.
 
Posts: 341 | Thanked: 57 times | Joined on Nov 2009
#3
Alright, well I tried adding a QScrollArea for now and adding on the widgets on the left side of the screen into that, and then adding that to the same QDialog .. But the situation has gotten worse now ..

Firstly, here's the code I was using (only the ending portion relating to adding widgets to layouts, etc ..):

Code:
mainSaveQualityModeRadioButtonsLayout = new QHBoxLayout();

    mainSaveQualityModeRadioButtonsLayout->addWidget(mainSaveUseDefaultSaveQualityRadioButton);
    mainSaveQualityModeRadioButtonsLayout->addWidget(mainSaveUseCustomSaveQualityRadioButton);

    mainSaveSliderLayout = new QHBoxLayout();
    mainSaveSliderLayout->addWidget(mainSaveQualitySlider);
    mainSaveSliderLayout->addWidget(mainSaveSliderValueLabel);

    mainSaveButtonsLayout = new QVBoxLayout();

    mainSaveButtonsLayout->addWidget(mainSaveFileNameText);
    mainSaveButtonsLayout->addWidget(mainSaveLocationButton);
    mainSaveButtonsLayout->addWidget(mainSaveFormatButton);
    mainSaveButtonsLayout->addWidget(mainSaveQualityModeLabel);
    mainSaveButtonsLayout->addLayout(mainSaveQualityModeRadioButtonsLayout);
    mainSaveButtonsLayout->addLayout(mainSaveSliderLayout);
    mainSaveButtonsLayout->addWidget(mainSaveMakeDefaultSaveSettingCheckBox);

    mainSaveScrollArea = new QScrollArea();
    mainSaveScrollArea->setLayout(mainSaveButtonsLayout);

    mainSaveMainButtonLayout = new QVBoxLayout();
    mainSaveMainButtonLayout->addWidget(mainSaveButton);

    mainSaveOverallLayout = new QHBoxLayout();
    mainSaveOverallLayout->addWidget(mainSaveScrollArea);
    mainSaveOverallLayout->addLayout(mainSaveMainButtonLayout);


    mainSaveDialog = new QDialog();
    mainSaveDialog->setLayout(mainSaveOverallLayout);

    mainSaveDialog->show();
And here is the result I achieved, with no scroll bar in view ..



Any suggestions .. ?
 
Posts: 3,617 | Thanked: 2,412 times | Joined on Nov 2009 @ Cambridge, UK
#4
Originally Posted by ahmadka View Post
Any suggestions .. ?
I think you'll need to put the layout onto a QWidget, then put that in the QScrollArea. You can then set a minimum size for the QWidget.
 
Reply


 
Forum Jump


All times are GMT. The time now is 11:02.