From 5fd9b12a15bf89f7f050fc42311fae378c672bd2 Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sat, 25 Sep 2021 13:32:43 -0400 Subject: [PATCH] Added tool tips to libav options window. --- src/drivers/Qt/AviRecord.cpp | 17 ++++++++++++----- src/drivers/Qt/AviRecord.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/drivers/Qt/AviRecord.cpp b/src/drivers/Qt/AviRecord.cpp index 02c80fbe..aca54eab 100644 --- a/src/drivers/Qt/AviRecord.cpp +++ b/src/drivers/Qt/AviRecord.cpp @@ -943,7 +943,7 @@ int loadCodecConfig( int type, const char *codec_name, AVCodecContext *ctx) //{ // continue; //} - printf("'%s.%s' = '%s'\n", section, id, val); + //printf("'%s.%s' = '%s'\n", section, id, val); obj = ctx; child = NULL; @@ -3299,6 +3299,10 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent) tree->setHeaderItem(itemHdr); + tree->horizontalScrollBar()->setEnabled(true); + tree->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); + + tree->header()->setStretchLastSection(true); tree->header()->setSectionResizeMode(QHeaderView::ResizeToContents); //printf("CTX Class: %s\n", ctx->av_class->class_name ); @@ -3362,6 +3366,8 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent) if ( opt->help ) { item->setText(2, QString::fromStdString(opt->help)); + item->setToolTip( 0, tr(opt->help) ); + item->setToolTip( 1, tr(opt->help) ); } item->setValueText(); @@ -3369,7 +3375,6 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent) item->setTextAlignment(1, Qt::AlignLeft); item->setTextAlignment(2, Qt::AlignLeft); - //tree->addTopLevelItem(item); groupItem->addChild(item); } else @@ -3396,6 +3401,8 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent) obj = ctx_child = av_opt_child_next( ctx, ctx_child ); } + tree->resizeColumnToContents(2); + //connect( tree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), this, SLOT(hotKeyDoubleClicked(QTreeWidgetItem*,int) ) ); connect( tree, SIGNAL(itemActivated(QTreeWidgetItem*,int)), this, SLOT(itemChangeActivated(QTreeWidgetItem*,int) ) ); @@ -3420,14 +3427,14 @@ LibavEncOptWin::LibavEncOptWin(int type, QWidget *parent) //---------------------------------------------------------------------------- LibavEncOptWin::~LibavEncOptWin(void) { - printf("Destroy Encoder Options Config Window\n"); + //printf("Destroy Encoder Options Config Window\n"); LIBAV::saveCodecConfig(type, codec_name, ctx); } //---------------------------------------------------------------------------- void LibavEncOptWin::closeEvent(QCloseEvent *event) { - printf("Encoder Options Close Window Event\n"); + //printf("Encoder Options Close Window Event\n"); done(0); deleteLater(); event->accept(); @@ -3796,7 +3803,7 @@ LibavEncOptInputWin::~LibavEncOptInputWin(void) //---------------------------------------------------------------------------- void LibavEncOptInputWin::closeEvent(QCloseEvent *event) { - printf("Encoder Options Close Window Event\n"); + //printf("Encoder Options Close Window Event\n"); done(0); deleteLater(); event->accept(); diff --git a/src/drivers/Qt/AviRecord.h b/src/drivers/Qt/AviRecord.h index 47862f7c..a887682a 100644 --- a/src/drivers/Qt/AviRecord.h +++ b/src/drivers/Qt/AviRecord.h @@ -19,6 +19,7 @@ #include #include #include +#include #include #include