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


C++ KWindowInfo::visibleIconName方法代码示例

本文整理汇总了C++中KWindowInfo::visibleIconName方法的典型用法代码示例。如果您正苦于以下问题:C++ KWindowInfo::visibleIconName方法的具体用法?C++ KWindowInfo::visibleIconName怎么用?C++ KWindowInfo::visibleIconName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KWindowInfo的用法示例。


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

示例1: elabTaskMenu

//-----------------------------------------------------------------------------
// Elaborate Tasks Menu
void daisy::elabTaskMenu( QList<WId> taskDict, int clickedlaunch_tmp )
{

    delete m_task_menu;
    m_task_menu = new KMenu();

    taskDrawers.clear();

    QList<WId>::ConstIterator it;
    for (it = taskDict.begin(); it != taskDict.end(); ++it )
    {

        KWindowInfo taskInfo = KWindowSystem::windowInfo( *it, NET::WMName | NET::WMVisibleName | NET::WMWindowType | NET::WMVisibleIconName , NET::WM2StartupId | NET::WM2WindowClass | NET::WM2WindowRole );

        QString visiconame_tmp = taskInfo.visibleIconName();
        QString visname_tmp = taskInfo.visibleName();
        QString iconame_tmp = m_values[clickedlaunch_tmp][2];

        m_act_1 = new QAction(KIcon(iconame_tmp), visiconame_tmp, this);
        connect(m_act_1, SIGNAL(triggered(bool)), this, SLOT(taskMenuClicked()));

        m_task_menu->addAction ( m_act_1 );
        taskDrawers << *it;

    }

    m_task_menu->exec( QCursor::pos() );

}
开发者ID:baddwin,项目名称:daisyplasma,代码行数:31,代码来源:daisyLaunchers.cpp

示例2: elabDrawers

//-----------------------------------------------------------------------------
// Create Drawers
void daisy::elabDrawers( QList<WId> taskDict, int clickedlaunch_tmp )
{
    m_drawerscleared = false;
    int i = 0;
    QRect drawerrect_tmp;
    bool invert_tmp = true;
    qreal rotval_tmp = 1.00;
    QList<WId>::ConstIterator it;
    for (it = taskDict.begin(); it != taskDict.end(); ++it )
    {

        KWindowInfo taskInfo = KWindowSystem::windowInfo( *it, NET::WMName | NET::WMVisibleName | NET::WMWindowType | NET::WMVisibleIconName , NET::WM2StartupId | NET::WM2WindowClass | NET::WM2WindowRole );

        QString visiconame_tmp = taskInfo.visibleIconName();
        QString visname_tmp = taskInfo.visibleName();
        QString iconame_tmp = m_values[clickedlaunch_tmp][2];

        m_drawericons << new Plasma::IconWidget( KIcon( iconame_tmp ), visiconame_tmp, this );
        m_drawericons[i]->setOrientation(Qt::Horizontal);
        m_drawericons[i]->setCursor(Qt::PointingHandCursor);
        m_drawericons[i]->setAcceptHoverEvents(true);
        m_drawericons[i]->setWindowFrameMargins(0,0,0,0);
        m_drawericons[i]->setNumDisplayLines(1);
        m_drawericons[i]->setDrawBackground(m_draw_icoback);
        //m_drawericons[i]->setToolTip ( visname_tmp );

        connect( m_drawericons[i], SIGNAL(clicked()), this, SLOT( drawerClicked() ) );
        m_drawericons[i]->installEventFilter(this);


        taskDrawers << *it;



        if ( m_position == QString("buttom_center") || m_position == QString("buttom_left") || m_position == QString("buttom_right") )
        {
            rotval_tmp = m_drawerrotation*i;
            invert_tmp = true;
            drawerrect_tmp = QRect( (drawerpopspot_x+(m_icodimension/1.5)+(5*i))-(m_drawersize*8.33), drawerpopspot_y - (m_drawersize*1.27),
                                    (m_drawersize*8.33), m_drawersize);
        }

        else if ( m_position == QString("top_center") || m_position == QString("top_left") || m_position == QString("top_right") )
        {
            rotval_tmp = -m_drawerrotation*i;
            invert_tmp = true;
            drawerrect_tmp = QRect( (drawerpopspot_x+(m_icodimension/1.5)+(5*i))-(m_drawersize*8.33), drawerpopspot_y + (m_icodimension*1.27),
                                    (m_drawersize*8.33), m_drawersize);
        }

        else if ( m_position == QString("left_center") || m_position == QString("left_top") || m_position == QString("left_buttom") )
        {
            rotval_tmp = -m_drawerrotation*i;
            invert_tmp = false;
            drawerrect_tmp = QRect( (drawerpopspot_x+(m_icodimension*1.3)+(5*i)), drawerpopspot_y,
                                    (m_drawersize*8.33), m_drawersize);
        }

        else if ( m_position == QString("right_center") || m_position == QString("right_top") || m_position == QString("right_buttom") )
        {
            rotval_tmp = m_drawerrotation*i;
            invert_tmp = true;
            drawerrect_tmp = QRect( (drawerpopspot_x-((m_drawersize*8.33)+m_icodimension/3)-(5*i)), drawerpopspot_y,
                                    (m_drawersize*8.33), m_drawersize);
        }




        m_drawericons[i]->invertLayout( invert_tmp );
        m_drawericons[i]->setGeometry( drawerrect_tmp );
        m_drawericons[i]->setTransform(QTransform().rotate(rotval_tmp));


        i++;

    }

    raise();
    emit update();


}
开发者ID:baddwin,项目名称:daisyplasma,代码行数:85,代码来源:daisyDrawers.cpp


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