NutrientInfoStatusWidget::NutrientInfoStatusWidget( QWidget * parent ) : QWidget(parent) { ui = new Ui::NutrientInfoStatusWidget; ui->setupUi( this ); connect( ui->m_detailsButton, SIGNAL(clicked()), this, SIGNAL(detailsButtonClicked()) ); connect( ui->m_updateButton, SIGNAL(clicked()), this, SIGNAL(updateButtonClicked()) ); }
WIView::WIView(QWidget *parent, ObsConditions *obs) : QWidget(parent), m_Obs(obs), m_CurCategorySelected(-1) { m_ModManager = new ModelManager(m_Obs); m_BaseView = new QDeclarativeView(); ///To use i18n() instead of qsTr() in qml/wiview.qml for translation KDeclarative kd; kd.setDeclarativeEngine(m_BaseView->engine()); kd.initialize(); kd.setupBindings(); m_Ctxt = m_BaseView->rootContext(); m_BaseView->setSource(KStandardDirs::locate("appdata","tools/whatsinteresting/qml/wiview.qml")); m_BaseObj = dynamic_cast<QObject *>(m_BaseView->rootObject()); //soTypeTextObj = m_BaseObj->findChild<QObject *>("soTypeTextObj"); m_ViewsRowObj = m_BaseObj->findChild<QObject *>("viewsRowObj"); connect(m_ViewsRowObj, SIGNAL(categorySelected(int)), this, SLOT(onCategorySelected(int))); m_SoListObj = m_BaseObj->findChild<QObject *>("soListObj"); connect(m_SoListObj, SIGNAL(soListItemClicked(int, QString, int)), this, SLOT(onSoListItemClicked(int, QString, int))); m_DetailsViewObj = m_BaseObj->findChild<QObject *>("detailsViewObj"); m_NextObj = m_BaseObj->findChild<QObject *>("nextObj"); connect(m_NextObj, SIGNAL(nextObjClicked()), this, SLOT(onNextObjClicked())); m_PrevObj = m_BaseObj->findChild<QObject *>("prevObj"); connect(m_PrevObj, SIGNAL(prevObjClicked()), this, SLOT(onPrevObjClicked())); m_SlewButtonObj = m_BaseObj->findChild<QObject *>("slewButtonObj"); connect(m_SlewButtonObj, SIGNAL(slewButtonClicked()), this, SLOT(onSlewButtonClicked())); m_DetailsButtonObj = m_BaseObj->findChild<QObject *>("detailsButtonObj"); connect(m_DetailsButtonObj, SIGNAL(detailsButtonClicked()), this, SLOT(onDetailsButtonClicked())); QObject *settingsIconObj = m_BaseObj->findChild<QObject *>("settingsIconObj"); connect(settingsIconObj, SIGNAL(settingsIconClicked()), this, SLOT(onSettingsIconClicked())); QObject *reloadIconObj = m_BaseObj->findChild<QObject *>("reloadIconObj"); connect(reloadIconObj, SIGNAL(reloadIconClicked()), this, SLOT(onReloadIconClicked())); m_BaseView->setResizeMode(QDeclarativeView::SizeRootObjectToView); m_BaseView->show(); }