Пример #1
0
void DogQtUi::connectSignalsAndSlots() {
    // add a connection: function listItemChanged() will be called when an item in the list is selected
    QObject::connect(this->repoList, SIGNAL(itemSelectionChanged()), this, SLOT(listItemChanged()));
    QObject::connect(this->adoptList, SIGNAL(itemSelectionChanged()), this, SLOT(listItemChanged()));

    // add button connections
    QObject::connect(this->addButton, SIGNAL(clicked()), this, SLOT(addDog()));
    QObject::connect(this->deleteButton, SIGNAL(clicked()), this, SLOT(deleteDog()));
    QObject::connect(this->updateButton, SIGNAL(clicked()), this, SLOT(updateDog()));
    QObject::connect(this->moveOneDogButton, SIGNAL(clicked()), this, SLOT(moveDogToAlbum()));
    QObject::connect(this->moveAllDogsButton, SIGNAL(clicked()), this, SLOT(moveAllDogsToAlbum()));
    QObject::connect(this->showDog, SIGNAL(clicked()), this, SLOT(openPhoto()));
}
Пример #2
0
void QT1::connectSignalsAndSlots()
{
	QObject::connect(this->repoList, SIGNAL(itemSelectionChanged()), this, SLOT(listItemChanged()));


	QObject::connect(this->addButton, SIGNAL(clicked()), this, SLOT(addNewDog()));
	QObject::connect(this->deleteButton, SIGNAL(clicked()), this, SLOT(deleteDog()));
	QObject::connect(this->filterButton, SIGNAL(clicked()), this, SLOT(filterRepoDogs()));



}