void QDeclarativeGeoAddress::setStreet(const QString& street) { if (m_address.street() == street) return; m_address.setStreet(street); emit streetChanged(); }
SearchWidget::SearchWidget(QWidget *parent) : QWidget(parent), m_addrLookup(0), m_cityCoordinates(), m_loaded(false), m_city(new QLineEdit(this)), m_cityList(new QListWidget(this)), m_street(new QLineEdit(this)), m_streetList(new QListWidget(this)) { QGridLayout *layout = new QGridLayout(this); layout->setContentsMargins(0, 0, 0, 0); layout->addWidget(m_city, 0, 0, 1, 2); connect(m_city, SIGNAL(textEdited(QString)), this, SLOT(cityChanged(QString))); connect(m_city, SIGNAL(editingFinished()), this, SLOT(cityEntered())); layout->addWidget(m_cityList, 1, 0, 1, 2); connect(m_cityList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(citySelected(QListWidgetItem*))); #if QT_VERSION >= 0x040700 m_city->setPlaceholderText("Enter city name"); m_street->setPlaceholderText("Enter street name"); #endif layout->addWidget(m_street, 2, 0, 1, 2); connect(m_street, SIGNAL(textEdited(QString)), this, SLOT(streetChanged(QString))); layout->addWidget(m_streetList, 3, 0, 1, 2); connect(m_streetList, SIGNAL(itemActivated(QListWidgetItem*)), this, SLOT(streetSelected(QListWidgetItem*))); QPushButton *back = new QPushButton("&Back", this); back->setIcon(QIcon(":cancel.png")); layout->addWidget(back, 4, 1); connect(back, SIGNAL(clicked()), this, SIGNAL(back())); QSettings set(QDir::homePath()+"/Maps/nanomap.conf", QSettings::NativeFormat); set.beginGroup("monav"); QString dataDir = set.value("datadir").toString(); QString addrLookupLib = set.value("addresslookup", "/usr/lib/monav/libunicodetournamenttrieclient.so").toString(); set.endGroup(); QSettings pluginSettings(dataDir+"/plugins.ini", QSettings::IniFormat); QString addrLookupName = pluginSettings.value("addressLookup").toString(); QPluginLoader Loader(addrLookupLib); QObject *plugin = Loader.instance(); if (plugin) { m_addrLookup = qobject_cast<IAddressLookup*>(plugin); if (m_addrLookup) { m_addrLookup->SetInputDirectory(dataDir); m_loaded = m_addrLookup->LoadData(); } } resize(320, 240); }
void QDeclarativeGeoAddress::setStreet(const QString &street) { if (m_address.street() == street) return; QString oldText = m_address.text(); m_address.setStreet(street); emit streetChanged(); if (m_address.isTextGenerated() && oldText != m_address.text()) emit textChanged(); }