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


C++ setSorting函数代码示例

本文整理汇总了C++中setSorting函数的典型用法代码示例。如果您正苦于以下问题:C++ setSorting函数的具体用法?C++ setSorting怎么用?C++ setSorting使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: QListView

HierarchyList::HierarchyList( QWidget *parent, FormWindow *fw, bool doConnects )
    : QListView( parent ), formWindow( fw )
{
    init_colors();

    setDefaultRenameAction( Accept );
    header()->setMovingEnabled( false );
    header()->setStretchEnabled( true );
    normalMenu = 0;
    tabWidgetMenu = 0;
    addColumn( i18n("Name" ) );
    addColumn( i18n("Class" ) );
    QPalette p( palette() );
    p.setColor( QColorGroup::Base, QColor( *backColor2 ) );
    (void)*selectedBack; // hack
    setPalette( p );
    disconnect( header(), SIGNAL( sectionClicked( int ) ),
    this, SLOT( changeSortColumn( int ) ) );
    setSorting( -1 );
    setHScrollBarMode( AlwaysOff );
    setVScrollBarMode( AlwaysOn );
    if ( doConnects ) {
  connect( this, SIGNAL( clicked( QListViewItem * ) ),
     this, SLOT( objectClicked( QListViewItem * ) ) );
  connect( this, SIGNAL( returnPressed( QListViewItem * ) ),
     this, SLOT( objectClicked( QListViewItem * ) ) );
  connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint&, int ) ),
     this, SLOT( showRMBMenu( QListViewItem *, const QPoint & ) ) );
    }
    deselect = true;
    setColumnWidthMode( 1, Manual );
}
开发者ID:serghei,项目名称:kde3-kdewebdev,代码行数:32,代码来源:hierarchyview.cpp

示例2: TQListView

KMListView::KMListView(TQWidget *parent, const char *name)
: TQListView(parent,name)
{
	m_items.setAutoDelete(false);

	addColumn("");
	header()->hide();
	setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken);
	setLineWidth(1);
	setSorting(0);

	connect(this,TQT_SIGNAL(contextMenuRequested(TQListViewItem*,const TQPoint&,int)),TQT_SLOT(slotRightButtonClicked(TQListViewItem*,const TQPoint&,int)));
	connect(this,TQT_SIGNAL(selectionChanged()),TQT_SLOT(slotSelectionChanged()));
	connect(this,TQT_SIGNAL(onItem(TQListViewItem*)),TQT_SLOT(slotOnItem(TQListViewItem*)));
	connect(this,TQT_SIGNAL(onViewport()),TQT_SLOT(slotOnViewport()));

	m_root = new KMListViewItem(this,i18n("Print System"));
	m_root->setPixmap(0,SmallIcon("tdeprint_printer"));
	m_root->setOpen(true);
	m_classes = new KMListViewItem(m_root,i18n("Classes"));
	m_classes->setPixmap(0,SmallIcon("package"));
	m_classes->setOpen(true);
	m_printers = new KMListViewItem(m_root,i18n("Printers"));
	m_printers->setPixmap(0,SmallIcon("package"));
	m_printers->setOpen(true);
	m_specials = new KMListViewItem(m_root,i18n("Specials"));
	m_specials->setPixmap(0,SmallIcon("package"));
	m_specials->setOpen(true);

	sort();
}
开发者ID:Fat-Zer,项目名称:tdelibs,代码行数:31,代码来源:kmlistview.cpp

示例3: QTable

DbTable::DbTable( int numRows, int numCols, QWidget *parent, const char *name)
    : QTable(numRows, numCols, parent, name)
{
    setSorting( TRUE );
	
//    adjustColumn( 0 );
}
开发者ID:jiajw0426,项目名称:easyscada,代码行数:7,代码来源:dbtable.cpp

示例4: K3ListView

