MatrixSelector::MatrixSelector(QWidget *parent) : QWidget(parent) { setupUi(this); _newMatrix->setIcon(QIcon(":/kst_matrixnew.png")); _editMatrix->setIcon(QIcon(":/kst_matrixedit.png")); _provideNoneMatrix = false; update(); connect(_matrix, SIGNAL(activated(const QString&)), this, SIGNAL(selectionChanged(const QString&))); connect(this, SIGNAL(selectionChanged(QString)), this, SLOT(selectionWatcher(QString))); connect(_editMatrix, SIGNAL(clicked()), this, SLOT(editMatrix())); connect(_newMatrix, SIGNAL(clicked()), this, SLOT(createNewMatrix())); }
MatrixSelector::MatrixSelector(QWidget *parent, ObjectStore *store) : QWidget(parent), _store(store) { setupUi(this); int size = style()->pixelMetric(QStyle::PM_SmallIconSize); _newMatrix->setIcon(QPixmap(":kst_matrixnew.png")); _editMatrix->setIcon(QPixmap(":kst_matrixedit.png")); _newMatrix->setFixedSize(size + 8, size + 8); _editMatrix->setFixedSize(size + 8, size + 8); fillMatrices(); connect(_newMatrix, SIGNAL(pressed()), this, SLOT(newMatrix())); connect(_editMatrix, SIGNAL(pressed()), this, SLOT(editMatrix())); connect(_matrix, SIGNAL(currentIndexChanged(int)), this, SLOT(matrixSelected(int))); }