update gui

This commit is contained in:
Logan McNaughton committed 2022-07-18 22:13:25 -06:00
1 parent 29458b2c6e
commit f252e1e6ae
2 files changed
+11 -7

No files matched your search

+1 -1
View File
@@ -381,7 +381,7 @@ MainWindow::MainWindow(QWidget *parent) :
if (!settings->contains("volume"))
settings->setValue("volume", 100);
VolumeAction * volumeAction = new VolumeAction(tr("Volume"));
VolumeAction * volumeAction = new VolumeAction(tr("Volume"), this);
connect(volumeAction->slider(), SIGNAL(valueChanged(int)), this, SLOT(volumeValueChanged(int)));
volumeAction->slider()->setValue(settings->value("volume").toInt());
ui->menuEmulation->insertAction(ui->actionMute, volumeAction);
+10 -6
View File
@@ -157,13 +157,13 @@ extern MainWindow *w;
class VolumeAction : public QWidgetAction {
public:
VolumeAction (const QString& title) :
QWidgetAction (NULL) {
QWidget* pWidget = new QWidget (NULL);
QHBoxLayout* pLayout = new QHBoxLayout();
QLabel* pLabel = new QLabel (title);
VolumeAction (const QString& title, QObject* parent) :
QWidgetAction (parent) {
QWidget* pWidget = new QWidget;
QHBoxLayout* pLayout = new QHBoxLayout(pWidget);
QLabel* pLabel = new QLabel (title, pWidget);
pLayout->addWidget (pLabel);
pSlider = new QSlider(Qt::Horizontal);
pSlider = new QSlider(Qt::Horizontal, pWidget);
pSlider->setMinimum(0);
pSlider->setMaximum(100);
pLayout->addWidget (pSlider);
@@ -171,6 +171,10 @@ public:
setDefaultWidget(pWidget);
}
void releaseWidget(QWidget* widget)
{
widget->deleteLater();
}
QSlider * slider () {
return pSlider;