本文整理汇总了C++中QObjectList::getFirst方法的典型用法代码示例。如果您正苦于以下问题:C++ QObjectList::getFirst方法的具体用法?C++ QObjectList::getFirst怎么用?C++ QObjectList::getFirst使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QObjectList
的用法示例。
在下文中一共展示了QObjectList::getFirst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Plugin
KViewEffects::KViewEffects( QObject* parent, const char* name, const QStringList & )
: Plugin( parent, name )
, m_gamma( 0.5 ), m_lastgamma( -1.0 )
, m_opacity( 50 ), m_lastopacity( -1 )
, m_intensity( 50 ), m_lastintensity( -1 )
, m_color( white )
, m_image( 0 )
{
QObjectList * viewerList = parent->queryList( 0, "KImageViewer Part", false, false );
m_pViewer = static_cast<KImageViewer::Viewer *>( viewerList->getFirst() );
delete viewerList;
if( m_pViewer )
{
KAction * gammaaction = new KAction( i18n( "&Gamma Correction..." ), 0, 0,
this, SLOT( gamma() ),
actionCollection(), "plugin_effects_gamma" );
KAction * blendaction = new KAction( i18n( "&Blend Color..." ), 0, 0,
this, SLOT( blend() ),
actionCollection(), "plugin_effects_blend" );
KAction * intensityaction = new KAction( i18n( "Change &Intensity (Brightness)..." ), 0, 0,
this, SLOT( intensity() ),
actionCollection(), "plugin_effects_intensity" );
gammaaction->setEnabled( m_pViewer->canvas()->image() != 0 );
blendaction->setEnabled( m_pViewer->canvas()->image() != 0 );
intensityaction->setEnabled( m_pViewer->canvas()->image() != 0 );
connect( m_pViewer->widget(), SIGNAL( hasImage( bool ) ), gammaaction, SLOT( setEnabled( bool ) ) );
connect( m_pViewer->widget(), SIGNAL( hasImage( bool ) ), blendaction, SLOT( setEnabled( bool ) ) );
connect( m_pViewer->widget(), SIGNAL( hasImage( bool ) ), intensityaction, SLOT( setEnabled( bool ) ) );
}
else