当前位置: 首页>>代码示例>>C++>>正文


C++ SetFocusWidget函数代码示例

本文整理汇总了C++中SetFocusWidget函数的典型用法代码示例。如果您正苦于以下问题:C++ SetFocusWidget函数的具体用法?C++ SetFocusWidget怎么用?C++ SetFocusWidget使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetFocusWidget函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetFocusWidget

void ViewScheduled::SwitchList()
{
    if (GetFocusWidget() == m_groupList)
        SetFocusWidget(m_schedulesList);
    else if (GetFocusWidget() == m_schedulesList)
        SetFocusWidget(m_groupList);
}
开发者ID:DocOnDev,项目名称:mythtv,代码行数:7,代码来源:viewscheduled.cpp

示例2: QString

void CustomPriority::loadData()
{
    QString baseTitle = m_pginfo->GetTitle();
    baseTitle.remove(QRegExp(" \\(.*\\)$"));

    QString quoteTitle = baseTitle;
    quoteTitle.replace("\'","\'\'");

    m_prioritySpin->SetRange(-99,99,1);
    m_prioritySpin->SetValue(1);

    RuleInfo rule;
    rule.priority = QString().setNum(1);

    new MythUIButtonListItem(m_ruleList, tr("<New priority rule>"),
                             qVariantFromValue(rule));

    MSqlQuery result(MSqlQuery::InitCon());
    result.prepare("SELECT priorityname, recpriority, selectclause "
                   "FROM powerpriority ORDER BY priorityname;");

    if (result.exec())
    {
        MythUIButtonListItem *item = nullptr;
        while (result.next())
        {
            QString trimTitle = result.value(0).toString();
            trimTitle.remove(QRegExp(" \\(.*\\)$"));

            rule.title = trimTitle;
            rule.priority = result.value(1).toString();
            rule.description = result.value(2).toString();

            item = new MythUIButtonListItem(m_ruleList, rule.title,
                                            qVariantFromValue(rule));

            if (trimTitle == baseTitle)
                m_ruleList->SetItemCurrent(item);
        }
    }
    else
        MythDB::DBError("Get power search rules query", result);

    loadExampleRules();

    if (!m_pginfo->GetTitle().isEmpty())
    {
        m_titleEdit->SetText(baseTitle);
        m_descriptionEdit->SetText("program.title = '" + quoteTitle + "' ");
        textChanged();
    }

    if (m_titleEdit->GetText().isEmpty())
        SetFocusWidget(m_ruleList);
    else
        SetFocusWidget(m_clauseList);
}
开发者ID:garybuhrmaster,项目名称:mythtv,代码行数:57,代码来源:custompriority.cpp

示例3: GetMythMainWindow

bool MythUIVirtualKeyboard::keyPressEvent(QKeyEvent *e)
{
    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("TV Frontend", e, actions);

    if (handled)
        return true;

    bool keyFound = false;
    KeyDefinition key;
    if (GetFocusWidget())
    {
        if (m_keyMap.contains(GetFocusWidget()->objectName()))
        {
            key = m_keyMap.value(GetFocusWidget()->objectName());
            keyFound = true;;
        }
    }

    for (int i = 0; i < actions.size() && !handled; i++)
    {
        QString action = actions[i];
        handled = true;

        if (action == "UP")
        {
            if (keyFound)
                SetFocusWidget(GetChild(key.up));
        }
        else if (action == "DOWN")
        {
            if (keyFound)
                SetFocusWidget(GetChild(key.down));
        }
        else if (action == "LEFT")
        {
            if (keyFound)
                SetFocusWidget(GetChild(key.left));
        }
        else if (action == "RIGHT")
        {
            if (keyFound)
                SetFocusWidget(GetChild(key.right));
        }
        else
            handled = false;
    }

    if (!handled && MythScreenType::keyPressEvent(e))
        handled = true;

    return handled;
}
开发者ID:Olti,项目名称:mythtv,代码行数:54,代码来源:mythvirtualkeyboard.cpp

示例4: locker