KOAttendeeListView::KOAttendeeListView ( QWidget *parent )
    : K3ListView( parent )
{
    setAcceptDrops( true );
    setAllColumnsShowFocus( true );
    setSorting( -1 );
}
开发者ID:akhuettel,项目名称:kdepim-noakonadi,代码行数:7,代码来源:koeditordetails.cpp

示例5: QListView

Workspace::Workspace( QWidget *parent, MainWindow *mw )
    : QListView( parent, 0, WStyle_Customize | WStyle_NormalBorder | WStyle_Title |
		 WStyle_Tool | WStyle_MinMax | WStyle_SysMenu ), mainWindow( mw ),
	project( 0 ), completionDirty( FALSE )
{
    init_colors();

    setDefaultRenameAction( Accept );
    blockNewForms = FALSE;
    bufferEdit = 0;
    header()->setStretchEnabled( TRUE );
    header()->hide();
    setSorting( 0 );
    setResizePolicy( QScrollView::Manual );
#ifndef Q_WS_MAC
    QPalette p( palette() );
    p.setColor( QColorGroup::Base, QColor( *backColor2 ) );
    (void)*selectedBack; // hack
    setPalette( p );
#endif
    addColumn( tr( "Files" ) );
    setAllColumnsShowFocus( TRUE );
    connect( this, SIGNAL( mouseButtonClicked( int, QListViewItem *, const QPoint &, int ) ),
	     this, SLOT( itemClicked( int, QListViewItem *, const QPoint& ) ) ),
    connect( this, SIGNAL( doubleClicked( QListViewItem * ) ),
	     this, SLOT( itemDoubleClicked( QListViewItem * ) ) ),
    connect( this, SIGNAL( contextMenuRequested( QListViewItem *, const QPoint &, int ) ),
	     this, SLOT( rmbClicked( QListViewItem *, const QPoint& ) ) ),
    setHScrollBarMode( AlwaysOff );
    setVScrollBarMode( AlwaysOn );
    viewport()->setAcceptDrops( TRUE );
    setAcceptDrops( TRUE );
    setColumnWidthMode( 1, Manual );
}
开发者ID:Miguel-J,项目名称:eneboo-core,代码行数:34,代码来源:workspace.cpp

示例6: KListView

VariablesListView::VariablesListView(QWidget *parent, const char *name)
    : KListView(parent, name), m_variables(0), m_isReadOnly(false)
{
  setAllColumnsShowFocus(true);
  setRootIsDecorated(true);
  setSorting(-1);

  addColumn(tr2i18n("Name"));
  addColumn(tr2i18n("Value"));
  addColumn(tr2i18n("Type"));

  setColumnWidthMode(NameCol,  Manual);
  setColumnWidthMode(ValueCol, Manual);
  setColumnWidthMode(TypeCol,  Manual);

  setColumnWidth(NameCol,  150);
  setColumnWidth(ValueCol, 150);
  setColumnWidth(TypeCol,  150);

  connect(this, SIGNAL(expanded(QListViewItem*)),
          this, SLOT(slotItemExpanded(QListViewItem*)));
  connect(this, SIGNAL(collapsed(QListViewItem*)),
          this, SLOT(slotItemCollapsed(QListViewItem*)));

  connect(this, SIGNAL(itemRenamed(QListViewItem*, int, const QString&)),
          this, SLOT(slotItemRenamed(QListViewItem*, int, const QString&)));

  connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int )),
          this, SLOT(slotDoubleClick( QListViewItem *, const QPoint &, int )));

  //connect(m_menu, SIGNAL(activated(int)), this, SLOT(slotCopyVarToClipboard(int)));

  connect(this, SIGNAL(contextMenuRequested(QListViewItem *, const QPoint& , int)),
          this, SLOT(slotContextMenuRequested(QListViewItem *, const QPoint &, int)));
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:35,代码来源:variableslistview.cpp

示例7: KListView

