[vlmc-devel] MainWindow: Add "scaleChanged" signal

Yikai Lu git at videolan.org
Sat Jul 16 17:24:23 CEST 2016


vlmc | branch: master | Yikai Lu <luyikei.qmltu at gmail.com> | Sun Jul 17 00:09:30 2016 +0900| [d90303f4ee973cfed82c0af056765acccf3972e2] | committer: Yikai Lu

MainWindow: Add "scaleChanged" signal

> https://code.videolan.org/videolan/vlmc/commit/d90303f4ee973cfed82c0af056765acccf3972e2
---

 src/Gui/MainWindow.cpp | 4 ++++
 src/Gui/MainWindow.h   | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/Gui/MainWindow.cpp b/src/Gui/MainWindow.cpp
index 9415960..3793ea4 100644
--- a/src/Gui/MainWindow.cpp
+++ b/src/Gui/MainWindow.cpp
@@ -411,6 +411,10 @@ MainWindow::createStatusBar()
     m_ui.statusbar->addPermanentWidget( zoomInButton );
     connect( zoomInButton, SIGNAL( clicked() ),
              this, SLOT( zoomIn() ) );
+    connect( m_zoomSlider, &QSlider::valueChanged, this, [this]( int val )
+    {
+        emit scaleChanged( ( val + 1 ) / (double)( m_zoomSlider->maximum() + 1 ) );
+    } );
 }
 
 void
diff --git a/src/Gui/MainWindow.h b/src/Gui/MainWindow.h
index bc58f6e..3171b9b 100644
--- a/src/Gui/MainWindow.h
+++ b/src/Gui/MainWindow.h
@@ -166,6 +166,7 @@ private slots:
 
 signals:
     void                    toolChanged( ToolButtons );
+    void                    scaleChanged( double scaleLevel );
 };
 
 #endif // MAINWINDOW_H



More information about the Vlmc-devel mailing list