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


C++ KConfig::readIntListEntry方法代码示例

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


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

示例1: readSettings

void MainWidget::readSettings( )
{	m_htmlWidget->readSettings( );

	KConfig* config = kapp->config( );
	config->setGroup( "General" );

	m_stylesheetURLs  = config->readListEntry( "stylesheetURLs" );
	m_useLocalManPage = config->readBoolEntry( "useLocalManPage", false );
	m_wrapText = config->readBoolEntry( "wrapText", false );

	QValueList<int> splitterSizes = config->readIntListEntry( "splitterSizes" );
	setSizes( splitterSizes );
	QStringList scanNames = config->readListEntry( "scanNames" );

	if( !scanNames.count( ))
		scanNames.append( "default" );

	QString     visibleScanName   = config->readEntry( "visibleScan", QString::null );
	ScanWidget* visibleScanWidget = NULL;

	for( QStringList::Iterator it = scanNames.begin( ); it != scanNames.end(); ++it )
	{	ScanWidget* scanWidget = createScan( *it, false, QString::null );

		if( visibleScanName == scanWidget->scanName( ))
			visibleScanWidget = scanWidget;
	}

	if( visibleScanWidget == NULL )
	{	visibleScanWidget = m_scanStack->firstScanWidget( );

		if( visibleScanWidget == NULL )
		{	KMessageBox::error( this, i18n( "Internal error - no ScanWidget to display!" ), i18n( "Internal error" ));
			kapp->quit( );
		}
	}

	m_scanStack->raiseWidget( visibleScanWidget );
}
开发者ID:netrunner-debian-kde-extras,项目名称:knmap,代码行数:38,代码来源:mainwidget.cpp

示例2: setup


//.........这里部分代码省略.........
   // the selector if necessary etc.

   if( m_scanParams )
   {
      /* if m_scanParams exist it means, that the dialog is already open */
      return true;
   }

   m_scanParams = new ScanParams( splitter );
   connect( m_previewer->getImageCanvas(), SIGNAL( newRect(QRect)),
	    m_scanParams, SLOT(slCustomScanSize(QRect)));
   connect( m_previewer->getImageCanvas(), SIGNAL( noRect()),
	    m_scanParams, SLOT(slMaximalScanSize()));

   connect( m_scanParams, SIGNAL( scanResolutionChanged( int, int )),
	    m_previewer, SLOT( slNewScanResolutions( int, int )));


   /* continue to attach a real scanner */
   /* first, get the list of available devices from libkscan */
   QStringList scannerNames;
   QStrList backends = m_device->getDevices();;
   QStrListIterator it( backends );

   while ( it.current() ) {
      scannerNames.append( m_device->getScannerName( it.current() ));
      ++it;
   }

   /* ..if there are devices.. */
   QCString configDevice;
   good_scan_connect = true;
   if( scannerNames.count() > 0 )
   {
      /* allow the user to select one */
      DeviceSelector ds( this, backends, scannerNames );
      configDevice = ds.getDeviceFromConfig( );

      if( configDevice.isEmpty() || configDevice.isNull() )
      {
	 kdDebug(29000) << "configDevice is not valid - starting selector!" << configDevice << endl;
	 if ( ds.exec() == QDialog::Accepted )
	 {
	    configDevice = ds.getSelectedDevice();
	 }
      }

      /* If a device was selected, */
      if( ! configDevice.isNull() )
      {
	 /* ..open it (init sane with that) */
	 m_device->openDevice( configDevice );

	 /* ..and connect to the gui (create the gui) */
	 if ( !m_scanParams->connectDevice( m_device ) )
	 {
	    kdDebug(29000) << "ERR: Could not connect scan device" << endl;
	    good_scan_connect = false;
	 }
      }
   }

   if( configDevice.isNull() || configDevice.isEmpty() )
   {
      /* No scanner found, open with information */
      m_scanParams->connectDevice( 0L );
      good_scan_connect = false;
      /* Making the previewer gray */
      /* disabling is much better than hiding for 'advertising' ;) */
   }

   /* Move the scan params to the left, for backward compatibility.
    * However, having it on the right looks a bit better IMHO */
   if( splitter && m_scanParams )
      splitter->moveToFirst( m_scanParams );

   if( good_scan_connect )
   {
      m_previewer->setEnabled( true );
      m_previewer->setPreviewImage( m_device->loadPreviewImage() );
      m_previewer->connectScanner( m_device );
   }

    /* set initial sizes */
    setInitialSize( configDialogSize( GROUP_STARTUP ));

    KConfig *kfg = KGlobal::config();
    if( kfg )
    {
       QRect r = KGlobalSettings::desktopGeometry(this);

       kfg->setGroup( GROUP_STARTUP );
       /* Since this is a vertical splitter, only the width is important */
       QString key = QString::fromLatin1( SCANDIA_SPLITTER_SIZES ).arg( r.width());
       kdDebug(29000) << "Read Splitter-Sizes " << key  << endl;
       splitter->setSizes( kfg->readIntListEntry( key ));
    }

   return true;
}
开发者ID:KDE,项目名称:kooka,代码行数:101,代码来源:scandialog.cpp


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