Have the editor list combo adjust size to contents

Now the box will grow larger when files with long filenames are opened.
This commit is contained in:
Thorbjørn Lindeijer
2009-01-19 11:03:23 +01:00
parent cc5ff1ec74
commit 8d1edf7252

View File

@@ -79,6 +79,7 @@ StackedEditorGroup::StackedEditorGroup(QWidget *parent) :
tl->setMargin(0);
{
m_editorList->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_editorList->setSizeAdjustPolicy(QComboBox::AdjustToContents);
m_editorList->setMinimumContentsLength(20);
m_proxyModel.setSourceModel(model());
m_proxyModel.sort(0);
@@ -296,9 +297,9 @@ void StackedEditorGroup::setCurrentEditor(IEditor *editor)
void StackedEditorGroup::checkEditorStatus()
{
IEditor *editor = qobject_cast<IEditor *>(sender());
if (editor == currentEditor())
updateEditorStatus(editor);
IEditor *editor = qobject_cast<IEditor *>(sender());
if (editor == currentEditor())
updateEditorStatus(editor);
}
void StackedEditorGroup::updateEditorStatus(IEditor *editor)