bool MythNewsConfig::Create(void)
{
    QMutexLocker locker(&m_lock);

    // Load the theme for this screen
    bool foundtheme = LoadWindowFromXML("news-ui.xml", "config", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_categoriesList, "category", &err);
    UIUtilE::Assign(this, m_siteList, "sites", &err);
    UIUtilW::Assign(this, m_helpText, "help", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'config'");
        return false;
    }

    connect(m_categoriesList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            this, SLOT(slotCategoryChanged(MythUIButtonListItem*)));
    connect(m_siteList, SIGNAL(itemClicked(MythUIButtonListItem*)),
            this, SLOT(toggleItem(MythUIButtonListItem*)));

    BuildFocusList();

    SetFocusWidget(m_categoriesList);

    loadData();

    return true;
}
开发者ID:Beirdo,项目名称:mythtv-stabilize,代码行数:34,代码来源:mythnewsconfig.cpp

示例5: if

bool MythDialogBox::Create(void)
{
    QString windowName = (m_fullscreen ? "MythDialogBox" : "MythPopupBox");

    if (m_osdDialog)
    {
        if (!XMLParseBase::LoadWindowFromXML("osd.xml", windowName, this))
            return false;
    }
    else if (!CopyWindowFromBase(windowName, this))
        return false;

    bool err = false;
    UIUtilW::Assign(this, m_titlearea, "title");
    UIUtilE::Assign(this, m_textarea, "messagearea", &err);
    UIUtilE::Assign(this, m_buttonList, "list", &err);

    if (err)
    {
        VERBOSE(VB_IMPORTANT, QString("Cannot load screen '%1'")
                                        .arg(windowName));
        return false;
    }

    if (m_titlearea)
        m_titlearea->SetText(m_title);
    m_textarea->SetText(m_text);
    BuildFocusList();
	SetFocusWidget(m_buttonList);
    connect(m_buttonList, SIGNAL(itemClicked(MythUIButtonListItem*)),
            SLOT(Select(MythUIButtonListItem*)));

    return true;
}
开发者ID:footoflove,项目名称:libmythtv-ui,代码行数:34,代码来源:mythdialogbox.cpp

示例6: VERBOSE

bool MythTextInputDialog::Create(void)
{
    if (!CopyWindowFromBase("MythTextInputDialog", this))
        return false;

    MythUIText *messageText = NULL;
    MythUIButton *okButton = NULL;
    MythUIButton *cancelButton = NULL;

    bool err = false;
    UIUtilE::Assign(this, m_textEdit, "input", &err);
    UIUtilE::Assign(this, messageText, "message", &err);
    UIUtilE::Assign(this, okButton, "ok", &err);
    UIUtilW::Assign(this, cancelButton, "cancel");

    if (err)
    {
        VERBOSE(VB_IMPORTANT, "Cannot load screen 'MythTextInputDialog'");
        return false;
    }

    if (cancelButton)
        connect(cancelButton, SIGNAL(Clicked()), SLOT(Close()));
    connect(okButton, SIGNAL(Clicked()), SLOT(sendResult()));

    m_textEdit->SetFilter(m_filter);
    m_textEdit->SetText(m_defaultValue);
    m_textEdit->SetPassword(m_isPassword);
    m_textEdit->SetKeyboardSupport(false);
    messageText->SetText(m_message);
    BuildFocusList();
    SetFocusWidget(m_textEdit);
    return true;
}
开发者ID:footoflove,项目名称:libmythtv-ui,代码行数:34,代码来源:mythdialogbox.cpp

示例7: switch

bool MythScreenType::gestureEvent(MythGestureEvent *event)
{
    bool handled = false;
    if (event->gesture() == MythGestureEvent::Click)
    {
        switch (event->GetButton())
        {
            case MythGestureEvent::RightButton :
                ShowMenu();
                handled = true;
                break;
            default :
                break;
        }

    }

    if (!handled)
    {
        MythUIType *clicked = GetChildAt(event->GetPosition());
        if (clicked && clicked->IsEnabled())
        {
            SetFocusWidget(clicked);
            if (clicked->gestureEvent(event))
                handled = true;
        }
    }

    return handled;
}
开发者ID:Olti,项目名称:mythtv,代码行数:30,代码来源:mythscreentype.cpp

示例8: LoadWindowFromXML