VariableTree::VariableTree(VariableWidget *parent, const char *name)
    : KListView(parent, name),
      QToolTip( viewport() ),
      activationId_(0),
      currentThread_(-1),
	  selectedFrame_(0),
	  watchRoot_(0),
	  globalRoot_(0)
{
    setRootIsDecorated(true);
    setAllColumnsShowFocus(true);
    setColumnWidthMode(0, Manual);
    setSorting(VAR_NAME_COLUMN);
    QListView::setSelectionMode(QListView::Single);

    addColumn(i18n("Variable"), 100 );
    addColumn(i18n("Value"), 100 );

    connect( this, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)),
             SLOT(slotContextMenu(KListView*, QListViewItem*)) );
    
	connect( this, SIGNAL(pressed(QListViewItem*)),
             this, SLOT(slotPressed(QListViewItem*)) );

	watchRoot_ = new WatchRoot(this);
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:26,代码来源:variablewidget.cpp

示例8: TDEListView

KSim::MonitorPrefs::MonitorPrefs(TQWidget *parent, const char *name)
    : TDEListView(parent, name)
{
  addColumn(i18n("Monitor"));
  addColumn(i18n("Description"));
  addColumn(i18n("LMB Command"));

  setItemsRenameable(true);
  setRenameable(0, false);
  setRenameable(2, true);
  setDragEnabled(true);
  setAcceptDrops(true);
  setAllColumnsShowFocus(true);
  setSelectionMode(TQListView::Single);

  // Scan for .desktop files and enter them into the TDEListView
  m_locatedFiles = TDEGlobal::dirs()->findAllResources("data", "ksim/monitors/*.desktop");
  m_locatedFiles.sort();
  TQStringList::ConstIterator it;
  for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) {
    KDesktopFile file((*it), true);
    (void)(new TQCheckListItem(this, file.readName(), TQCheckListItem::CheckBox))->setText(1, file.readComment());
  }

  sort();
  setSorting(-1, false);
}
开发者ID:Fat-Zer,项目名称:tdeutils,代码行数:27,代码来源:monitorprefs.cpp

示例9: KListView

SnippetWidget::SnippetWidget(SnippetPart *part)
		: KListView(0, "snippet widget"), QToolTip( viewport() ),
		m_part( part )
{
    // init the QPtrList
    _list.setAutoDelete(TRUE);

    // init the KListView
    setSorting( -1 );
    addColumn( "" );
    setFullWidth(true);
    header()->hide();
    setAcceptDrops(true);
    setDragEnabled(false);
    setDropVisualizer(false);
    setRootIsDecorated(true);

    //connect the signals
    connect( this, SIGNAL( contextMenuRequested ( QListViewItem *, const QPoint & , int ) ),
             this, SLOT( showPopupMenu(QListViewItem *, const QPoint & , int ) ) );

    connect( this, SIGNAL( executed (QListViewItem *) ),
             this, SLOT( slotExecuted( QListViewItem *) ) );
    connect( this, SIGNAL( returnPressed (QListViewItem *) ),
             this, SLOT( slotExecuted( QListViewItem *) ) );

    connect( this, SIGNAL( dropped(QDropEvent *, QListViewItem *) ),
             this, SLOT( slotDropped(QDropEvent *, QListViewItem *) ) );

    _cfg = 0;

    QTimer::singleShot(0, this, SLOT(initConfig()));
}
开发者ID:serghei,项目名称:kde3-kdevelop,代码行数:33,代码来源:snippet_widget.cpp

示例10: PropertyList

