Emit a signal when an item gets selected

This commit is contained in:
Martin Gräßlin 2011-12-02 10:48:04 +01:00
parent e873efdc99
commit ff8c0e3f8f
4 changed files with 4 additions and 0 deletions

View file

@ -330,6 +330,7 @@ TabBox::TabBox(QObject *parent)
m_desktopListConfig.setLayout(TabBoxConfig::VerticalLayout);
m_tabBox = new TabBoxHandlerImpl(this);
connect(m_tabBox, SIGNAL(ready()), SLOT(handlerReady()));
connect(m_tabBox, SIGNAL(selectedIndexChanged()), SIGNAL(itemSelected()));
m_tabBoxMode = TabBoxDesktopMode; // init variables
connect(&m_delayedShowTimer, SIGNAL(timeout()), this, SLOT(show()));

View file

@ -220,6 +220,7 @@ public slots:
signals:
void tabBoxAdded(int);
Q_SCRIPTABLE void tabBoxClosed();
Q_SCRIPTABLE void itemSelected();
void tabBoxUpdated();
void tabBoxKeyEvent(QKeyEvent*);

View file

@ -559,6 +559,7 @@ void TabBoxHandler::setCurrentIndex(const QModelIndex& index)
d->updateHighlightWindows();
}
}
emit selectedIndexChanged();
}
const QModelIndex& TabBoxHandler::currentIndex() const

View file

@ -359,6 +359,7 @@ signals:
void configChanged();
void ready();
void embeddedChanged(bool enabled);
void selectedIndexChanged();
private:
friend class TabBoxHandlerPrivate;