Exemple #1
0
CKeyChooser::CKeyChooser(const BtConstModuleList &,
                         BTHistory * historyPtr,
                         QWidget * parent)
    : QWidget(parent)
    , m_history(historyPtr)
{
    bool ok = QObject::connect(history(), SIGNAL(historyMoved(QString)),
                               this,      SLOT(setKey(const QString &)));
    Q_ASSERT(ok);
}
void BTHistory::move(QAction* historyItem) {
    //BT_ASSERT(historyItem);
    BT_ASSERT(m_historyList.count());

    m_inHistoryFunction = true;
    //find the action in the list
    m_index = m_historyList.indexOf(historyItem);
    //move to the selected item in the list, it will be the current item
    emit historyMoved(m_historyList.at(m_index)->property(ActionText).toString()); // signal to "outsiders"; key has been changed
    sendChangedSignal();

    m_inHistoryFunction = false;
    BT_ASSERT(class_invariant());
}
void BTHistory::move(QAction* historyItem)
{
	qDebug("BTHistory::move");
	//Q_ASSERT(historyItem);
	Q_ASSERT(m_historyList.count());

	m_inHistoryFunction = true;
	//find the action in the list
	m_index = m_historyList.indexOf(historyItem);
	//move to the selected item in the list, it will be the current item
	QString newKey = m_historyList.at(m_index)->text();
	emit historyMoved(newKey); // signal to "outsiders"; key has been changed
	sendChangedSignal();
	
	m_inHistoryFunction = false;
	Q_ASSERT(class_invariant());
}