bool ZMConsole::Create(void)
{
    // Load the theme for this screen
    bool foundtheme = LoadWindowFromXML("zoneminder-ui.xml", "zmconsole", this);
    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_monitor_list, "monitor_list", &err);
    UIUtilE::Assign(this, m_status_text,  "status_text", &err);
    UIUtilE::Assign(this, m_time_text,    "time_text", &err);
    UIUtilE::Assign(this, m_date_text,    "date_text", &err);
    UIUtilE::Assign(this, m_load_text,    "load_text", &err);
    UIUtilE::Assign(this, m_disk_text,    "disk_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'zmconsole'");
        return false;
    }

    BuildFocusList();

    SetFocusWidget(m_monitor_list);

    m_timeTimer->start(TIME_UPDATE_TIME);
    m_updateTimer->start(100);

    updateTime();

    return true;
}
开发者ID:MythTV,项目名称:mythtv,代码行数:32,代码来源:zmconsole.cpp

示例9: switch

void ImportIconsWizard::enableControls(dialogState state, bool selectEnabled)
{
    switch (state)
    {
    case STATE_NORMAL:
        if (m_missingCount + 1 == m_missingMaxCount)
            m_skipButton->SetText(tr("Finish"));
        else
            m_skipButton->SetText(tr("Skip"));
        m_skipButton->SetEnabled(true);
        m_nameText->SetEnabled(true);
        m_iconsList->SetEnabled(true);
        m_manualEdit->SetEnabled(true);
        m_manualButton->SetEnabled(true);
        break;
    case STATE_SEARCHING:
        m_skipButton->SetEnabled(false);
        m_manualButton->SetEnabled(false);
        m_iconsList->SetEnabled(false);
        m_iconsList->Reset();
        m_manualEdit->Reset();
        break;
    case STATE_DISABLED:
        m_skipButton->SetEnabled(false);
        m_manualButton->SetEnabled(false);
        m_iconsList->SetEnabled(false);
        m_iconsList->Reset();
        m_nameText->SetEnabled(false);
        m_nameText->Reset();
        m_manualEdit->SetEnabled(false);
        m_manualEdit->Reset();
        SetFocusWidget(m_iconsList);
        break;
    }
}
开发者ID:samuelschen,项目名称:mythtv,代码行数:35,代码来源:importicons.cpp

示例10: LOG

void ImportIconsWizard::menuSelection(MythUIButtonListItem *item)
{
    if (!item)
        return;

    SearchEntry entry = item->GetData().value<SearchEntry>();

    LOG(VB_GENERAL, LOG_INFO, QString("Menu Selection: %1 %2 %3")
        .arg(entry.strID) .arg(entry.strName) .arg(entry.strLogo));

    enableControls(STATE_SEARCHING);

    CSVEntry entry2 = (*m_missingIter);
    m_strMatches += QString("%1,%2,%3,%4,%5,%6,%7,%8,%9\n")
                    .arg(escape_csv(entry.strID))
                    .arg(escape_csv(entry2.strName))
                    .arg(escape_csv(entry2.strXmlTvId))
                    .arg(escape_csv(entry2.strCallsign))
                    .arg(escape_csv(entry2.strTransportId))
                    .arg(escape_csv(entry2.strAtscMajorChan))
                    .arg(escape_csv(entry2.strAtscMinorChan))
                    .arg(escape_csv(entry2.strNetworkId))
                    .arg(escape_csv(entry2.strServiceId));

    if (checkAndDownload(entry.strLogo, entry2.strChanId))
    {
        m_statusText->SetText(tr("Icon for %1 was downloaded successfully.")
                              .arg(entry2.strName));
    }
    else
    {
        m_statusText->SetText(tr("Failed to download the icon for %1.")
                              .arg(entry2.strName));
    }

    if (m_missingMaxCount > 1)
    {
        m_missingCount++;
        m_missingIter++;
        if (!doLoad())
        {
            if (!m_strMatches.isEmpty())
                askSubmit(m_strMatches);
            else
                Close();
        }
    }
    else
    {
        enableControls(STATE_DISABLED);

        SetFocusWidget(m_iconsList);
        if (!m_strMatches.isEmpty())
            askSubmit(m_strMatches);
        else
            Close();
    }

}
开发者ID:samuelschen,项目名称:mythtv,代码行数:59,代码来源:importicons.cpp

示例11: SetFocusWidget

/**
 *  \brief Change button focus in a particular direction
 *  \param direction +1 moves focus to the right, -1 moves to the left,
 *                   and 0 changes the focus to the first button.
 */
