Sort encoder options alphabetically.

This commit is contained in:
mjbudd77 2021-09-25 18:08:36 -04:00
parent 2212dbacab
commit a3ddca2f4a
2 changed files with 17 additions and 2 deletions

View File

@ -3038,8 +3038,8 @@ void LibavOptionsPage::initCodecLists(void)
initSampleRateSelect( audioEncSel->currentText().toStdString().c_str() ); initSampleRateSelect( audioEncSel->currentText().toStdString().c_str() );
initChannelLayoutSelect( audioEncSel->currentText().toStdString().c_str() ); initChannelLayoutSelect( audioEncSel->currentText().toStdString().c_str() );
videoEncSel->model()->sort(0); videoEncSel->model()->sort(0, Qt::AscendingOrder);
audioEncSel->model()->sort(0); audioEncSel->model()->sort(0, Qt::AscendingOrder);
} }
//----------------------------------------------------- //-----------------------------------------------------
void LibavOptionsPage::includeAudioChanged(bool checked) void LibavOptionsPage::includeAudioChanged(bool checked)
@ -3403,6 +3403,7 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent)
} }
obj = ctx_child = av_opt_child_next( ctx, ctx_child ); obj = ctx_child = av_opt_child_next( ctx, ctx_child );
} }
sortItems();
tree->resizeColumnToContents(2); tree->resizeColumnToContents(2);
@ -3467,6 +3468,19 @@ void LibavEncOptWin::resetDefaultsCB(void)
updateItems(); updateItems();
} }
//----------------------------------------------------- //-----------------------------------------------------
void LibavEncOptWin::sortItems(void)
{
QTreeWidgetItem *groupItem;
for (int i=0; i<tree->topLevelItemCount(); i++)
{
groupItem = tree->topLevelItem(i);
groupItem->sortChildren(0, Qt::AscendingOrder);
}
tree->viewport()->update();
}
//-----------------------------------------------------
void LibavEncOptWin::updateItems(void) void LibavEncOptWin::updateItems(void)
{ {
QTreeWidgetItem *groupItem; QTreeWidgetItem *groupItem;

View File

@ -160,6 +160,7 @@ public:
protected: protected:
void closeEvent(QCloseEvent *event); void closeEvent(QCloseEvent *event);
void updateItems(void); void updateItems(void);
void sortItems(void);
int type; int type;
QTreeWidget *tree; QTreeWidget *tree;