CategoryFiltersList::CategoryFiltersList(QWidget *parent, TransferListWidget *transferList) : FiltersBase(parent, transferList) { connect(BitTorrent::Session::instance(), SIGNAL(torrentCategoryChanged(BitTorrent::TorrentHandle *const, QString)), SLOT(torrentCategoryChanged(BitTorrent::TorrentHandle *const, QString))); connect(BitTorrent::Session::instance(), SIGNAL(categoryAdded(QString)), SLOT(addItem(QString))); connect(BitTorrent::Session::instance(), SIGNAL(categoryRemoved(QString)), SLOT(categoryRemoved(QString))); connect(BitTorrent::Session::instance(), SIGNAL(subcategoriesSupportChanged()), SLOT(subcategoriesSupportChanged())); refresh(); toggleFilter(Preferences::instance()->getCategoryFilterState()); }
LandmarkFilterDialog::LandmarkFilterDialog(QLandmarkFetchRequest *fetchRequest, QLandmarkManager * manager, QWidget *parent, Qt::WindowFlags flags) : QDialog(parent, flags), manager(manager), fetchRequest(fetchRequest) { setupUi(this); connect(filterAllCheckBox,SIGNAL(stateChanged(int)), this,SLOT(filterAllCheckBoxStateChanged(int))); connect(filterNameCheckBox, SIGNAL(stateChanged(int)), this, SLOT(otherFiltersCheckBoxStateChanged(int))); connect(filterCategoryCheckBox, SIGNAL(stateChanged(int)), this, SLOT(otherFiltersCheckBoxStateChanged(int))); connect(filterBoxCheckBox, SIGNAL(stateChanged(int)), this, SLOT(otherFiltersCheckBoxStateChanged(int))); connect(filterProximityCheckBox, SIGNAL(stateChanged(int)), this, SLOT(otherFiltersCheckBoxStateChanged(int))); connect(manager, SIGNAL(categoriesRemoved(QList<QLandmarkCategoryId>)), this, SLOT(categoryRemoved(QList<QLandmarkCategoryId>))); filterAllCheckBox->setCheckState(Qt::Checked); QButtonGroup * buttonGroup = new QButtonGroup(this); buttonGroup->addButton(startsWithRadioButton); buttonGroup->addButton(containsRadioButton); }
CategoryFilterModel::CategoryFilterModel(QObject *parent) : QAbstractItemModel(parent) , m_rootItem(new CategoryModelItem) { auto session = BitTorrent::Session::instance(); connect(session, SIGNAL(categoryAdded(QString)), SLOT(categoryAdded(QString))); connect(session, SIGNAL(categoryRemoved(QString)), SLOT(categoryRemoved(QString))); connect(session, SIGNAL(torrentCategoryChanged(BitTorrent::TorrentHandle *const, QString)) , SLOT(torrentCategoryChanged(BitTorrent::TorrentHandle *const, QString))); connect(session, SIGNAL(subcategoriesSupportChanged()), SLOT(subcategoriesSupportChanged())); connect(session, SIGNAL(torrentAdded(BitTorrent::TorrentHandle *const)) , SLOT(torrentAdded(BitTorrent::TorrentHandle *const))); connect(session, SIGNAL(torrentAboutToBeRemoved(BitTorrent::TorrentHandle *const)) , SLOT(torrentAboutToBeRemoved(BitTorrent::TorrentHandle *const))); populate(); }
void XMLDB::XMLCategoryCollection::removeCategory( const QString& name ) { for( QList<DB::CategoryPtr>::iterator it = m_categories.begin(); it != m_categories.end(); ++it ) { if ( (*it)->name() == name ) { m_categories.erase(it); emit categoryRemoved(name); emit categoryCollectionChanged(); return; } } Q_ASSERT_X( false, "removeCategory", "trying to remove non-existing category" ); }
QT_BEGIN_NAMESPACE /*! \class QPlaceManager \inmodule QtLocation \ingroup QtLocation-places \ingroup QtLocation-places-manager \since 5.5 \brief The QPlaceManager class provides the interface which allows clients to access places stored in a particular backend. The following table gives an overview of the functionality provided by the QPlaceManager \table \header \li Functionality \li Description \row \li Searching for places \li Using set of parameters such as a search term and search area, relevant places can be returned to the user. \row \li Categories \li Places can be classified as belonging to different categories. The manager supports access to these categories. \row \li Search term suggestions \li Given a partially complete search term, a list of potential search terms can be given. \row \li Recommendations \li Given an existing place, a set of similar recommended places can be suggested to the user. \row \li Rich Content \li Rich content such as images, reviews etc can be retrieved in a paged fashion. \row \li Place or Category management \li Places and categories may be saved and removed. It is possible for notifications to be given when this happens. \row \li Localization \li Different locales may be specified to return place data in different languages. \endtable \section1 Obtaining a QPlaceManager Instance Creation of a QPlaceManager is facilitated by the QGeoServiceProvider. See \l {Initializing a manager} for an example on how to create a manager. \section1 Asynchronous Interface The QPlaceManager class provides an abstraction of the datastore which contains place information. The functions provided by the QPlaceManager and primarily asynchronous and follow a request-reply model. Typically a request is given to the manager, consisting of a various set of parameters and a reply object is created. The reply object has a signal to notify when the request is done, and once completed, the reply contains the results of the request, along with any errors that occurred, if any. An asynchronous request is generally handled as follows: \snippet places/requesthandler.h Simple search \dots \dots \snippet places/requesthandler.h Simple search handler See \l {Common Operations} for a list of examples demonstrating how the QPlaceManger is used. \section1 Category Initialization Sometime during startup of an application, the initializeCategories() function should be called to setup the categories. Initializing the categories enables the usage of the following functions: \list \li QPlaceManager::childCategories() \li QPlaceManager::category() \li QPlaceManager::parentCategoryId() \li QPlaceManager::childCategoryIds(); \endlist If the categories need to be refreshed or reloaded, the initializeCategories() function may be called again. */ /*! Constructs a new manager with the specified \a parent and with the implementation provided by \a engine. This constructor is used internally by QGeoServiceProviderFactory. Regular users should acquire instances of QGeoRoutingManager with QGeoServiceProvider::routingManager(); */ QPlaceManager::QPlaceManager(QPlaceManagerEngine *engine, QObject *parent) : QObject(parent), d(engine) { if (d) { d->setParent(this); d->d_ptr->manager = this; qRegisterMetaType<QPlaceCategory>(); connect(d, SIGNAL(finished(QPlaceReply*)), this, SIGNAL(finished(QPlaceReply*))); connect(d, SIGNAL(error(QPlaceReply*,QPlaceReply::Error)), this, SIGNAL(error(QPlaceReply*,QPlaceReply::Error))); connect(d, SIGNAL(placeAdded(QString)), this, SIGNAL(placeAdded(QString)), Qt::QueuedConnection); connect(d, SIGNAL(placeUpdated(QString)), this, SIGNAL(placeUpdated(QString)), Qt::QueuedConnection); connect(d, SIGNAL(placeRemoved(QString)), this, SIGNAL(placeRemoved(QString)), Qt::QueuedConnection); connect(d, SIGNAL(categoryAdded(QPlaceCategory,QString)), this, SIGNAL(categoryAdded(QPlaceCategory,QString))); connect(d, SIGNAL(categoryUpdated(QPlaceCategory,QString)), this, SIGNAL(categoryUpdated(QPlaceCategory,QString))); connect(d, SIGNAL(categoryRemoved(QString,QString)), this, SIGNAL(categoryRemoved(QString,QString))); connect(d, SIGNAL(dataChanged()), this, SIGNAL(dataChanged()), Qt::QueuedConnection); } else {