void MythControls::ChangeButtonFocus(int direction)
{
    if ((m_leftListType != kContextList) || (m_rightListType != kActionList))
        return;

    if (direction == 0)
        SetFocusWidget(m_actionButtons.at(0));
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:13,代码来源:mythcontrols.cpp

示例12: LoadWindowFromXML

bool ArchiveFileSelector::Create(void)
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("mythnative-ui.xml", "archivefile_selector", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilW::Assign(this, m_titleText, "title");
    UIUtilE::Assign(this, m_fileButtonList, "filelist", &err);
    UIUtilE::Assign(this, m_locationEdit, "location_edit", &err);
    UIUtilE::Assign(this, m_backButton, "back_button", &err);
    UIUtilE::Assign(this, m_homeButton, "home_button", &err);
    UIUtilE::Assign(this, m_nextButton, "next_button", &err);
    UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
    UIUtilE::Assign(this, m_progTitle, "title_text", &err);
    UIUtilE::Assign(this, m_progSubtitle, "subtitle_text", &err);
    UIUtilE::Assign(this, m_progStartTime, "starttime_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'archivefile_selector'");
        return false;
    }

    if (m_titleText)
        m_titleText->SetText(tr("Find File To Import"));

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(nextPressed()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(cancelPressed()));
    connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(prevPressed()));

    connect(m_locationEdit, SIGNAL(LosingFocus()),
            this, SLOT(locationEditLostFocus()));
    m_locationEdit->SetText(m_curDirectory);

    connect(m_backButton, SIGNAL(Clicked()), this, SLOT(backPressed()));
    connect(m_homeButton, SIGNAL(Clicked()), this, SLOT(homePressed()));

    connect(m_fileButtonList, SIGNAL(itemSelected(MythUIButtonListItem *)),
            this, SLOT(itemSelected(MythUIButtonListItem *)));

    connect(m_fileButtonList, SIGNAL(itemClicked(MythUIButtonListItem *)),
            this, SLOT(itemClicked(MythUIButtonListItem *)));

    BuildFocusList();

    SetFocusWidget(m_fileButtonList);

    updateSelectedList();
    updateFileList();

    return true;
}
开发者ID:mojie126,项目名称:mythtv,代码行数:58,代码来源:importnative.cpp

示例13: LoadWindowFromXML

bool SelectDestination::Create(void)
{
    bool foundtheme = false;

    // Load the theme for this screen
    foundtheme = LoadWindowFromXML("mytharchive-ui.xml", "selectdestination", this);

    if (!foundtheme)
        return false;

    bool err = false;
    UIUtilE::Assign(this, m_createISOCheck, "makeisoimage_check", &err);
    UIUtilE::Assign(this, m_doBurnCheck, "burntodvdr_check", &err);
    UIUtilE::Assign(this, m_doBurnText, "burntodvdr_text", &err);
    UIUtilE::Assign(this, m_eraseDvdRwCheck, "erasedvdrw_check", &err);
    UIUtilE::Assign(this, m_eraseDvdRwText, "erasedvdrw_text", &err);
    UIUtilE::Assign(this, m_nextButton, "next_button", &err);
    UIUtilE::Assign(this, m_prevButton, "prev_button", &err);
    UIUtilE::Assign(this, m_cancelButton, "cancel_button", &err);
    UIUtilE::Assign(this, m_destinationSelector, "destination_selector", &err);
    UIUtilE::Assign(this, m_destinationText, "destination_text", &err);
    UIUtilE::Assign(this, m_findButton, "find_button", &err);
    UIUtilE::Assign(this, m_filenameEdit, "filename_edit", &err);
    UIUtilE::Assign(this, m_freespaceText, "freespace_text", &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'selectdestination'");
        return false;
    }

    connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(handleNextPage()));
    connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(handlePrevPage()));
    connect(m_cancelButton, SIGNAL(Clicked()), this, SLOT(handleCancel()));

    connect(m_destinationSelector, SIGNAL(itemSelected(MythUIButtonListItem*)),
            this, SLOT(setDestination(MythUIButtonListItem*)));

    for (int x = 0; x < ArchiveDestinationsCount; x++)
    {
        MythUIButtonListItem *item = new 
            MythUIButtonListItem(m_destinationSelector, tr(ArchiveDestinations[x].name));
        item->SetData(qVariantFromValue(ArchiveDestinations[x].type));
    }
    connect(m_findButton, SIGNAL(Clicked()), this, SLOT(handleFind()));

    connect(m_filenameEdit, SIGNAL(LosingFocus()), this,
            SLOT(filenameEditLostFocus()));

    BuildFocusList();

    SetFocusWidget(m_nextButton);

    loadConfiguration();

    return true;
}
开发者ID:JackOfMostTrades,项目名称:mythtv,代码行数:57,代码来源:selectdestination.cpp