CXmlPropertyList::CXmlPropertyList( CXmlPropertyEditor *e )
    : PropertyList( e ), editor( e )
{
    init_colors();

    whatsThis = new PropertyWhatsThis( this );
    showSorted = FALSE;
    header()->setMovingEnabled( FALSE );
    header()->setStretchEnabled( TRUE );
    setResizePolicy( QScrollView::Manual );
    viewport()->setAcceptDrops( false );
    viewport()->installEventFilter( this );
    addColumn( tr( "Property" ) );
    addColumn( tr( "Value" ) );

    connect( header(), SIGNAL( sizeChange( int, int, int ) ), this, SLOT( updateEditorSize() ) );
    connect( header(), SIGNAL( sectionClicked( int ) ), this, SLOT( toggleSort() ) );
    connect( this, SIGNAL( pressed( QListViewItem *, const QPoint &, int ) ), this, SLOT( itemPressed( QListViewItem *, const QPoint &, int ) ) );
    connect( this, SIGNAL( doubleClicked( QListViewItem * ) ), this, SLOT( toggleOpen( QListViewItem * ) ) );
    disconnect( header(), SIGNAL( sectionClicked( int ) ), this, SLOT( changeSortColumn( int ) ) );

    setSorting( -1 );
    setHScrollBarMode( AlwaysOff );
    setVScrollBarMode( AlwaysOn );
    setColumnWidthMode( 1, Manual );
    mousePressed = FALSE;
    pressItem = 0;
    theLastEvent = MouseEvent;
    header()->installEventFilter( this );
}
开发者ID:nanzhang790,项目名称:View3dn,代码行数:30,代码来源:xmlpropertylist.cpp

示例11: TQListView

EvaListView::EvaListView(TQWidget *parent, const char *name, WFlags f)
	: TQListView(parent, name, f)
{
	setItemMargin(EVA_LV_LEFT_MARGIN);
	addColumn("1");
	setColumnWidthMode( 0, Manual);
// 	addColumn("2");
// 	setColumnWidthMode( 1, Manual);
	header()->hide();
	setSorting(0);
	setRootIsDecorated( false );
	setTreeStepSize( 8 );
	setDragAutoScroll(true);
	setHScrollBarMode(TQScrollView::AlwaysOff);
	setFrameShape( TQFrame::NoFrame );
	
	setAcceptDrops( true );
	setSelectionMode( TQListView::Extended );
	setSelectionMode(TQListView::Single);
	m_tooltip = new EvaLVToolTip(this);
	
	clearWFlags( WStaticContents );
	setWFlags( WNoAutoErase );
	
	static_cast<EvaListView*>(viewport())->clearWFlags( WStaticContents );
	static_cast<EvaListView*>(viewport())->setWFlags( WNoAutoErase );
	
	codec = TQTextCodec::codecForName("GB18030");

}
开发者ID:MagicGroup,项目名称:eva,代码行数:30,代码来源:evalistview.cpp

示例12: toTreeWidget

toListView::toListView(QWidget *parent, const char *name, Qt::WFlags f)
    : toTreeWidget(parent, name, f),
      toEditWidget(false, true, true,
                   false, false,
                   false, false, false,
                   true, true, false)
{
    setTreeStepSize(15);
    setSelectionMode(Extended);
    setAllColumnsShowFocus(true);

    setSorting(-1);
    Menu = NULL;
    setContextMenuPolicy(Qt::CustomContextMenu);
    connect(this,
            SIGNAL(customContextMenuRequested(const QPoint &)),
            this,
            SLOT(displayMenu(const QPoint &)));
    QString str(toConfigurationSingle::Instance().listFont());
    if (!str.isEmpty())
    {
        QFont font(toStringToFont(str));
        setFont(font);
    }
    LastMove = QPoint(-1, -1);
}
开发者ID:netrunner-debian-kde-extras,项目名称:tora,代码行数:26,代码来源:toresultview.cpp

示例13: K3ListView

