亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? qheader.cpp

?? qtopia-phone-2.2.0下公共的控件實(shí)現(xiàn)源代碼。
?? CPP
?? 第 1 頁 / 共 3 頁
字號(hào):
/****************************************************************************** $Id: qt/src/widgets/qheader.cpp   2.3.12   edited 2005-10-27 $**** Implementation of QHeader widget class (table header)**** Created : 961105**** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.**** This file is part of the widgets module of the Qt GUI Toolkit.**** This file may be distributed under the terms of the Q Public License** as defined by Trolltech AS of Norway and appearing in the file** LICENSE.QPL included in the packaging of this file.**** This file may be distributed and/or modified under the terms of the** GNU General Public License version 2 as published by the Free Software** Foundation and appearing in the file LICENSE.GPL included in the** packaging of this file.**** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition** licenses may use this file in accordance with the Qt Commercial License** Agreement provided with the Software.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.**** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for**   information about Qt Commercial License Agreements.** See http://www.trolltech.com/qpl/ for QPL licensing information.** See http://www.trolltech.com/gpl/ for GPL licensing information.**** Contact info@trolltech.com if any conditions of this licensing are** not clear to you.************************************************************************/#include "qheader.h"#ifndef QT_NO_HEADER#include "qpainter.h"#include "qdrawutil.h"#include "qbitmap.h"#include "qbitarray.h"#include "qvector.h"static const int GRIPMARGIN  = 4;		//half the size of the resize areastatic const int MARKSIZE = 32;static const int QH_MARGIN = 4;struct QHeaderData{    QHeaderData(int n)    {	count = n;	labels.setAutoDelete( TRUE );	iconsets.setAutoDelete( TRUE );	sizes.resize(n);	positions.resize(n);	heights.resize(n);	labels.resize(n);	if ( int( iconsets.size() ) < n )	    iconsets.resize( n );	i2s.resize(n);	s2i.resize(n);	clicks.resize(n);	resize.resize(n);	int p =0;	for ( int i = 0; i < n ; i ++ ) {	    sizes[i] = 88;	    // heights[i] = 10; set properly in QHeader::init()	    i2s[i] = i;	    s2i[i] = i;	    positions[i] = p;	    p += sizes[i];	}	clicks_default = TRUE;	resize_default = TRUE;	clicks.fill( clicks_default );	resize.fill( resize_default );	move = TRUE;	sortColumn = -1;	sortDirection = TRUE;	positionsDirty = TRUE;    }    QArray<QCOORD>	sizes;    QArray<QCOORD>	heights;    QArray<QCOORD>	positions; // sorted by index    QVector<QString>	labels;    QVector<QIconSet>	iconsets;    QArray<int>	        i2s;    QArray<int>	        s2i;    QBitArray           clicks;    QBitArray           resize;    uint move : 1;    uint clicks_default : 1; // default value for new clicks bits    uint resize_default : 1; // default value for new resize bits    bool sortDirection;    int sortColumn;    int count;    bool positionsDirty;    void calculatePositions(){	// positions is sorted by index, not by section	positionsDirty = FALSE;	int p = 0;	for ( int i = 0; i < count; i++ ) {	    positions[i] = p;	    p +=sizes[i2s[i]];	}    }    int sectionAt( int pos ) {	// positions is sorted by index, not by section	if ( !count )	    return -1;	int l = 0;	int r = count - 1;	int i = ( (l+r+1) / 2 );	while ( r - l ) {	    if ( positions[i] > pos )		r = i -1;	    else		l = i;	    i = ( (l+r+1) / 2 );	}	if ( positions[i] <= pos && pos <= positions[i] + sizes[ i2s[i] ] )	    return i2s[i];	return -1;    }};// BEING REVISED: eiriken/*!  \class QHeader qheader.h  \brief The QHeader class provides a table header.  \ingroup advanced  This class provides a table header as known from spreadsheet-like widgets.  QHeader can be used vertically or horizontally (see setOrientation()).  With addLabel() you can add sections, and with removeLabel() you can remove  them. If you enabled clicking for one or all sections (see setClickEnabled()),  the user can reorder the sections and click on them which may be used for  sorting (see also setSortIndicator()). This feature is turned on by default.  So, if the user reorders the sections by clicking and moving them with the mouse the index  of a section may change. This means, the section you inserted at the first  position might be displayed at a different index then. To get the index at which e.g  the first section is displayed, use mapToIndex() with 0 as argument for our example.  If you want e.g. to know which section is displayed at e.g. index 3 use  mapToSection() with 3 as argument.  So, you can always work with the section numbers as you inserted them  without caring about the index at which they are displayed at the moment. Also  the API of QHeader works with the section numbers.  <img src=qheader-m.png> <img src=qheader-w.png>  \sa QListView QTableView *//*!  Constructs a horizontal header.  The \e parent and \e name arguments are sent to the QWidget constructor.*/QHeader::QHeader( QWidget *parent, const char *name )    : QWidget( parent, name, WNorthWestGravity ){    orient = Horizontal;    init( 0 );}/*!  Constructs a horizontal header with \a n sections.  The \e parent and \e name arguments are sent to the QWidget constructor.*/QHeader::QHeader( int n,  QWidget *parent, const char *name )    : QWidget( parent, name, WNorthWestGravity ){    orient = Horizontal;    init( n );}/*!  Destructs the header. */QHeader::~QHeader(){    delete d;    d = 0;}/*! \reimp */void QHeader::showEvent( QShowEvent *e ){    d->calculatePositions();    QWidget::showEvent( e );}/*!  \fn void QHeader::sizeChange( int section, int oldSize, int newSize )  This signal is emitted when the user has changed the size of some  of a \a section of the header from \a oldSize to \a newSize. This signal is  typically connected to a slot that repaints the table.*//*!  \fn void QHeader::clicked( int section )  This signal is emitted when the user clicked onto the section  \a section.  \sa pressed(), released()*//*!  \fn void QHeader::pressed( int section )  This signal is emitted when the user presses section \a section down.  \sa released()*//*!  \fn void QHeader::released( int section )  This signal is emitted when section \a section is released.  \sa pressed()*//*!  \fn void QHeader::indexChange( int section, int fromIndex, int toIndex )  This signal is emitted if the user moved the section \a section, which  was displayed at the index \a fromIndex to the new index \a toIndex.*//*!  \fn void QHeader::moved( int fromIndex, int toIndex )  \obsolete  Use indexChange() instead!  This signal is emitted when the user has moved the section which  is displayed at the index \a fromIndex to the index \a toIndex.*//*!  \fn void QHeader::sectionClicked( int index )  \obsolete  Use clicked() instead!  This signal is emitted when a part of the header is clicked. \a  index is the index at which the section is displayed.  In a list view, this signal would typically be connected to a slot  which sorts the specified column (or row).*//*!  \obsolete  Use sectionSize() instead!  Returns the size in pixels of the section which is displayed at  the index \a i.*/int QHeader::cellSize( int i ) const{    return sectionSize( mapToSection(i) );}/*!  \obsolete  Use sectionPos() instead!  Returns the position in pixels of the section which is displayed at the  index \a i. The  position is measured from the start of the header.*/int QHeader::cellPos( int i ) const{    if ( i == count() && i > 0 )	return d->positions[i-1] + d->sizes[d->i2s[i-1]]; // compatibility    return sectionPos( mapToSection(i) );}/*!  Returns the number of sections in the header.*/int QHeader::count() const{    return d->count;}/*!  \fn Orientation QHeader::orientation() const  Returns \c Horizontal if the header is horizontal, \c Vertical if  the header is vertical.  *//*!  \fn void QHeader::setTracking( bool enable )  Sets tracking if \a enable is TRUE, otherwise turns off tracking.  If tracking is on, the sizeChange() signal is emitted continuously  while the mouse is moved, otherwise it is only emitted when the  mouse button is released.  \sa tracking()  *//*!  \fn bool QHeader::tracking() const  Returns TRUE if tracking is on, FALSE otherwise.  \sa setTracking()  *//*!  Initializes with \a n columns. */void QHeader::init( int n ){    state = Idle;    offs = 0;    cachedIdx = 0; // unused    cachedPos = 0; // unused    d = new QHeaderData(n);    for ( int i = 0; i < n ; i ++ ) {	d->heights[i] = fontMetrics().lineSpacing()+6;    }    handleIdx = 0;    setMouseTracking( TRUE );    trackingIsOn = FALSE;    setBackgroundMode( PaletteButton );    setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );}/*!  Sets the header orientation.  The \e orientation must be  QHeader::Vertical or QHeader::Horizontal.  When adding labels without the size parameter, setOrientation  should be called first, otherwise labels will be sized incorrectly.  \sa orientation()*/void QHeader::setOrientation( Orientation orientation ){    if (orient==orientation) return;    orient = orientation;    if ( orient == Horizontal )	setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ) );    else	setSizePolicy( QSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred ) );    update();    updateGeometry();}/*!  Paints a rectangle starting at \a p, with length \s.  */void QHeader::paintRect( int p, int s ){    QPainter paint( this );    paint.setPen( QPen( black, 1, DotLine ) );    if ( orient == Horizontal )	paint.drawRect( p, 3, s, height() - 5 );    else	paint.drawRect( 3, p, height() - 5, s );}/*!  Marks the division line at \a idx.  */void QHeader::markLine( int idx ){    QPainter paint( this );    paint.setPen( QPen( black, 1, DotLine ) );    int p = pPos( idx );    int x = p - MARKSIZE/2;    int y = 2;    int x2 = p + MARKSIZE/2;    int y2 = height() - 3;    if ( orient == Vertical ) {	int t = x; x = y; y = t;	t = x2; x2 = y2; y2 = t;    }    paint.drawLine( x, y, x2, y );    paint.drawLine( x, y+1, x2, y+1 );    paint.drawLine( x, y2, x2, y2 );    paint.drawLine( x, y2-1, x2, y2-1 );    paint.drawLine( x, y, x, y2 );    paint.drawLine( x+1, y, x+1, y2 );    paint.drawLine( x2, y, x2, y2 );    paint.drawLine( x2-1, y, x2-1, y2 );}/*!  Removes the mark at the division line at \a idx.  */void QHeader::unMarkLine( int idx ){    if ( idx < 0 )	return;    int p = pPos( idx );    int x = p - MARKSIZE/2;    int y = 2;    int x2 = p + MARKSIZE/2;    int y2 = height() - 3;    if ( orient == Vertical ) {	int t = x; x = y; y = t;	t = x2; x2 = y2; y2 = t;    }    repaint( x, y, x2-x+1, y2-y+1 );}/*!  \obsolete  Use sectionAt() instead!  Returns the index at which the section is displayed, which contains  \a pos in widget coordinates, or -1 if \a pos is outside the header  sections.*/int QHeader::cellAt( int pos ) const{    return mapToIndex( sectionAt(pos + offset()) );}/*!  Tries to find a line that is not a neighbor of  \c handleIdx. */int QHeader::findLine( int c ){    int lastpos = d->positions[d->count-1] + d->sizes[d->i2s[d->count-1]];    int i = 0;    if ( c > lastpos ) {	return d->count;    } else {	int section = sectionAt( c );	if ( section < 0 )	    return handleIdx;	i = d->s2i[section];    }    if ( i == handleIdx )	return i;    if ( i == handleIdx - 1 &&  pPos( handleIdx ) - c > MARKSIZE/2 )	return i;    if ( i == handleIdx + 1 && c - pPos( i ) > MARKSIZE/2 )	return i + 1;    if ( c - pPos( i ) > pSize( i ) / 2 )	return i + 1;    else	return i;}/*!  \obsolete  Use moveSection() instead!  Moves the section which is currently displayed at the index \a fromIndex  to the index \a toIdx.*/void QHeader::moveCell( int fromIdx, int toIdx ){    moveSection( mapToSection(fromIdx), toIdx );}/*!  \reimp*/void QHeader::mousePressEvent( QMouseEvent *e ){    if ( e->button() != LeftButton || state != Idle )	return;    handleIdx = 0;    int c = orient == Horizontal ? e->pos().x() : e->pos().y();    c += offset();    int section = sectionAt( c );

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美巨大另类极品videosbest| 亚洲午夜视频在线观看| 日本一区二区成人| 亚洲欧美乱综合| 视频一区免费在线观看| 国产一区二区三区四| 91在线视频播放地址| 777午夜精品视频在线播放| 久久日一线二线三线suv| 国产精品传媒视频| 天堂资源在线中文精品| 黑人巨大精品欧美黑白配亚洲| av欧美精品.com| 欧美日产在线观看| 国产日韩欧美激情| 亚洲大尺度视频在线观看| 国产自产v一区二区三区c| 色8久久人人97超碰香蕉987| 日韩欧美在线影院| 综合婷婷亚洲小说| 毛片不卡一区二区| 91久久久免费一区二区| 欧美zozo另类异族| 亚洲精品菠萝久久久久久久| 久久成人免费网| 色婷婷亚洲婷婷| 久久新电视剧免费观看| 亚洲一区二区三区国产| 国产乱淫av一区二区三区| 欧美无人高清视频在线观看| 日本一区二区三区高清不卡| 天堂蜜桃91精品| 91小视频在线| 国产欧美日韩不卡免费| 视频一区欧美日韩| 色综合久久中文字幕综合网| 2024国产精品| 蜜臀99久久精品久久久久久软件| 一本到不卡免费一区二区| 久久综合色婷婷| 天天操天天干天天综合网| 91视频观看视频| 国产欧美精品一区二区三区四区| 天天操天天干天天综合网| 91啦中文在线观看| 国产欧美日韩亚州综合 | 99久免费精品视频在线观看| 日韩欧美一级精品久久| 亚洲自拍偷拍欧美| 91天堂素人约啪| 国产日韩欧美精品一区| 久久99精品国产.久久久久| 欧美精品久久天天躁| 亚洲自拍都市欧美小说| 99久久精品国产观看| 欧美激情资源网| 国产乱一区二区| 亚洲精品在线一区二区| 免费高清视频精品| 欧美久久婷婷综合色| 一区二区欧美视频| av一区二区三区| 中文字幕乱码久久午夜不卡| 国产一区二区精品久久99| 日韩一区二区三区视频| 亚洲成人av在线电影| 欧美最猛黑人xxxxx猛交| 亚洲欧美日韩人成在线播放| 成人av在线影院| 亚洲国产精品精华液ab| 国产精品资源在线观看| 久久这里只有精品首页| 国产成人自拍网| 久久精品一区二区三区av| 国产精品一区二区久久不卡 | 国模套图日韩精品一区二区| 91麻豆精品国产91久久久使用方法| 午夜精品在线视频一区| 欧美日韩免费观看一区三区| 亚洲一卡二卡三卡四卡五卡| 欧美日韩在线播放三区| 肉丝袜脚交视频一区二区| 69堂精品视频| 日本vs亚洲vs韩国一区三区二区 | 日韩高清不卡一区二区三区| 欧美三片在线视频观看| 午夜激情久久久| 91精品国产综合久久国产大片| 蜜桃视频在线观看一区二区| 日韩精品一区二区在线| 国产露脸91国语对白| 国产精品色哟哟网站| 91农村精品一区二区在线| 一区二区三区中文字幕精品精品 | 午夜久久久久久久久| 日韩欧美一级二级三级久久久| 国产在线看一区| 国产精品素人视频| 91小视频在线| 午夜精品一区二区三区电影天堂| 欧美一区二区免费观在线| 久久99精品一区二区三区| 欧美国产1区2区| 91天堂素人约啪| 亚洲成人你懂的| 欧美精品一区二区三区蜜臀| 国产v综合v亚洲欧| 亚洲精品免费电影| 91精品国产麻豆| 国产福利精品导航| 亚洲蜜臀av乱码久久精品| 3d成人动漫网站| 国产91高潮流白浆在线麻豆| 亚洲激情欧美激情| 日韩手机在线导航| 成人理论电影网| 亚洲成人久久影院| 久久奇米777| 在线观看视频91| 国产一区二区三区蝌蚪| 一区二区激情小说| 精品日韩99亚洲| 91蝌蚪porny九色| 蜜臀国产一区二区三区在线播放| 国产喂奶挤奶一区二区三区| 欧美最新大片在线看| 国内精品写真在线观看| 亚洲免费观看高清完整版在线| 日韩一级片网址| 99久久99久久精品国产片果冻| 日韩精品免费专区| 国产精品入口麻豆九色| 欧美日韩三级在线| 成人黄色一级视频| 日本在线不卡视频| 国产精品三级av| 日韩欧美精品在线视频| 一本大道久久a久久综合婷婷| 久久精品72免费观看| 最新国产精品久久精品| 日韩欧美电影一二三| 在线看国产一区二区| 成人一二三区视频| 免费成人在线视频观看| 亚洲精品视频在线看| 久久一日本道色综合| 欧美日韩大陆一区二区| 成人禁用看黄a在线| 另类小说综合欧美亚洲| 亚洲精品视频一区| 国产日韩欧美精品综合| 日韩美女主播在线视频一区二区三区| 一本到不卡免费一区二区| 国产99久久久国产精品免费看| 美女脱光内衣内裤视频久久网站| 一区二区三区欧美激情| 欧美国产成人精品| 久久亚洲免费视频| 日韩精品专区在线| 欧美日韩国产综合一区二区三区 | 中文字幕一区二区三区视频| 欧美不卡一区二区三区四区| 欧美日韩三级在线| 91久久奴性调教| 91啦中文在线观看| 成a人片亚洲日本久久| 国产精品18久久久久久久久 | 日韩精品在线一区二区| 在线精品亚洲一区二区不卡| av综合在线播放| 成人永久aaa| 国产成人啪免费观看软件 | 久久久五月婷婷| 欧美一区二区美女| 91精品黄色片免费大全| 欧美在线三级电影| 欧美性感一类影片在线播放| 色婷婷av一区二区三区之一色屋| aaa欧美日韩| 成人精品视频网站| 丁香网亚洲国际| 成人美女在线视频| 99在线精品观看| 不卡视频在线观看| 成人国产精品视频| 成人精品免费看| 99久久免费精品| 91丨porny丨蝌蚪视频| 91视频在线看| 91免费精品国自产拍在线不卡| 97精品超碰一区二区三区| 91在线精品一区二区| 色女孩综合影院| 在线观看日韩精品| 欧美日韩一区高清| 欧美精品日韩一区| 精品美女被调教视频大全网站| xfplay精品久久| 国产精品美女一区二区| 亚洲黄色免费网站|