Пример #1
0
void MsgFile::init()
{
    Command cmd;
    cmd->id		= CmdFileName;
    cmd->param	= m_edit;
    Event eWidget(EventCommandWidget, cmd);
    CToolEdit *edtName = (CToolEdit*)(eWidget.process());
    if (edtName){
        if (edtName->text().isEmpty()){
            selectFile();
            return;
        }
        edtName->setFocus();
    }
}
Пример #2
0
void MsgUrl::init()
{
    if (!m_edit->topLevelWidget()->isActiveWindow() || m_edit->topLevelWidget()->isMinimized())
        return;
    Command cmd;
    cmd->id    = CmdUrlInput;
    cmd->param = m_edit;
    EventCommandWidget eWidget(cmd);
    eWidget.process();
    CToolEdit *edtUrl = qobject_cast<CToolEdit*>(eWidget.widget());
    if (edtUrl && edtUrl->text().isEmpty()){
        edtUrl->setFocus();
        return;
    }
    m_edit->m_edit->setFocus();
}
Пример #3
0
void MsgFile::init()
{
    if (!m_edit->topLevelWidget()->isActiveWindow() || m_edit->topLevelWidget()->isMinimized())
        return;
    Command cmd;
    cmd->id		= CmdFileName;
    cmd->param	= m_edit;
    Event eWidget(EventCommandWidget, cmd);
    CToolEdit *edtName = (CToolEdit*)(eWidget.process());
    if (edtName){
        if (edtName->text().isEmpty()){
            selectFile();
            return;
        }
        edtName->setFocus();
    }
}