コード例 #1
0
ファイル: graphinspector.cpp プロジェクト: molefrog/astrid
graphInspector::graphInspector(QWidget *parent, QList<graphObject*>* list) : QWidget(parent)
{
	int i;
	setupUi(this);

	styleEdit->addItem(QString::fromUtf8("Сплошной"));
	styleEdit->addItem(QString::fromUtf8("Штрих"));
	styleEdit->addItem(QString::fromUtf8("Точка"));
	styleEdit->addItem(QString::fromUtf8("Штрих-точка"));

	graphs = list;
	for(i=0;i<graphs->count();i++) graphBox->addItem(graphs->at(i)->description );
	
	QObject::connect(graphBox,        SIGNAL(activated(int)),	  this, SLOT(changeSelection(int)));
 	QObject::connect(widthEdit,       SIGNAL(valueChanged(int)),  this, SLOT(changeWidth(int)));
 	QObject::connect(colorEdit,       SIGNAL(clicked()),		  this, SLOT(changeColor()));
 	QObject::connect(descriptionEdit, SIGNAL(textEdited(QString)),this, SLOT(changeDescription(QString)));
 	QObject::connect(drawableEdit,    SIGNAL(stateChanged(int)),  this, SLOT(changeDrawable(int)));
	QObject::connect(addEdit,	      SIGNAL(clicked()),		  this, SLOT(add()));
	QObject::connect(removeEdit,	  SIGNAL(clicked()),		  this, SLOT(remove()));
	QObject::connect(styleEdit,		  SIGNAL(activated(int)),     this, SLOT(changeStyle(int)));
	
	graphBox->setCurrentIndex(0);
	changeSelection(0);
}
コード例 #2
0
void btEditorNodeType::disconnectChangeProperty()
{
    disconnect(m_sender, SIGNAL(propertyChanged(QString, QVariant)), this, SLOT(changeProperty(QString, QVariant)));
    disconnect(m_sender, SIGNAL(propertyDescriptionChanged(QString, QString, QString)), this, SLOT(changePropertyDescription(QString,QString, QString)));
    disconnect(m_sender, SIGNAL(nameChanged(QString)), this, SLOT(changeName(QString)));
    disconnect(m_sender, SIGNAL(descriptionChanged(QString)), this, SLOT(changeDescription(QString)));
    disconnect(m_sender, SIGNAL(classNameChanged(QString)), this, SLOT(changeClassName(QString)));
}
コード例 #3
0
ファイル: dict_widget.cpp プロジェクト: wrimle/booxsdk
bool DictWidget::handleLeftRightKey(const int checked_id, const int key)
{

    QAbstractButton *button = button_group_.button(checked_id);
    if (button)
    {
        int target_focus_id = getNextFocusButtonId(checked_id);
        if (Qt::Key_Left == key)
        {
            target_focus_id = getPreviousFocusButtonId(checked_id);
        }
        QAbstractButton *next = button_group_.button(target_focus_id);
        if (next)
        {
            next->setFocus();
            changeDescription(target_focus_id);
        }
        return true;
    }
    else
    {
        return false;
    }
}
コード例 #4
0
ファイル: dict_widget.cpp プロジェクト: wrimle/booxsdk
void DictWidget::keyReleaseEvent(QKeyEvent *ke)
{
    QWidget * wnd = 0;
    QPushButton * btn = 0;
    int key = ke->key();
    if (key == Qt::Key_Escape || key == ui::Device_Menu_Key)
    {
        ke->accept();
        onCloseClicked();
        return;
    }

    if (internalState() == LOOKUP)
    {
        emit keyReleaseSignal(ke->key());
        return;
    }

    switch (ke->key())
    {
    case Qt::Key_Left:
    case Qt::Key_Right:
        if (internalState() != RETRIEVING_WORD)
        {
            wnd = content_widget_.focusWidget();
            btn = qobject_cast<QPushButton*>(wnd);
            const int button_id = button_group_.id(btn);
            if (-1 == button_id)
            {
                int checked_id = button_group_.checkedId();
                handleLeftRightKey(checked_id, key);
            }
            else
            {
                wnd = ui::moveFocus(this, key);
                if (wnd)
                {
                    wnd->setFocus();
                    QPushButton *tmpButton = qobject_cast<QPushButton*>(wnd);
                    const int focus_id = button_group_.id(tmpButton);
                    changeDescription(focus_id);
                }
            }
            ke->accept();
        } else
        {
            emit keyReleaseSignal(ke->key());
        }
        return;
    case Qt::Key_Up:
    case Qt::Key_Down:
        if (internalState() != RETRIEVING_WORD)
        {
            wnd = ui::moveFocus(this, key);
            if (wnd)
            {
                wnd->setFocus();
            }
            ke->accept();
        }
        else
        {
            emit keyReleaseSignal(ke->key());
        }
        return;
    case Qt::Key_Enter:
    case Qt::Key_Return:
        if (internalState() == RETRIEVING_WORD)
        {
            emit keyReleaseSignal(ke->key());
        }
        return ;
    default:
        break;
    }
    ke->ignore();
    emit keyReleaseSignal(ke->key());
}