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


C++ TQListViewItem::setPixmap方法代码示例

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


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

示例1: loadSettings

void KDFConfigWidget::loadSettings( void )
{
  TDEConfig &config = *kapp->config();
  config.setGroup("KDFConfig");

  if( GUI )
  {
    mStd.updateConfiguration();
    mScroll->setValue( mStd.updateFrequency() );
    mLCD->display( mStd.updateFrequency() );
    mPopupFullCheck->setChecked( mStd.popupIfFull() );
    mOpenMountCheck->setChecked( mStd.openFileManager() );
    mFileManagerEdit->setText( mStd.fileManager() );

    TQListViewItem *item = mList->firstChild();
    if( item != 0 )
    {
      for( int i=mList->header()->count(); i>0; i-- )
      {
	int j = config.readNumEntry( mTabName[i-1]->mRes, 1 );
	item->setText( i-1, j==0 ? i18n("hidden") : i18n("visible") );
     	item->setPixmap( i-1, j==0 ? UserIcon ( "delete" )
                                   : UserIcon ( "tick" ) );
      }
    }
  }

}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:28,代码来源:kdfconfig.cpp

示例2: parseXmlCommand

void KXmlCommandAdvancedDlg::parseXmlCommand(KXmlCommand *xmlcmd)
{
	m_view->clear();
	TQListViewItem	*root = new TQListViewItem(m_view, xmlcmd->name(), xmlcmd->name());
	DrMain	*driver = xmlcmd->driver();

	root->setPixmap(0, SmallIcon("fileprint"));
	root->setOpen(true);
	if (driver)
	{
		DrMain	*clone = driver->cloneDriver();
		if (!clone->get("text").isEmpty())
			root->setText(0, clone->get("text"));
		root->setText(1, "__root__");
		clone->setName("__root__");
		m_opts["__root__"] = clone;
		parseGroupItem(clone, root);
		clone->flatten();
	}
	m_command->setText(xmlcmd->command());
	m_inputfile->setText(xmlcmd->io(true, false));
	m_inputpipe->setText(xmlcmd->io(true, true));
	m_outputfile->setText(xmlcmd->io(false, false));
	m_outputpipe->setText(xmlcmd->io(false, true));
	m_comment->setText( xmlcmd->comment() );

	viewItem(0);
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:28,代码来源:kxmlcommanddlg.cpp

示例3: iconChanged

void MntConfigWidget::iconChanged(const TQString &iconName)
{
  if( iconName.findRev('_') == 0 ||
      (iconName.right(iconName.length()-iconName.findRev('_'))!="_mount" &&
      iconName.right(iconName.length()-iconName.findRev('_'))!="_unmount"))
    {
      TQString msg = i18n(""
			 "This filename is not valid: %1\n"
			 "It must end with "
			 "\"_mount\" or \"_unmount\".").arg(iconName);
      KMessageBox::sorry( this, msg );
      return;
    }

  TQListViewItem *item = mList->selectedItem();
  for(unsigned i=0 ; i < mDiskList.count() ; ++i) 
    {
      if (mDiskLookup[i] == item) 
	{
	  DiskEntry *disk = mDiskList.at(i);
	  if( disk != 0 )
	    {
	      disk->setIconName(iconName);
	      mIconLineEdit->setText(iconName);
	      TDEIconLoader &loader = *TDEGlobal::iconLoader();
	      item->setPixmap( ICONCOL, loader.loadIcon( iconName, TDEIcon::Small));
	    }
	  break;
	}
    }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:31,代码来源:mntconfig.cpp

示例4: slotAddOption

void KXmlCommandAdvancedDlg::slotAddOption()
{
	if (m_view->currentItem())
	{
		TQString	ID = generateId(m_opts);

		DrBase	*opt = new DrStringOption;
		opt->setName(ID);
		opt->set("text", i18n("New Option"));
		m_opts[ID] = opt;

		TQListViewItem	*item = new TQListViewItem(m_view->currentItem(), i18n("New Option"), ID);
		item->setRenameEnabled(0, true);
		item->setPixmap(0, SmallIcon("document"));
		m_view->ensureItemVisible(item);
		item->startRename(0);
	}
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:18,代码来源:kxmlcommanddlg.cpp

示例5: slotAddGroup

void KXmlCommandAdvancedDlg::slotAddGroup()
{
	if (m_view->currentItem())
	{
		TQString	ID = generateId(m_opts);

		DrGroup	*grp = new DrGroup;
		grp->setName(ID);
		grp->set("text", i18n("New Group"));
		m_opts[ID] = grp;

		TQListViewItem	*item = new TQListViewItem(m_view->currentItem(), i18n("New Group"), ID);
		item->setRenameEnabled(0, true);
		item->setPixmap(0, SmallIcon("folder"));
		m_view->ensureItemVisible(item);
		item->startRename(0);
	}
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:18,代码来源:kxmlcommanddlg.cpp

示例6: initialize

void KMWLocal::initialize()
{
	TQStringList	list = KMFactory::self()->manager()->detectLocalPrinters();
	if (list.isEmpty() || (list.count() % 4) != 0)
	{
		KMessageBox::error(this, i18n("Unable to detect local ports."));
		return;
	}
	TQListViewItem	*last[4] = {0, 0, 0, 0};
	for (TQStringList::Iterator it=list.begin(); it!=list.end(); ++it)
	{
		TQString cl = *it;
		++it;

		TQString	uri = *it;
		int p = uri.find( ':' );
		TQString	desc = *(++it), prot = ( p != -1 ? uri.left( p ) : TQString::null );
		TQString	printer = *(++it);
		int	index(-1);
		if (desc.isEmpty())
			desc = uri;
		if (prot == "parallel" || prot == "file")
			index = 0;
		else if (prot == "serial")
			index = 1;
		else if (prot == "usb")
			index = 2;
		else if (cl == "direct")
			index = 3;
		else
			continue;
		last[index] = new TQListViewItem(m_parents[index], last[index], desc, uri);
		last[index]->setPixmap(0, SmallIcon("blockdevice"));
		m_parents[index]->setOpen(true);
		m_uris << uri;
		if (!printer.isEmpty())
		{
			TQListViewItem	*pItem = new TQListViewItem(last[index], printer);
			last[index]->setOpen(true);
			pItem->setPixmap(0, SmallIcon("tdeprint_printer"));
		}
	}
	m_initialized = true;
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:44,代码来源:kmwlocal.cpp

示例7: readDFDone

void MntConfigWidget::readDFDone( void )
{
  mInitializing = false;
  mList->clear();
  mDiskLookup.resize(mDiskList.count());

  int i=0;
  TQListViewItem *item = 0;
  for( DiskEntry *disk=mDiskList.first(); disk!=0; disk=mDiskList.next(),++i )
  {
     item = new TQListViewItem( mList, item, TQString(), disk->deviceName(),
      disk->mountPoint(), disk->mountCommand(), disk->umountCommand() );
     item->setPixmap( ICONCOL, SmallIcon( disk->iconName() ) );
     mDiskLookup[i] = item;
  }

  loadSettings();
  applySettings();
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:19,代码来源:mntconfig.cpp

示例8: defaultsBtnClicked

void KDFConfigWidget::defaultsBtnClicked( void )
{
  mStd.setDefault();
  mScroll->setValue( mStd.updateFrequency() );
  mLCD->display( mStd.updateFrequency() );
  mPopupFullCheck->setChecked( mStd.popupIfFull() );
  mOpenMountCheck->setChecked( mStd.openFileManager() );
  mFileManagerEdit->setText( mStd.fileManager() );

  TQListViewItem *item = mList->firstChild();
  if( item != 0 )
  {
    for( int i=mList->header()->count(); i>0; i-- )
    {
        item->setText( i-1, i18n("visible") );
     	item->setPixmap( i-1, UserIcon ( "tick" ) );

    }
  }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:20,代码来源:kdfconfig.cpp

示例9: KMWizardPage

KMWLocal::KMWLocal(TQWidget *parent, const char *name)
: KMWizardPage(parent,name)
{
	m_title = i18n("Local Port Selection");
	m_ID = KMWizard::Local;
	m_nextpage = KMWizard::Driver;
	m_initialized = false;
	m_block = false;

	m_ports = new TDEListView(this);
	m_ports->setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
	m_ports->setLineWidth(1);
	m_ports->header()->hide();
	m_ports->addColumn("");
	m_ports->setSorting(-1);
	TQListViewItem	*root = new TQListViewItem(m_ports, i18n("Local System"));
	root->setPixmap(0, SmallIcon("tdeprint_computer"));
	root->setOpen(true);
	connect(m_ports, TQT_SIGNAL(selectionChanged(TQListViewItem*)), TQT_SLOT(slotPortSelected(TQListViewItem*)));
	TQLabel	*l1 = new TQLabel(i18n("URI:"), this);
	m_localuri = new TQLineEdit(this);
	connect( m_localuri, TQT_SIGNAL( textChanged( const TQString& ) ), TQT_SLOT( slotTextChanged( const TQString& ) ) );
	m_parents[0] = new TQListViewItem(root, i18n("Parallel"));
	m_parents[1] = new TQListViewItem(root, m_parents[0], i18n("Serial"));
	m_parents[2] = new TQListViewItem(root, m_parents[1], i18n("USB"));
	m_parents[3] = new TQListViewItem(root, m_parents[2], i18n("Others"));
	for (int i=0;i<4;i++)
		m_parents[i]->setPixmap(0, SmallIcon("input_devices_settings"));
	TQLabel	*l2 = new TQLabel(i18n("<p>Select a valid detected port, or enter directly the corresponding URI in the bottom edit field.</p>"), this);

	TQVBoxLayout	*lay0 = new TQVBoxLayout(this, 0, 10);
	TQHBoxLayout	*lay1 = new TQHBoxLayout(0, 0, 10);
	lay0->addWidget(l2, 0);
	lay0->addWidget(m_ports, 1);
	lay0->addLayout(lay1, 0);
	lay1->addWidget(l1, 0);
	lay1->addWidget(m_localuri, 1);
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:38,代码来源:kmwlocal.cpp

示例10: TQIconViewItem

TopLevel::TopLevel(TQWidget *parent, const char *name)
    : TQWidget(parent, name)
{
    setCaption("Item container test application");

    TQHBoxLayout* hBox = new TQHBoxLayout( this );
    TQVBoxLayout* vBox = new TQVBoxLayout( hBox );
    hBox->addSpacing( 5 );

    //Selection mode selection
    m_pbgMode = new TQButtonGroup( 1, Qt::Horizontal, "Selection Mode", this);
    m_pbgMode->insert(new TQRadioButton("NoSlection", m_pbgMode), TopLevel::NoSelection );
    m_pbgMode->insert(new TQRadioButton("Single", m_pbgMode), TopLevel::Single );
    m_pbgMode->insert(new TQRadioButton("Multi", m_pbgMode), TopLevel::Multi );
    m_pbgMode->insert(new TQRadioButton("Extended", m_pbgMode), TopLevel::Extended );
    m_pbgMode->setExclusive( true );
    vBox->addWidget( m_pbgMode );

    connect( m_pbgMode, TQT_SIGNAL( clicked( int ) ),
	     this, TQT_SLOT( slotSwitchMode( int ) ) );

    //Signal labels
    TQGroupBox* gbWiget = new TQGroupBox( 1, Qt::Horizontal, "Widget", this);
    m_plblWidget = new TQLabel( gbWiget );
    vBox->addWidget( gbWiget );
    TQGroupBox* gbSignal = new TQGroupBox( 1, Qt::Horizontal, "emitted Signal", this);
    m_plblSignal = new TQLabel( gbSignal );
    vBox->addWidget( gbSignal );
    TQGroupBox* gbItem = new TQGroupBox( 1, Qt::Horizontal, "on Item", this);
    m_plblItem = new TQLabel( gbItem );
    vBox->addWidget( gbItem );

    TQButtonGroup* bgListView = new TQButtonGroup( 1, Qt::Horizontal, "TDEListView", this);
    TQCheckBox* cbListView = new TQCheckBox("Single Column", bgListView);
    vBox->addWidget( bgListView );
    connect( cbListView, TQT_SIGNAL( toggled( bool ) ),
	     this, TQT_SLOT( slotToggleSingleColumn( bool ) ) );

    TDEGlobal::config()->reparseConfiguration();

    //Create IconView
    TQGroupBox* gbIconView = new TQGroupBox( 1, Qt::Horizontal, "TDEIconView", this);
    m_pIconView = new TDEIconView( gbIconView );
    hBox->addWidget( gbIconView );
    hBox->addSpacing( 5 );
    connect( m_pIconView, TQT_SIGNAL( executed( TQIconViewItem* ) ),
	     this, TQT_SLOT( slotIconViewExec( TQIconViewItem* ) ) );

    //Create ListView
    TQGroupBox* gbListView = new TQGroupBox( 1, Qt::Horizontal, "TDEListView", this);
    m_pListView = new TDEListView( gbListView );
    m_pListView->addColumn("Item");
    m_pListView->addColumn("Text");
    hBox->addWidget( gbListView );
    hBox->addSpacing( 5 );
    connect( m_pListView, TQT_SIGNAL( executed( TQListViewItem* ) ),
	     this, TQT_SLOT( slotListViewExec( TQListViewItem* ) ) );

    //Create ListBox
    TQGroupBox* gbListBox = new TQGroupBox( 1, Qt::Horizontal, "TDEListBox", this);
    m_pListBox = new TDEListBox( gbListBox );
    hBox->addWidget( gbListBox );
    connect( m_pListBox, TQT_SIGNAL( executed( TQListBoxItem* ) ),
	     this, TQT_SLOT( slotListBoxExec( TQListBoxItem* ) ) );

    //Initialize buttons
    cbListView->setChecked( !m_pListView->allColumnsShowFocus() );
    m_pbgMode->setButton( TopLevel::Extended );
    slotSwitchMode( TopLevel::Extended );

    //Fill container widgets
    for( int i = 0; i < 10; i++ ) {
      new TQIconViewItem( m_pIconView, TQString("Item%1").arg(i), TQPixmap(item_xpm) );

      TQListViewItem* lv = new TQListViewItem( m_pListView, TQString("Item%1").arg(i), TQString("Text%1").arg(i) );
      lv->setPixmap( 0, TQPixmap(item_xpm));
      lv->setPixmap( 1, TQPixmap(item_xpm));
      
      new TQListBoxPixmap( m_pListBox, TQPixmap(item_xpm), TQString("Item%1").arg(i));
    }

    connect( m_pIconView, TQT_SIGNAL( clicked( TQIconViewItem* ) ),
	     this, TQT_SLOT( slotClicked( TQIconViewItem* ) ) );
    connect( m_pIconView, TQT_SIGNAL( doubleClicked( TQIconViewItem* ) ),
	     this, TQT_SLOT( slotDoubleClicked( TQIconViewItem* ) ) );
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:86,代码来源:itemcontainertest.cpp

示例11: TQWidget

KDFConfigWidget::KDFConfigWidget(TQWidget *parent, const char *name, bool init)
  : TQWidget( parent, name)
{

  mTabName.resize(8);
  mTabName[0] = new CTabName( "Icon", i18n("Icon") );
  mTabName[1] = new CTabName( "Device", i18n("Device") );
  mTabName[2] = new CTabName( "Type", i18n("Type") );
  mTabName[3] = new CTabName( "Size", i18n("Size") );
  mTabName[4] = new CTabName( "MountPoint", i18n("Mount Point") );
  mTabName[5] = new CTabName( "Free", i18n("Free") );
  // xgettext:no-c-format
  mTabName[6] = new CTabName( "Full%", i18n("Full %") );
  mTabName[7] = new CTabName( "UsageBar", i18n("Usage") );

  GUI = !init;
  if(GUI)
  {
    TQString text;
    TQVBoxLayout *topLayout = new TQVBoxLayout( this, 0, KDialog::spacingHint());

    mList = new CListView( this, "list", 1 );
    mList->setAllColumnsShowFocus(true);
    mList->setFrameStyle( TQFrame::WinPanel + TQFrame::Sunken );
    mList->header()->setMovingEnabled(false);
    for( uint i=0; i < mTabName.size(); i++ )
    {
      mList->addColumn( mTabName[i]->mName );
    }
    connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)),
	     this, TQT_SLOT(toggleListText(TQListViewItem *,const TQPoint &,int)));
    connect( mList, TQT_SIGNAL(clicked(TQListViewItem *, const TQPoint &, int)),
	     this, TQT_SLOT(slotChanged()));
    topLayout->addWidget( mList );

    TQListViewItem *mListItem = new TQListViewItem( mList );
    for( uint i=mList->header()->count(); i>0; i-- )
    {
     mListItem->setText(i-1, i18n("visible") );
     mListItem->setPixmap( i-1, UserIcon ( "tick" ) );
    }
    mList->setSelected( mListItem, true );

    TQGridLayout *gl = new TQGridLayout( 2, 2 );
    topLayout->addLayout( gl );
    gl->setColStretch( 1, 10 );

    mScroll = new TQScrollBar( this );
    TQ_CHECK_PTR(mScroll);
    mScroll->setOrientation( Qt::Horizontal );
    mScroll->setSteps(1,20);
    mScroll->setRange(0, 180 );
    gl->addWidget( mScroll, 1, 1 );
    connect(mScroll,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(slotChanged()));

    mLCD = new TQLCDNumber( this );
    TQ_CHECK_PTR(mLCD);
    mLCD->setNumDigits( 3 );
    mLCD->setSegmentStyle(TQLCDNumber::Filled);
    connect(mScroll,TQT_SIGNAL(valueChanged(int)),mLCD,TQT_SLOT(display(int)));
    gl->addMultiCellWidget( mLCD, 0, 1, 0, 0 );

    text = i18n("Update frequency [seconds]. The value 0 disables update" );
    TQLabel *label = new TQLabel( text, this );
    TQ_CHECK_PTR(label);
    gl->addWidget( label, 0, 1 );


    label = new TQLabel( i18n("File manager (e.g. konsole -e mc %m):") ,this);
    TQ_CHECK_PTR(label);
    topLayout->addWidget( label );

    mFileManagerEdit = new TQLineEdit( this );
    TQ_CHECK_PTR(mFileManagerEdit);
    topLayout->addWidget( mFileManagerEdit );
    connect(mFileManagerEdit,TQT_SIGNAL(textChanged (const TQString &)),this,TQT_SLOT(slotChanged()));

    text = i18n("Open file manager automatically on mount");
    mOpenMountCheck = new TQCheckBox(text, this );
    TQ_CHECK_PTR(mOpenMountCheck);
    topLayout->addWidget( mOpenMountCheck );
    connect(mOpenMountCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged()));

    text = i18n("Pop up a window when a disk gets critically full");
    mPopupFullCheck = new TQCheckBox( text, this );
    TQ_CHECK_PTR(mPopupFullCheck);
    topLayout->addWidget( mPopupFullCheck );
    connect(mPopupFullCheck,TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(slotChanged()));
  }

  loadSettings();
  if( init )
  {
    applySettings();
  }
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:96,代码来源:kdfconfig.cpp


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