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


C++ QListViewItem::setRenameEnabled方法代码示例

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


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

示例1: slotInsert

void SequenceEditor::slotInsert()
{
  assert(m_tempValues);

  QListViewItem* item = NULL;
  if (m_list->currentItem())
    {
      item = new QListViewItem(m_list, m_list->currentItem());
    }
  else
    {
      item = new QListViewItem(m_list, m_list->lastItem());
    }

  QString s;
  for (t_channel ch = 0; ch < m_channels; ch++)
    {
      s.sprintf("%.3d", m_tempValues[ch].value);
      if (m_tempValues[ch].type == Scene::NoSet)
	{
	  item->setText(ch, "---");
	}
      else
	{
	  item->setText(ch, s);
	}

      // Rename doesn't work with rmb click in pre 3.3, 
      // so it won't be available anywhere
      item->setRenameEnabled(ch, false);
    }

  m_list->setSelected(item, true);
  m_list->ensureItemVisible(item);
}
开发者ID:speakman,项目名称:qlc,代码行数:35,代码来源:sequenceeditor.cpp

示例2: setRenameEnabled

void VariablesListViewItem::setRenameEnabled( int col, bool b ) {
  QListViewItem::setRenameEnabled(col, b);

  QListViewItem* item = firstChild();
  while(item) {
    item->setRenameEnabled(col, b);
    item = item->nextSibling();
  }
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:9,代码来源:variableslistviewitem.cpp

示例3: functionAdd

void EditFunctions::functionAdd( const QString &access, const QString &type )
{
    QListViewItem *i = new QListViewItem( functionListView );
    i->setPixmap( 0, QPixmap::fromMimeSource( "designer_editslots.png" ) );
    i->setRenameEnabled( 0, TRUE );
    i->setText( 1, "void" );
    i->setText( 2, "virtual" );

    if ( access.isEmpty() )
        i->setText( 3, "public" );
    else
        i->setText( 3, access );

    if( type.isEmpty() ) {
        if ( showOnlySlots->isChecked() )
            i->setText( 4, "slot" );
        else {
            i->setText( 4, lastType );
        }
    } else {
        i->setText( 4, type );
    }

    if ( i->text( 4 ) == "slot" ) {
        i->setText( 0, "newSlot()" );
        if ( MetaDataBase::isSlotUsed( formWindow, "newSlot()" ) )
            i->setText( 5, tr( "Yes" ) );
        else
            i->setText( 5, tr( "No" ) );
    } else {
        i->setText( 0, "newFunction()" );
        i->setText( 5, "---" );
    }

    functionListView->setCurrentItem( i );
    functionListView->setSelected( i, TRUE );
    functionListView->ensureItemVisible( i );
    functionName->setFocus();
    functionName->selectAll();

    FunctItem fui;
    fui.id = id;
    fui.oldName = i->text( 0 );
    fui.newName = fui.oldName;
    fui.oldRetTyp = i->text( 1 );
    fui.retTyp = fui.oldRetTyp;
    fui.oldSpec = i->text ( 2 );
    fui.spec = fui.oldSpec;
    fui.oldAccess = i->text( 3 );
    fui.access = fui.oldAccess;
    fui.oldType = i->text( 4 );
    fui.type = fui.oldType;
    lastType = fui.oldType;
    functList.append( fui );
    functionIds.insert( i, id );
    id++;
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:57,代码来源:editfunctionsimpl.cpp

示例4: itemNewClicked

void ListViewEditor::itemNewClicked()
{
    QListViewItem *item = new QListViewItem( itemsPreview );
    item->setText( 0, "Item" );
    item->setRenameEnabled( 0, TRUE );
    itemsPreview->setCurrentItem( item );
    itemsPreview->setSelected( item, TRUE );
    itemText->setFocus();
    itemText->selectAll();
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:10,代码来源:listvieweditorimpl.cpp

示例5: setReadOnly

void VariablesListView::setReadOnly(bool readOnly)
{
  m_isReadOnly = readOnly;

  QListViewItem* item = firstChild();
  while(item)
  {
    item->setRenameEnabled(ValueCol, !m_isReadOnly);
    item = item->nextSibling();
  }
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:11,代码来源:variableslistview.cpp

示例6: itemNewSubClicked

void ListViewEditor::itemNewSubClicked()
{
    QListViewItem *parent = itemsPreview->currentItem();
    QListViewItem *item = 0;
    if ( parent ) {
	item = new QListViewItem( parent );
	parent->setOpen( TRUE );
    } else {
	item = new QListViewItem( itemsPreview );
    }
    item->setText( 0, "Subitem" );
    item->setRenameEnabled( 0, TRUE );
    itemsPreview->setCurrentItem( item );
    itemsPreview->setSelected( item, TRUE );
}
开发者ID:AliYousuf,项目名称:abanq-port,代码行数:15,代码来源:listvieweditorimpl.cpp

示例7: main_tab


//.........这里部分代码省略.........
    // No save for now...
    SaveButton->setEnabled(false);

    QObject::connect(&QuitButton, SIGNAL(clicked()), &my_dialogs, SLOT(CheckSaved()));
    QObject::connect(&AboutButton, SIGNAL(clicked()), &my_dialogs, SLOT(ShowAbout()));
    QObject::connect(&AddButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoAdd()));
    QObject::connect(SaveButton, SIGNAL(clicked()), &my_dialogs, SLOT(DoSave()));

    // We're now using human readable data, handle the migration
    // transparently for the user.
    homedir = getenv("HOME");

    if (homedir != NULL) {

        snprintf(temp, FILENAME_MAX, "%s/%s", homedir, ".thefishrc");
        fd = open(temp, O_RDONLY, 0);

        if (fd != -1 ) {

            i = lseek(fd, 0, SEEK_END);
            lseek(fd, 0, SEEK_SET);

            if (i == sizeof(oldsize)) {

                read(fd, &oldsize[0], sizeof(oldsize));
                close(fd);

            } else {

                fp = fdopen(fd, "r");
                fscanf(fp, "geometry=%i,%i", &oldsize[0], &oldsize[1]);
                fclose(fp);

            }

        } else  {
            // Set some default values
            oldsize[0] = 400;
            oldsize[1] = 480;

        }

    }

    // Build the table

    knobs_table->setColumnWidthMode (1, QListView::Maximum);
    knobs_table->setRootIsDecorated(false);

    for (i = my_rc->knobs_size - 1; i >= 0; i--) {

        // No user comments yet
        (my_rc->knobs_ptr+i)->user_comment = 0;

        foo = new QCheckListItem( knobs_table, (my_rc->knobs_ptr+i)->name, QCheckListItem::CheckBox);

        if ((my_rc->knobs_ptr+i)->knob_val == KNOB_IS_NO) {

            foo->setOn(FALSE);

        } else {

            foo->setOn(TRUE);

        }

    }

    for (i = my_rc->string_size - 1; i >= 0; i--) {

        // No user comments yet
        (my_rc->string_ptr+i)->user_comment = 0;

        element = new QListViewItem(strings_table,
                                    (my_rc->string_ptr+i)->name,
                                    (my_rc->string_ptr+i)->value);
        element->setRenameEnabled(0, FALSE);
        element->setRenameEnabled(1, TRUE);

    }

    // Set the app icon
    QPixmap my_icon((const char **) fish64_xpm);

    mw->setIcon((const QPixmap ) my_icon);

    mw->setCaption("The Fish " THE_FISH_VERSION);
    mw->setCentralWidget( vbox );
    thefish->setMainWidget(mw);
    mw->show();
    mw->resize(oldsize[0], oldsize[1]);

    dirty = 0;

    my_status_bar = mw->statusBar();
    my_status_bar->message("Ready");

    return thefish->exec();

}
开发者ID:BackupTheBerlios,项目名称:thefish-svn,代码行数:101,代码来源:qt_ui.C

示例8: QDialog


//.........这里部分代码省略.........
                (my_rc_knobs+my_num_knobs)->user_added = USER_ADDED_YES;
                (my_rc_knobs+my_num_knobs)->knob_val = KNOB_IS_YES;
                (my_rc_knobs+my_num_knobs)->knob_orig = KNOB_IS_YES;
                (my_rc_knobs+my_num_knobs)->modified = MODIFIED_YES;

                strncpy((my_rc_knobs+my_num_knobs)->name, new_name, 255);


                if (new_comment != NULL) {

                    if (strlen(new_comment) > 1) {

                        strncpy((my_rc_knobs+my_num_knobs)->comment, new_comment, 255);
                        (my_rc_knobs+my_num_knobs)->user_comment = 1;

                    }

                }

                foo = new QCheckListItem(knobs_table, (my_rc_knobs+my_num_knobs)->name,
                                         QCheckListItem::CheckBox);
                foo->setOn(TRUE);

                my_num_knobs++;
                dirty++;
                SaveButton->setEnabled(TRUE);

                // It's a knob set to NO
            } else if (strncasecmp(new_value, KNOB_NO, 255) == 0) {

                (my_rc_knobs+my_num_knobs)->user_comment = 0;
                (my_rc_knobs+my_num_knobs)->user_added = USER_ADDED_YES;
                (my_rc_knobs+my_num_knobs)->knob_val = KNOB_IS_NO;
                (my_rc_knobs+my_num_knobs)->knob_orig = KNOB_IS_NO;
                (my_rc_knobs+my_num_knobs)->modified = MODIFIED_YES;

                strncpy((my_rc_knobs+my_num_knobs)->name, new_name, 255);


                if (new_comment != NULL) {

                    if (strlen(new_comment) > 1) {

                        strncpy((my_rc_knobs+my_num_knobs)->comment, new_comment, 255);
                        (my_rc_knobs+my_num_knobs)->user_comment = 1;

                    }

                }

                foo = new QCheckListItem(knobs_table, (my_rc_knobs+my_num_knobs)->name,
                                         QCheckListItem::CheckBox);
                foo->setOn(FALSE);

                my_num_knobs++;
                dirty++;
                SaveButton->setEnabled(TRUE);

                // It's a string
            } else {

                (my_rc_strings+my_num_strings)->user_comment = 0;
                (my_rc_strings+my_num_strings)->user_added = USER_ADDED_YES;
                (my_rc_strings+my_num_strings)->modified = MODIFIED_YES;

                strncpy((my_rc_strings+my_num_strings)->name, new_name, 255);
                strncpy((my_rc_strings+my_num_strings)->value, new_value, 255);
                strncpy((my_rc_strings+my_num_strings)->orig, new_value, 255);

                if (new_comment != NULL) {

                    if (strlen(new_comment) > 1) {

                        strncpy((my_rc_strings+my_num_strings)->comment, new_comment, 255);
                        (my_rc_strings+my_num_strings)->user_comment = 1;

                    }

                }

                element = new QListViewItem(strings_table,
                                            (my_rc_strings+my_num_strings)->name,
                                            (my_rc_strings+my_num_strings)->value);

                element->setRenameEnabled(0, FALSE);
                element->setRenameEnabled(1, TRUE);

                my_num_strings++;
                dirty++;
                SaveButton->setEnabled(TRUE);

            }

        }

    }

    delete(my_add_dialog);

}
开发者ID:BackupTheBerlios,项目名称:thefish-svn,代码行数:101,代码来源:qt_ui.C


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