示例14: LoadWindowFromXML

bool SearchView::Create(void)
{
    bool err = false;

    // Load the theme for this screen
    err = LoadWindowFromXML("music-ui.xml", "searchview", this);

    if (!err)
        return false;

    // find common widgets available on any view
    err = CreateCommon();

    // find widgets specific to this view
    UIUtilE::Assign(this, m_fieldList,    "field_list",    &err);
    UIUtilE::Assign(this, m_criteriaEdit, "criteria_edit", &err);
    UIUtilW::Assign(this, m_matchesText,  "matches_text",  &err);
    UIUtilE::Assign(this, m_tracksList,   "tracks_list",   &err);

    if (err)
    {
        LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'searchview'");
        return false;
    }

    BuildFocusList();

    SetFocusWidget(m_criteriaEdit);

    new MythUIButtonListItem(m_fieldList, tr("All Fields"),
                                qVariantFromValue(0));
    new MythUIButtonListItem(m_fieldList, tr("Artist"),
                                qVariantFromValue(1));
    new MythUIButtonListItem(m_fieldList, tr("Album"),
                                qVariantFromValue(2));
    new MythUIButtonListItem(m_fieldList, tr("Title"),
                                qVariantFromValue(3));
    new MythUIButtonListItem(m_fieldList, tr("Genre"),
                                qVariantFromValue(4));
    //new MythUIButtonListItem(m_fieldList, tr("Tags"),
    //                            qVariantFromValue(5));

    connect(m_fieldList, SIGNAL(itemSelected(MythUIButtonListItem*)),
            this, SLOT(fieldSelected(MythUIButtonListItem*)));

    connect(m_tracksList, SIGNAL(itemClicked(MythUIButtonListItem*)),
            this, SLOT(trackClicked(MythUIButtonListItem*)));

    connect(m_tracksList, SIGNAL(itemVisible(MythUIButtonListItem*)),
            this, SLOT(trackVisible(MythUIButtonListItem*)));

    connect(m_criteriaEdit, SIGNAL(valueChanged()), this, SLOT(criteriaChanged()));

    updateTracksList();

    return true;
}
开发者ID:DragonStalker,项目名称:mythtv,代码行数:57,代码来源:searchview.cpp

示例15: GetMythMainWindow

bool ZMEvents::keyPressEvent(QKeyEvent *event)
{
    if (GetFocusWidget()->keyPressEvent(event))
        return true;

    bool handled = false;
    QStringList actions;
    handled = GetMythMainWindow()->TranslateKeyPress("TV Playback", event, actions);

    for (int i = 0; i < actions.size() && !handled; i++)
    {
        QString action = actions[i];
        handled = true;

        if (action == "MENU")
        {
            showMenu();
        }
        else if (action == "ESCAPE")
        {
            if (GetFocusWidget() == m_eventGrid)
                SetFocusWidget(m_cameraSelector);
            else
                handled = false;
        }

        else if (action == "DELETE")
        {
            if (m_deleteButton)
                m_deleteButton->Push();
        }
        else if (action == "PAUSE")
        {
            if (m_playButton)
                m_playButton->Push();
        }
        else if (action == "INFO")
        {
            m_oldestFirst = !m_oldestFirst;
            getEventList();
        }
        else if (action == "1")
            setGridLayout(1);
        else if (action == "2")
            setGridLayout(2);
        else if (action == "3")
            setGridLayout(3);
        else
            handled = false;
    }

    if (!handled && MythScreenType::keyPressEvent(event))
        handled = true;

    return handled;
}
开发者ID:JGunning,项目名称:OpenAOL-TV,代码行数:56,代码来源:zmevents.cpp


注:本文中的SetFocusWidget函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。