⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qvaluestack.3qt

📁 Qt/Embedded是一个多平台的C++图形用户界面应用程序框架
💻 3QT
字号:
.TH QValueStack 3qt "10 November 2000" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2000 Trolltech AS.  All rights reserved.  See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQValueStack \- Value based template class that provides a stack.SH SYNOPSIS.br.PP\fC#include <qvaluestack.h>\fR.PPInherits QValueList..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQValueStack\fR () ".br.ti -1c.BI "\fB~QValueStack\fR () ".br.ti -1c.BI "void \fBpush\fR ( const T & d ) ".br.ti -1c.BI "T \fBpop\fR () ".br.ti -1c.BI "T& \fBtop\fR () ".br.ti -1c.BI "const T& \fBtop\fR () const".br.in -1c.SH DESCRIPTIONThe QValueStack class is a value based template class that provides a stack..PPDefine a template instance QValueStack<X> to create a stack of values which all have the class X. Please notice that QValueStack does not store pointers to the members of the stack. It holds a copy of every member. That is the reason why this kind of classes are called "value based" while QStack, QList and QDict are "reference based"..PPA stack is a Last In, First Out (LIFO) structure. Items are added to the top of the stack with push() and retrieved from the top with pop(). Furthermore, top() provides access to the topmost item without removing it..PPExample:.PP.nf.br    #include <qvaluestack.h>.br    #include <stdio.h>.br.br    void main().br    {.br        QValueStack<int> stack;.br        stack.push( 1 );.br        stack.push( 2 );.br        stack.push( 3 );.br        while ( !stack.isEmpty() ).br                printf("pop item %d\\n", stack.pop() );.br  }.fi.PPProgram output:.PP.nf.br        pop item 3;.br        pop item 2;.br        pop item 1;.fi.PPTechnically, QValueStack is a specialized QValueList provided for convenience. All of QValueList's functionality applies also to QStack, for example the facility to iterate over all elements using QValueStack<T>::Iterator. See QValueListIterator for further details..PPSome classes can not be used within a QValueStack, for example everything derived from QObject and thus all classes that implement widgets. Only values can be used in a QValueStack. To qualify as a value, the class must provide.TPa copy constructor,.TPan assignment operator and.TPa default constructor, i.e. a constructor that does not take any arguments..PPNote that C++ defaults to field-by-field assignment operators and copy constructors if no explicit version is supplied. In many cases, this is sufficient..SH MEMBER FUNCTION DOCUMENTATION.SH "QValueStack::QValueStack ()"Constructs an empty stack..SH "QValueStack::~QValueStack ()"Destroys the stack. References to the values in the stack and all iterators of this stack become invalidated. Since QValueStack is highly tuned for performance you wont see warnings if you use invalid iterators, because it is impossible for an iterator to check wether it is valid or not..SH "T QValueStack::pop ()"Removes the top item from the stack and returns it..PPSee also top() and push()..SH "void QValueStack::push ( const T & d )"Adds an element to the top of the stack. Last in, first out..PPThis function is equivalent to append().PPSee also pop() and top()..SH "T& QValueStack::top ()"Returns a reference to the top item of the stack or the item referenced by end() if no such item exists. Please note that you may not change the value the end() Iterator is pointing to..PPThis function is equivalent to last()..PPSee also pop(), push() and QValueList::fromLast()..SH "const T& QValueStack::top () const"Returns a reference to the top item of the stack or the item referenced by end() if no such item exists..PPThis function is equivalent to last()..PPSee also  pop(), push() and QValueList::fromLast()..SH "SEE ALSO".BR http://doc.trolltech.com/qvaluestack.html.SH COPYRIGHTCopyright 1992-2000 Trolltech AS, http://www.trolltech.com/.  See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -