#include "tabwidgetselectalgorithm.h" TabWidgetSelectAlgorithm::TabWidgetSelectAlgorithm(QWidget *parent) : QTabWidget(parent) { //Create the Widgets for Algorithm-Selection m_nullCipher = new QWidget(this); m_symmetric = new TabSymmetric(this); m_asymmetric = new TabAsymmetric(this); m_hybrid = new TabHybrid(this); //Add those Widgets as Tabs addTab(m_nullCipher, "NullCipher"); addTab(m_symmetric, "Symmetric"); addTab(m_asymmetric, "Asymmetric"); addTab(m_hybrid, "Hybrid"); connect( this, SIGNAL(currentChanged(int)), this, SLOT(oncurrentChanged_triggered(int))); //Send Selection from SubTabs on: Ciphers connect( m_symmetric, SIGNAL(cipherChanged(int)), this, SIGNAL(cipherChanged(int)) ); connect( m_asymmetric, SIGNAL(cipherChanged(int)), this, SIGNAL(cipherChanged(int)) ); connect( m_hybrid, SIGNAL(cipherChanged(int)), this, SIGNAL(cipherChanged(int)) ); //Send Selection from SubTabs on: KeyLength connect( m_symmetric, SIGNAL(keyLengthChanged(int, bool)), this, SIGNAL(keyLengthChanged(int,bool))); connect( m_asymmetric, SIGNAL(keyLengthChanged(int, bool)), this, SIGNAL(keyLengthChanged(int,bool))); connect( m_hybrid, SIGNAL(keyLengthChanged(int, bool)), this, SIGNAL(keyLengthChanged(int,bool))); } //public slots: void TabWidgetSelectAlgorithm::onNullCipher_selected() { setCurrentWidget(m_nullCipher); } void TabWidgetSelectAlgorithm::onSymmetric_selected() { setCurrentWidget(m_symmetric); } void TabWidgetSelectAlgorithm::onAsymmetric_selected() { setCurrentWidget(m_asymmetric); } void TabWidgetSelectAlgorithm::onHybrid_selected() { setCurrentWidget(m_hybrid); } // private slots: void TabWidgetSelectAlgorithm::oncurrentChanged_triggered(int index) { QString tabName; if( currentWidget() == m_nullCipher ) tabName = "NullCipher"; else if( currentWidget() == m_symmetric ) tabName = "Symmetric"; else if( currentWidget() == m_asymmetric ) tabName = "Asymmetric"; else if( currentWidget() == m_hybrid ) tabName = "Hybrid"; emit (currentTabChanged( tabName )); }