forked from qt-creator/qt-creator
QmlDesigner.documentController: adding instance()
Also exposing changeCurrentModelTo() as public API. Change-Id: I7c9ed3679ef5859b1349f1d1fe3088e78bccc7ad Reviewed-on: http://codereview.qt.nokia.com/787 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Thomas Hartmann <Thomas.Hartmann@nokia.com>
This commit is contained in:
@@ -45,6 +45,11 @@ ComponentAction::ComponentAction(ComponentView *componentView)
|
||||
{
|
||||
}
|
||||
|
||||
void ComponentAction::setCurrentIndex(int i)
|
||||
{
|
||||
emit currentIndexChanged(i);
|
||||
}
|
||||
|
||||
QWidget *ComponentAction::createWidget(QWidget *parent)
|
||||
{
|
||||
QComboBox *comboBox = new QComboBox(parent);
|
||||
@@ -52,6 +57,7 @@ QWidget *ComponentAction::createWidget(QWidget *parent)
|
||||
comboBox->setToolTip(tr("Edit sub components defined in this file"));
|
||||
comboBox->setModel(m_componentView->standardItemModel());
|
||||
connect(comboBox, SIGNAL(currentIndexChanged(int)), SLOT(emitCurrentComponentChanged(int)));
|
||||
connect(this, SIGNAL(currentIndexChanged(int)), comboBox, SLOT(setCurrentIndex(int)));
|
||||
|
||||
return comboBox;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user