LogListView::LogListView(KConfig& cfg, QWidget *parent, const char *name)
    : K3ListView(parent)
    , partConfig(cfg)
{
	setObjectName(name);
    setAllColumnsShowFocus(true);
    setShowToolTips(false);
    setShowSortIndicator(true);
    setMultiSelection(true);
    setSorting(LogListViewItem::Revision, false);
    addColumn(i18n("Revision"));
    addColumn(i18n("Author"));
    addColumn(i18n("Date"));
    addColumn(i18n("Branch"));
    addColumn(i18n("Comment"));
    addColumn(i18n("Tags"));

    Cervisia::ToolTip* toolTip = new Cervisia::ToolTip(viewport());

    connect(toolTip, SIGNAL(queryToolTip(QPoint,QRect&,QString&)),
            this, SLOT(slotQueryToolTip(QPoint,QRect&,QString&)));

    // without this restoreLayout() can't change the column widths
    for (int i = 0; i < columns(); ++i)
        setColumnWidthMode(i, Manual);
    restoreLayout(&partConfig, QLatin1String("LogList view"));
}
开发者ID:sdoerner,项目名称:cervisia-conversion,代码行数:27,代码来源:loglist.cpp

示例14: setSqlAndParams

void toResultLong::query(const QString &sql, const toQueryParams &param)
{
    setSqlAndParams(sql, param);
    slotStop();
    Query = NULL;
    LastItem = NULL;
    RowNumber = 0;
    First = true;

    clear();

    setSorting( -1);

    if (NumberColumn)
    {
        addColumn(QString::fromLatin1("#"));
        setColumnAlignment(0, Qt::AlignRight);
    }

    if (Filter)
        Filter->startingQuery();

    try
    {
        Query = new toEventQuery(this
                                 , connection()
                                 , sql
                                 , param
                                 //, Statistics
                                 , toEventQuery::READ_ALL
                                );
        connect(Query, SIGNAL(dataAvailable(toEventQuery*)), this, SLOT(slotAddItem()));
        connect(Query, SIGNAL(done(toEventQuery*)), this, SLOT(slotQueryDone()));
        if (ReadAll)
        {
            MaxNumber = -1;
            //// Query->slotReadAll(); // indicate that all records should be fetched
        }
        else
            MaxNumber = toConfigurationNewSingle::Instance().option(ToConfiguration::Database::InitialFetchInt).toInt();
        Query->start();
    }
    catch (const toConnection::exception &str)
    {
        First = false;
        emit firstResult(toResult::sql(), str, true);
        emit done();
        //// if (Mode != toQuery::Long)
        Utils::toStatusMessage(str);
    }
    catch (const QString &str)
    {
        First = false;
        emit firstResult(toResult::sql(), str, true);
        emit done();
        //// if (Mode != toQuery::Long)
        Utils::toStatusMessage(str);
    }
    updateContents();
}
开发者ID:nguyentienlong,项目名称:tora,代码行数:60,代码来源:toresultlong.cpp

示例15: KListView

DBGProfileListView::DBGProfileListView(QWidget *parent, const char *name)
    : KListView(parent, name), m_view(ModuleView)
{
  setSorting(-1);
  setAllColumnsShowFocus(true);
  setRootIsDecorated(true);

  addColumn("Location");
  addColumn("Line");
  addColumn("Hits");
  addColumn("Avarage time (ms)");
  addColumn("Total time (ms)");
  addColumn("Min time (ms)");
  addColumn("Max time (ms)");
  //   addColumn("Chart");

  setColumnAlignment(LineCol, Qt::AlignHCenter);
  setColumnAlignment(HitsCol, Qt::AlignHCenter);
  setColumnAlignment(AvgCol, Qt::AlignHCenter);
  setColumnAlignment(TotalCol, Qt::AlignHCenter);
  setColumnAlignment(MinCol, Qt::AlignHCenter);
  setColumnAlignment(MaxCol, Qt::AlignHCenter);

  connect(this, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int )),
          this, SLOT(slotDoubleClick(QListViewItem *, const QPoint &, int )));
  
}
开发者ID:thiago-silva,项目名称:protoeditor,代码行数:27,代码来源:dbgprofilelistview.cpp


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