Merge pull request #6218 from ctrlaltdavid/20719

20719 Fix audio stats dialog box not being sized properly
This commit is contained in:
Brad Hefta-Gaub 2015-10-29 08:16:56 -07:00
commit 21decaaf8e
2 changed files with 5 additions and 7 deletions

View file

@ -65,11 +65,12 @@ AudioStatsDialog::AudioStatsDialog(QWidget* parent) :
// Get statistics from the Audio Client
_stats = &DependencyManager::get<AudioClient>()->getStats();
// Create layouter
// Create layout
_form = new QFormLayout();
_form->setSizeConstraint(QLayout::SetFixedSize);
QDialog::setLayout(_form);
// Load and initilize all channels
// Load and initialize all channels
renderStats();
_audioDisplayChannels = QVector<QVector<AudioStatsDisplay*>>(1);
@ -80,10 +81,8 @@ AudioStatsDialog::AudioStatsDialog(QWidget* parent) :
_downstreamID = addChannel(_form, _downstreamStats, COLOR3);
_upstreamInjectedID = addChannel(_form, _upstreamInjectedStats, COLOR0);
connect(averageUpdateTimer, SIGNAL(timeout()), this, SLOT(updateTimerTimeout()));
averageUpdateTimer->start(1000);
}
int AudioStatsDialog::addChannel(QFormLayout* form, QVector<QString>& stats, const unsigned color) {
@ -243,7 +242,6 @@ void AudioStatsDialog::paintEvent(QPaintEvent* event) {
}
QDialog::paintEvent(event);
setFixedSize(width(), height());
}
void AudioStatsDialog::reject() {

View file

@ -72,8 +72,9 @@ BandwidthDialog::BandwidthDialog(QWidget* parent) :
this->setWindowTitle("Bandwidth Details");
// Create layouter
// Create layout
QFormLayout* form = new QFormLayout();
form->setSizeConstraint(QLayout::SetFixedSize);
this->QDialog::setLayout(form);
QSharedPointer<BandwidthRecorder> bandwidthRecorder = DependencyManager::get<BandwidthRecorder>();
@ -118,7 +119,6 @@ void BandwidthDialog::paintEvent(QPaintEvent* event) {
for (unsigned int i=0; i<_CHANNELCOUNT; i++)
_allChannelDisplays[i]->paint();
this->QDialog::paintEvent(event);
this->setFixedSize(this->width(), this->height());
}
void BandwidthDialog::reject() {