[yast-commit] r42533 - in /branches/tmp/coolo/qt4-port/src: ./ pkg/
Author: dmacvicar Date: Fri Nov 30 12:03:13 2007 New Revision: 42533 URL: http://svn.opensuse.org/viewcvs/yast?rev=42533&view=rev Log: - ported listview and friends. Still does not build Modified: branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h branches/tmp/coolo/qt4-port/src/QY2ListView.cc branches/tmp/coolo/qt4-port/src/QY2ListView.h branches/tmp/coolo/qt4-port/src/YQTable.cc branches/tmp/coolo/qt4-port/src/YQTable.h branches/tmp/coolo/qt4-port/src/YQWizard.cc branches/tmp/coolo/qt4-port/src/YQWizard.h branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.h branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.h branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.h branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h Modified: branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc Fri Nov 30 12:03:13 2007 @@ -28,9 +28,10 @@ QY2CharValidator::QY2CharValidator( const QString & initialValidChars, QObject * parent, const char * name ) - : QValidator( parent, name ) + : QValidator( parent ) , _validChars( initialValidChars ) { + setObjectName(name); } Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc Fri Nov 30 12:03:13 2007 @@ -82,7 +82,7 @@ QY2ComboTabWidget::addPage( const QString & page_label, QWidget * new_page ) { pages.insert( combo_box->count(), new_page ); - combo_box->insertItem( page_label ); + combo_box->addItem( page_label ); widget_stack->addWidget( new_page ); if ( ! widget_stack->visibleWidget() ) @@ -114,7 +114,7 @@ { widget_stack->raiseWidget( page ); - if ( page == pages[ combo_box->currentItem() ] ) + if ( page == pages[ combo_box->currentIndex() ] ) { // Shortcut: If the requested page is the one that belongs to the item // currently selected in the combo box, don't bother searching the @@ -131,7 +131,7 @@ { if ( page == it.current() ) { - combo_box->setCurrentItem( it.currentKey() ); + combo_box->setCurrentIndex( it.currentKey() ); return; } Modified: branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc Fri Nov 30 12:03:13 2007 @@ -21,7 +21,6 @@ /-*/ - #include "QY2DiskUsageList.h" #include "YQi18n.h" #include "qpainter.h" @@ -38,31 +37,34 @@ _totalSizeCol = -42; _deviceNameCol = -42; + QStringList columnLabels; if ( addStdColumns ) { - int numCol = 0; - addColumn( _( "Name" ) ); _nameCol = numCol++; - - // Translators: Please keep this short! - addColumn( _( "Disk Usage" ) ); _percentageBarCol = numCol++; - addColumn( "" ); _percentageCol = numCol++; - addColumn( _( "Used" ) ); _usedSizeCol = numCol++; - addColumn( _( "Free" ) ); _freeSizeCol = numCol++; - addColumn( _( "Total" ) ); _totalSizeCol = numCol++; + int numCol = 0; + columnLabels << _( "Name" ); _nameCol = numCol++; + // Translators: Please keep this short! + columnLabels << _("Disk Usage"); _percentageBarCol = numCol++; + columnLabels << ""; _percentageCol = numCol++; + columnLabels << _("Used"); _usedSizeCol = numCol++; + columnLabels << _( "Free"); _freeSizeCol = numCol++; + columnLabels << _("Total"); _totalSizeCol = numCol++; #if 0 - addColumn( _( "Device" ) ); _deviceNameCol = numCol++; + addColumn( _( "Device" ) ); _deviceNameCol = numCol++; #endif - - setColumnAlignment( percentageCol(), Qt::AlignRight ); - setColumnAlignment( usedSizeCol(), Qt::AlignRight ); - setColumnAlignment( freeSizeCol(), Qt::AlignRight ); - setColumnAlignment( totalSizeCol(), Qt::AlignRight ); - - setSorting( percentageBarCol() ); + // needed? + setColumnCount(numCol); + setHeaderLabels(columnLabels); + + //FIXME +// setTextAlignment( percentageCol(), Qt::AlignRight ); +// setTextAlignment( usedSizeCol(), Qt::AlignRight ); +// setTextAlignment( freeSizeCol(), Qt::AlignRight ); +// setTextAlignment( totalSizeCol(), Qt::AlignRight ); + sortItems( percentageBarCol(), Qt::AscendingOrder ); } saveColumnWidths(); - setSelectionMode( Q3ListView::NoSelection ); + setSelectionMode(QAbstractItemView::NoSelection); } @@ -167,7 +169,7 @@ * +1 if this > other **/ int -QY2DiskUsageListItem::compare( Q3ListViewItem * otherListViewItem, +QY2DiskUsageListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { @@ -207,7 +209,7 @@ return QY2ListViewItem::compare( otherListViewItem, col, ascending ); } - +/* void QY2DiskUsageListItem::paintCell( QPainter * painter, const QColorGroup & colorGroup, @@ -244,7 +246,7 @@ Q3ListViewItem::paintCell( painter, cg, column, width, alignment ); } } - +*/ /** * Stolen from KDirStat::KDirTreeView with the author's permission. @@ -257,80 +259,80 @@ const QColor & fillColor, const QColor & barBackground ) { - if ( percent > 100.0 ) percent = 100.0; - if ( percent < 0.0 ) percent = 0.0; - int penWidth = 2; - int extraMargin = 3; - int x = _diskUsageList->itemMargin(); - int y = extraMargin; - int w = width - 2 * _diskUsageList->itemMargin(); - int h = height() - 2 * extraMargin; - int fillWidth; - - painter->eraseRect( 0, 0, width, height() ); - w -= indent; - x += indent; - - if ( w > 0 ) - { - QPen pen( painter->pen() ); - pen.setWidth(0); - painter->setPen( pen ); - painter->setBrush( Qt::NoBrush ); - fillWidth = (int) ( ( w - 2 * penWidth ) * percent / 100.0 ); - - - // Fill bar background. - - painter->fillRect( x + penWidth, y + penWidth, - w - 2 * penWidth + 1, h - 2 * penWidth + 1, - barBackground ); - /* - * Notice: The Xlib XDrawRectangle() function always fills one - * pixel less than specified. Altough this is very likely just a - * plain old bug, it is documented that way. Obviously, Qt just - * maps the fillRect() call directly to XDrawRectangle() so they - * inherited that bug ( although the Qt doc stays silent about - * it ). So it is really necessary to compensate for that missing - * pixel in each dimension. - * - * If you don't believe it, see for yourself. - * Hint: Try the xmag program to zoom into the drawn pixels. - **/ - - // Fill the desired percentage. - - painter->fillRect( x + penWidth, y + penWidth, - fillWidth+1, h - 2 * penWidth+1, - fillColor ); - - - // Draw 3D shadows. - - pen.setColor( contrastingColor ( Qt::black, - painter->backgroundColor() ) ); - painter->setPen( pen ); - painter->drawLine( x, y, x+w, y ); - painter->drawLine( x, y, x, y+h ); - - pen.setColor( contrastingColor( barBackground.dark(), - painter->backgroundColor() ) ); - painter->setPen( pen ); - painter->drawLine( x+1, y+1, x+w-1, y+1 ); - painter->drawLine( x+1, y+1, x+1, y+h-1 ); - - pen.setColor( contrastingColor( barBackground.light(), - painter->backgroundColor() ) ); - painter->setPen( pen ); - painter->drawLine( x+1, y+h, x+w, y+h ); - painter->drawLine( x+w, y, x+w, y+h ); - - pen.setColor( contrastingColor( Qt::white, - painter->backgroundColor() ) ); - painter->setPen( pen ); - painter->drawLine( x+2, y+h-1, x+w-1, y+h-1 ); - painter->drawLine( x+w-1, y+1, x+w-1, y+h-1 ); - } +// if ( percent > 100.0 ) percent = 100.0; +// if ( percent < 0.0 ) percent = 0.0; +// int penWidth = 2; +// int extraMargin = 3; +// int x = 0; /*FIXME _diskUsageList->itemMargin(); */ +// int y = extraMargin; +// int w = width - 2; /*FIXME * _diskUsageList->horizontalOffset(); */ +// int h = height() - 2; /*FIXME * extraMargin; */ +// int fillWidth; +// +// painter->eraseRect( 0, 0, width, height() ); +// w -= indent; +// x += indent; +// +// if ( w > 0 ) +// { +// QPen pen( painter->pen() ); +// pen.setWidth(0); +// painter->setPen( pen ); +// painter->setBrush( Qt::NoBrush ); +// fillWidth = (int) ( ( w - 2 * penWidth ) * percent / 100.0 ); +// +// +// // Fill bar background. +// +// painter->fillRect( x + penWidth, y + penWidth, +// w - 2 * penWidth + 1, h - 2 * penWidth + 1, +// barBackground ); +// /* +// * Notice: The Xlib XDrawRectangle() function always fills one +// * pixel less than specified. Altough this is very likely just a +// * plain old bug, it is documented that way. Obviously, Qt just +// * maps the fillRect() call directly to XDrawRectangle() so they +// * inherited that bug ( although the Qt doc stays silent about +// * it ). So it is really necessary to compensate for that missing +// * pixel in each dimension. +// * +// * If you don't believe it, see for yourself. +// * Hint: Try the xmag program to zoom into the drawn pixels. +// **/ +// +// // Fill the desired percentage. +// +// painter->fillRect( x + penWidth, y + penWidth, +// fillWidth+1, h - 2 * penWidth+1, +// fillColor ); +// +// +// // Draw 3D shadows. +// +// pen.setColor( contrastingColor ( Qt::black, +// painter->backgroundColor() ) ); +// painter->setPen( pen ); +// painter->drawLine( x, y, x+w, y ); +// painter->drawLine( x, y, x, y+h ); +// +// pen.setColor( contrastingColor( barBackground.dark(), +// painter->backgroundColor() ) ); +// painter->setPen( pen ); +// painter->drawLine( x+1, y+1, x+w-1, y+1 ); +// painter->drawLine( x+1, y+1, x+1, y+h-1 ); +// +// pen.setColor( contrastingColor( barBackground.light(), +// painter->backgroundColor() ) ); +// painter->setPen( pen ); +// painter->drawLine( x+1, y+h, x+w, y+h ); +// painter->drawLine( x+w, y, x+w, y+h ); +// +// pen.setColor( contrastingColor( Qt::white, +// painter->backgroundColor() ) ); +// painter->setPen( pen ); +// painter->drawLine( x+2, y+h-1, x+w-1, y+h-1 ); +// painter->drawLine( x+w-1, y+1, x+w-1, y+h-1 ); +// } } @@ -370,13 +372,12 @@ int minS, maxS; int minV, maxV; - minColor.hsv( &minH, &minS, &minV ); - maxColor.hsv( &maxH, &maxS, &maxV ); + minColor.getHsv( &minH, &minS, &minV ); + maxColor.getHsv( &maxH, &maxS, &maxV ); - return QColor( interpolate( val, minVal, maxVal, minH, maxH ), + return QColor::fromHsv( interpolate( val, minVal, maxVal, minH, maxH ), interpolate( val, minVal, maxVal, minS, maxS ), - interpolate( val, minVal, maxVal, minV, maxV ), - QColor::Hsv ); + interpolate( val, minVal, maxVal, minV, maxV ) ); } Modified: branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h (original) +++ branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h Fri Nov 30 12:03:13 2007 @@ -177,7 +177,7 @@ * confused which one to use. **/ void setText( int column, const QString & text ) - { Q3ListViewItem::setText( column, text ); } + { QTreeWidgetItem::setText( column, text ); } /** * Set a column text via FSize. @@ -193,7 +193,7 @@ * * Reimplemented from QY2ListViewItem. **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; @@ -221,12 +221,12 @@ * * Reimplemented from QY2ListViewItem. **/ - virtual void paintCell( QPainter * painter, + /*virtual void paintCell( QPainter * painter, const QColorGroup & colorGroup, int column, int width, int alignment ); - + */ /** * Paint a percentage bar into a @ref QListViewItem cell. * 'width' is the width of the entire cell. Modified: branches/tmp/coolo/qt4-port/src/QY2ListView.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2ListView.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ListView.cc (original) +++ branches/tmp/coolo/qt4-port/src/QY2ListView.cc Fri Nov 30 12:03:13 2007 @@ -26,7 +26,7 @@ QY2ListView::QY2ListView( QWidget * parent ) - : Q3ListView( parent ) + : QTreeWidget( parent ) , _mousePressedItem(0) , _mousePressedCol( -1 ) , _mousePressedButton( Qt::NoButton ) @@ -35,16 +35,16 @@ , _mouseButton1PressedInHeader( false ) , _finalSizeChangeExpected( false ) { - Q3ListView::setShowToolTips( false ); + //FIXME QTreeWidget::setShowToolTips( false ); #if FIXME_TOOLTIP _toolTip = new QY2ListViewToolTip( this ); #endif - if ( header() ) - header()->installEventFilter( this ); +// if ( header() ) +// header()->installEventFilter( this ); - connect( header(), SIGNAL( sizeChange ( int, int, int ) ), + connect( this, SIGNAL( columnResized ( int, int, int ) ), this, SLOT ( columnWidthChanged( int, int, int ) ) ); } @@ -61,15 +61,15 @@ void QY2ListView::selectSomething() { - Q3ListViewItemIterator it( this ); + QTreeWidgetItemIterator it( this ); while ( *it ) { QY2ListViewItem * item = dynamic_cast<QY2ListViewItem *> (*it); - if ( item && item->isSelectable() ) + if ( item /*FIXME&& item->isSelectable() */ ) { - setSelected( item, true ); // emits signal, too + item->setSelected(true); // emits signal, too return; } @@ -81,7 +81,7 @@ void QY2ListView::clear() { - Q3ListView::clear(); + QTreeWidget::clear(); restoreColumnWidths(); } @@ -89,7 +89,7 @@ void QY2ListView::updateItemStates() { - Q3ListViewItemIterator it( this ); + QTreeWidgetItemIterator it( this ); while ( *it ) { @@ -106,7 +106,7 @@ void QY2ListView::updateItemData() { - Q3ListViewItemIterator it( this ); + QTreeWidgetItemIterator it( this ); while ( *it ) { @@ -121,7 +121,7 @@ QString -QY2ListView::toolTip( Q3ListViewItem * listViewItem, int column ) +QY2ListView::toolTip( QTreeWidgetItem * listViewItem, int column ) { if ( ! listViewItem ) return QString::null; @@ -152,9 +152,9 @@ QY2ListView::saveColumnWidths() { _savedColumnWidth.clear(); - _savedColumnWidth.reserve( columns() ); + _savedColumnWidth.reserve( columnCount() ); - for ( int i = 0; i < columns(); i++ ) + for ( int i = 0; i < columnCount(); i++ ) { _savedColumnWidth.push_back( columnWidth(i) ); } @@ -164,14 +164,14 @@ void QY2ListView::restoreColumnWidths() { - if ( _savedColumnWidth.size() != (unsigned) columns() ) // never manually resized + if ( _savedColumnWidth.size() != (unsigned) columnCount() ) // never manually resized { - for ( int i = 0; i < columns(); i++ ) // use optimized column width - adjustColumn( i ); + for ( int i = 0; i < columnCount(); i++ ) // use optimized column width + resizeColumnToContents(i); } else // stored settings after manual resizing { - for ( int i = 0; i < columns(); i++ ) + for ( int i = 0; i < columnCount(); i++ ) { setColumnWidth( i, _savedColumnWidth[ i ] ); // restore saved column width } @@ -182,12 +182,13 @@ void QY2ListView::contentsMousePressEvent( QMouseEvent * ev ) { - Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) ); + //FIXME may be convert to global + QTreeWidgetItem * item = itemAt( mapToGlobal( ev->pos() ) ); - if ( item && item->isEnabled() ) + if ( item && ( item->flags() & Qt::ItemIsEnabled ) ) { _mousePressedItem = item; - _mousePressedCol = header()->sectionAt( ev->pos().x() ); +//FIXME _mousePressedCol = header()->sectionAt( ev->pos().x() ); _mousePressedButton = ev->button(); } else // invalidate last click data @@ -198,25 +199,26 @@ } // Call base class method - Q3ListView::contentsMousePressEvent( ev ); + //FIXME QTreeWidget::contentsMousePressEvent( ev ); } void QY2ListView::contentsMouseReleaseEvent( QMouseEvent * ev ) { - Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) ); + QTreeWidgetItem * item = itemAt( mapToGlobal( ev->pos() ) ); - if ( item && item->isEnabled() && item == _mousePressedItem ) + if ( item && ( item->flags() & Qt::ItemIsEnabled ) && item == _mousePressedItem ) { - int col = header()->sectionAt( ev->pos().x() ); - - if ( item == _mousePressedItem && - col == _mousePressedCol && - ev->button() == _mousePressedButton ) - { - emit( columnClicked( ev->button(), item, col, ev->globalPos() ) ); - } +// FIXME +// int col = header()->sectionAt( ev->pos().x() ); +// +// if ( item == _mousePressedItem && +// col == _mousePressedCol && +// ev->button() == _mousePressedButton ) +// { +// emit( columnClicked( ev->button(), item, col, ev->globalPos() ) ); +// } } @@ -227,29 +229,29 @@ _mousePressedButton = Qt::NoButton; // Call base class method - Q3ListView::contentsMouseReleaseEvent( ev ); + //FIXME QTreeWidget::contentsMouseReleaseEvent( ev ); } void QY2ListView::contentsMouseDoubleClickEvent( QMouseEvent * ev ) { - Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) ); - - if ( item && item->isEnabled() ) - { - int col = header()->sectionAt( ev->pos().x() ); - emit( columnDoubleClicked( ev->button(), (QY2ListViewItem *) item, col, ev->globalPos() ) ); - } - - // invalidate last click data - - _mousePressedItem = 0; - _mousePressedCol = -1; - _mousePressedButton = Qt::NoButton; + QTreeWidgetItem * item = itemAt( mapToGlobal( ev->pos() ) ); - // Call base class method - Q3ListView::contentsMouseDoubleClickEvent( ev ); +// if ( item && ( item->flags() & Qt::ItemIsEnabled ) ) +// { +// int col = header()->sectionAt( ev->pos().x() ); +// emit( columnDoubleClicked( ev->button(), (QY2ListViewItem *) item, col, ev->globalPos() ) ); +// } +// +// // invalidate last click data +// +// _mousePressedItem = 0; +// _mousePressedCol = -1; +// _mousePressedButton = Qt::NoButton; +// +// // Call base class method +// QTreeWidget::contentsMouseDoubleClickEvent( ev ); } @@ -281,31 +283,31 @@ bool QY2ListView::eventFilter( QObject * obj, QEvent * event ) { - if ( event && obj && obj == header() ) - { - if ( event->type() == QEvent::MouseButtonPress ) - { - QMouseEvent * mouseEvent = (QMouseEvent *) event; - - if ( mouseEvent->button() == 1 ) - { - _mouseButton1PressedInHeader = true; - _finalSizeChangeExpected = false; - } - } - else if ( event->type() == QEvent::MouseButtonRelease ) - { - QMouseEvent * mouseEvent = (QMouseEvent *) event; - - if ( mouseEvent->button() == 1 ) - { - _finalSizeChangeExpected = true; - _mouseButton1PressedInHeader = false; - } - } - } +// if ( event && obj && obj == header() ) +// { +// if ( event->type() == QEvent::MouseButtonPress ) +// { +// QMouseEvent * mouseEvent = (QMouseEvent *) event; +// +// if ( mouseEvent->button() == 1 ) +// { +// _mouseButton1PressedInHeader = true; +// _finalSizeChangeExpected = false; +// } +// } +// else if ( event->type() == QEvent::MouseButtonRelease ) +// { +// QMouseEvent * mouseEvent = (QMouseEvent *) event; +// +// if ( mouseEvent->button() == 1 ) +// { +// _finalSizeChangeExpected = true; +// _mouseButton1PressedInHeader = false; +// } +// } +// } - return Q3ListView::eventFilter( obj, event ); + return QTreeWidget::eventFilter( obj, event ); } @@ -320,7 +322,7 @@ QY2ListView::setSortByInsertionSequence( bool sortByInsertionSequence ) { _sortByInsertionSequence = sortByInsertionSequence; - sort(); + //FIXME sort(); } @@ -330,19 +332,19 @@ QY2ListViewItem::QY2ListViewItem( QY2ListView * parentListView, const QString & text ) - : Q3ListViewItem( parentListView, text ) + : QTreeWidgetItem( parentListView, QStringList(text), 1) { _serial = parentListView->nextSerial(); } -QY2ListViewItem::QY2ListViewItem( Q3ListViewItem * parentItem, +QY2ListViewItem::QY2ListViewItem( QTreeWidgetItem * parentItem, const QString & text ) - : Q3ListViewItem( parentItem, text ) + : QTreeWidgetItem( parentItem, QStringList(text), 1 ) { _serial = 0; - QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( listView() ); + QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( treeWidget() ); if ( parentListView ) _serial = parentListView->nextSerial(); @@ -363,12 +365,12 @@ * +1 if this > other **/ int -QY2ListViewItem::compare( Q3ListViewItem * otherListViewItem, +QY2ListViewItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { bool sortByInsertionSequence = false; - QY2ListView * parentListView = dynamic_cast<QY2ListView *> (listView()); + QY2ListView * parentListView = dynamic_cast<QY2ListView *> (treeWidget()); if ( parentListView ) sortByInsertionSequence = parentListView->sortByInsertionSequence(); @@ -397,24 +399,25 @@ } - return Q3ListViewItem::compare( otherListViewItem, col, ascending ); + //return QTreeWidgetItem::compare( otherListViewItem, col, ascending ); + return 0; } -void -QY2ListViewItem::paintCell( QPainter * painter, - const QColorGroup & colorGroup, - int column, - int width, - int alignment ) -{ - QColorGroup cg = colorGroup; - - if ( _textColor.isValid() ) cg.setColor( QColorGroup::Text, _textColor ); - if ( _backgroundColor.isValid() ) cg.setColor( QColorGroup::Base, _backgroundColor ); - - Q3ListViewItem::paintCell( painter, cg, column, width, alignment ); -} +// void +// QY2ListViewItem::paintCell( QPainter * painter, +// const QColorGroup & colorGroup, +// int column, +// int width, +// int alignment ) +// { +// QColorGroup cg = colorGroup; +// +// if ( _textColor.isValid() ) cg.setColor( QColorGroup::Text, _textColor ); +// if ( _backgroundColor.isValid() ) cg.setColor( QColorGroup::Base, _backgroundColor ); +// +// QTreeWidgetItem::paintCell( painter, cg, column, width, alignment ); +// } @@ -422,40 +425,24 @@ QY2CheckListItem::QY2CheckListItem( QY2ListView * parentListView, - const QString & text, - Q3CheckListItem::Type type ) - : Q3CheckListItem( parentListView, text, type ) + const QString & text ) + : QTreeWidgetItem( parentListView, QStringList(text), 1 ) { _serial = parentListView->nextSerial(); } -QY2CheckListItem::QY2CheckListItem( Q3ListViewItem * parentItem, - const QString & text, - Q3CheckListItem::Type type ) - : Q3CheckListItem( parentItem, text, type ) -{ - _serial = 0; - QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( listView() ); - - if ( parentListView ) - _serial = parentListView->nextSerial(); -} - - -QY2CheckListItem::QY2CheckListItem( Q3CheckListItem * parentItem, - const QString & text, - Q3CheckListItem::Type type ) - : Q3CheckListItem( parentItem, text, type ) +QY2CheckListItem::QY2CheckListItem( QTreeWidgetItem * parentItem, + const QString & text ) + : QTreeWidgetItem( parentItem, QStringList(text), 1 ) { _serial = 0; - QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( listView() ); + QY2ListView * parentListView = dynamic_cast<QY2ListView *> ( treeWidget() ); if ( parentListView ) _serial = parentListView->nextSerial(); } - QY2CheckListItem::~QY2CheckListItem() { // NOP @@ -470,12 +457,12 @@ * +1 if this > other **/ int -QY2CheckListItem::compare( Q3ListViewItem * otherListViewItem, +QY2CheckListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { bool sortByInsertionSequence = false; - QY2ListView * parentListView = dynamic_cast<QY2ListView *> (listView()); + QY2ListView * parentListView = dynamic_cast<QY2ListView *> (treeWidget()); if ( parentListView ) sortByInsertionSequence = parentListView->sortByInsertionSequence(); @@ -505,10 +492,11 @@ } - return Q3ListViewItem::compare( otherListViewItem, col, ascending ); + //FIXME return QTreeWidgetItem::compare( otherListViewItem, col, ascending ); + return 0; } - +/* void QY2CheckListItem::paintCell( QPainter * painter, const QColorGroup & colorGroup, @@ -521,16 +509,16 @@ if ( _textColor.isValid() ) cg.setColor( QColorGroup::Text, _textColor ); if ( _backgroundColor.isValid() ) cg.setColor( QColorGroup::Base, _backgroundColor ); - Q3CheckListItem::paintCell( painter, cg, column, width, alignment ); + QTreeWidgetItem::paintCell( painter, cg, column, width, alignment ); } - +*/ #if FIXME_TOOLTIP void QY2ListViewToolTip::maybeTip( const QPoint & pos ) { Q3Header * header = _listView->header(); - Q3ListViewItem * item = _listView->itemAt( pos ); + QTreeWidgetItem * item = _listView->itemAt( pos ); if ( ! item ) return; Modified: branches/tmp/coolo/qt4-port/src/QY2ListView.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2ListView.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/QY2ListView.h (original) +++ branches/tmp/coolo/qt4-port/src/QY2ListView.h Fri Nov 30 12:03:13 2007 @@ -22,7 +22,7 @@ #ifndef QY2ListView_h #define QY2ListView_h -#include <q3listview.h> +#include <QTreeWidget> #include <qtooltip.h> #include <qpoint.h> #include <qcolor.h> @@ -38,7 +38,7 @@ /** * @short Enhanced Q3ListView **/ -class QY2ListView : public Q3ListView +class QY2ListView : public QTreeWidget { Q_OBJECT @@ -102,7 +102,7 @@ * Emitted for mouse clicks on an item **/ void columnClicked ( int button, - Q3ListViewItem * item, + QTreeWidgetItem * item, int col, const QPoint & pos ); @@ -110,7 +110,7 @@ * Emitted for mouse double clicks on an item **/ void columnDoubleClicked ( int button, - Q3ListViewItem * item, + QTreeWidgetItem * item, int col, const QPoint & pos ); @@ -127,7 +127,7 @@ * * Derived classes may handle this differently. **/ - virtual QString toolTip( Q3ListViewItem * item, int column ); + virtual QString toolTip( QTreeWidgetItem * item, int column ); /** * Returns 'true' if the sort order should always be the item insertion @@ -194,7 +194,7 @@ // Data members // - Q3ListViewItem * _mousePressedItem; + QTreeWidgetItem * _mousePressedItem; int _mousePressedCol; int _mousePressedButton; @@ -210,9 +210,9 @@ /** - * Enhanced Q3ListViewItem + * Enhanced QTreeWidgetItem **/ -class QY2ListViewItem: public Q3ListViewItem +class QY2ListViewItem: public QTreeWidgetItem { public: @@ -226,7 +226,7 @@ /** * Constructor for deeper level items. **/ - QY2ListViewItem( Q3ListViewItem * parentItem, + QY2ListViewItem( QTreeWidgetItem * parentItem, const QString & text = QString::null ); /** @@ -257,9 +257,9 @@ * 0 if this == other * +1 if this > other * - * Reimplemented from Q3ListViewItem + * Reimplemented from QTreeWidgetItem **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; @@ -295,17 +295,18 @@ protected: /** - * Paint method. Reimplemented from @ref Q3ListViewItem so different + * Paint method. Reimplemented from @ref QTreeWidgetItem so different * colors can be used. * - * Reimplemented from Q3ListViewItem. + * Reimplemented from QTreeWidgetItem. **/ + /* virtual void paintCell( QPainter * painter, const QColorGroup & colorGroup, int column, int width, int alignment ); - + */ // // Data members // @@ -321,7 +322,7 @@ /** * Enhanced QCheckListItem **/ -class QY2CheckListItem: public Q3CheckListItem +class QY2CheckListItem: public QTreeWidgetItem { public: @@ -329,24 +330,14 @@ * Constructor for toplevel items. **/ QY2CheckListItem( QY2ListView * parentListView, - const QString & text, - Q3CheckListItem::Type type ); + const QString & text ); /** * Constructor for deeper level items. **/ - QY2CheckListItem( Q3ListViewItem * parentItem, - const QString & text, - Q3CheckListItem::Type type ); - - - /** - * Constructor for deeper level items for QCheckListItem parents. - **/ - QY2CheckListItem( Q3CheckListItem * parentItem, - const QString & text, - Q3CheckListItem::Type type ); + QY2CheckListItem( QTreeWidgetItem * parentItem, + const QString & text ); /** * Destructor @@ -376,9 +367,9 @@ * 0 if this == other * +1 if this > other * - * Reimplemented from Q3ListViewItem + * Reimplemented from QTreeWidgetItem **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; @@ -414,17 +405,17 @@ protected: /** - * Paint method. Reimplemented from @ref Q3ListViewItem so different + * Paint method. Reimplemented from @ref QTreeWidgetItem so different * colors can be used. * - * Reimplemented from Q3ListViewItem. + * Reimplemented from QTreeWidgetItem. **/ - virtual void paintCell( QPainter * painter, + /*virtual void paintCell( QPainter * painter, const QColorGroup & colorGroup, int column, int width, int alignment ); - + */ // // Data members // Modified: branches/tmp/coolo/qt4-port/src/YQTable.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTable.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQTable.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQTable.cc Fri Nov 30 12:03:13 2007 @@ -54,7 +54,7 @@ for ( int i=0; i < columns(); i++ ) { - _qt_listView->addColumn( fromUTF8( header( i ) ) ); + //FIXME _qt_listView->addColumn( fromUTF8( header( i ) ) ); int qt_alignment = Qt::Left; @@ -67,7 +67,7 @@ case YAlignUnchanged: break; } - _qt_listView->setColumnAlignment( i, qt_alignment ); + //FIXME _qt_listView->setColumnAlignment( i, qt_alignment ); // _qt_listView->adjustColumn( column ); } @@ -76,14 +76,14 @@ // Connect signals and slots // - connect( _qt_listView, SIGNAL( doubleClicked ( Q3ListViewItem * ) ), - this, SLOT ( slotActivated ( Q3ListViewItem * ) ) ); + connect( _qt_listView, SIGNAL( doubleClicked ( QTreeWidgetItem * ) ), + this, SLOT ( slotActivated ( QTreeWidgetItem * ) ) ); - connect( _qt_listView, SIGNAL( spacePressed ( Q3ListViewItem * ) ), - this, SLOT ( slotActivated ( Q3ListViewItem * ) ) ); + connect( _qt_listView, SIGNAL( spacePressed ( QTreeWidgetItem * ) ), + this, SLOT ( slotActivated ( QTreeWidgetItem * ) ) ); - connect( _qt_listView, SIGNAL( selectionChanged ( Q3ListViewItem * ) ), - this, SLOT ( slotSelected ( Q3ListViewItem * ) ) ); + connect( _qt_listView, SIGNAL( selectionChanged ( QTreeWidgetItem * ) ), + this, SLOT ( slotSelected ( QTreeWidgetItem * ) ) ); } @@ -115,7 +115,7 @@ if ( item->selected() ) { YQSignalBlocker sigBlocker( _qt_listView ); - _qt_listView->setSelected( clone, true ); + clone->setSelected(true); } } @@ -131,13 +131,14 @@ YQTableListViewItem * clone = (YQTableListViewItem *) item->data(); YUI_CHECK_PTR( clone ); - if ( ! selected && clone == _qt_listView->selectedItem() ) + //FIXME selected first + if ( ! selected && clone == _qt_listView->currentItem() ) { deselectAllItems(); } else { - _qt_listView->setSelected( clone, true ); + clone->setSelected( true ); YTable::selectItem( item, selected ); } } @@ -175,7 +176,7 @@ void -YQTable::selectOrigItem( Q3ListViewItem * listViewItem ) +YQTable::selectOrigItem( QTreeWidgetItem * listViewItem ) { if ( listViewItem ) { @@ -188,7 +189,7 @@ void -YQTable::slotSelected( Q3ListViewItem * listViewItem ) +YQTable::slotSelected( QTreeWidgetItem * listViewItem ) { selectOrigItem( listViewItem ); @@ -205,7 +206,7 @@ void -YQTable::slotActivated( Q3ListViewItem * listViewItem ) +YQTable::slotActivated( QTreeWidgetItem * listViewItem ) { selectOrigItem( listViewItem ); @@ -218,7 +219,7 @@ YQTable::setEnabled( bool enabled ) { _qt_listView->setEnabled( enabled ); - _qt_listView->triggerUpdate(); + //FIXME _qt_listView->triggerUpdate(); YWidget::setEnabled( enabled ); } @@ -317,13 +318,13 @@ if ( icon.isNull() ) y2warning( "Can't load icon %s", iconName.c_str() ); else - setPixmap( column, icon ); + setData( column, Qt::DecorationRole, icon ); } else // No pixmap name { - if ( pixmap( column ) ) // Was there a pixmap before? + if ( ! data( column, Qt::DecorationRole ).isNull() ) // Was there a pixmap before? { - setPixmap( column, QPixmap() ); // Set empty pixmap + setData( column, Qt::DecorationRole, QPixmap() ); // Set empty pixmap } } } Modified: branches/tmp/coolo/qt4-port/src/YQTable.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTable.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQTable.h (original) +++ branches/tmp/coolo/qt4-port/src/YQTable.h Fri Nov 30 12:03:13 2007 @@ -26,7 +26,7 @@ class QY2ListView; -class Q3ListViewItem; +class QTreeWidgetItem; class YQListViewItem; class YQTable : public QFrame, public YTable @@ -133,12 +133,12 @@ /** * Notification that an item is selected (single click or keyboard). **/ - void slotSelected( Q3ListViewItem * ); + void slotSelected( QTreeWidgetItem * ); /** * Notification that an item is activated (double click or keyboard). **/ - void slotActivated( Q3ListViewItem * ); + void slotActivated( QTreeWidgetItem * ); protected: @@ -147,7 +147,7 @@ * Select the original item (the YTableItem) that corresponds to the * specified listViewItem. **/ - void selectOrigItem( Q3ListViewItem * listViewItem ); + void selectOrigItem( QTreeWidgetItem * listViewItem ); // // Data members Modified: branches/tmp/coolo/qt4-port/src/YQWizard.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWizard.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQWizard.cc (original) +++ branches/tmp/coolo/qt4-port/src/YQWizard.cc Fri Nov 30 12:03:13 2007 @@ -829,19 +829,21 @@ _tree = new QY2ListView( vbox ); YUI_CHECK_NEW( _tree ); - _tree->addColumn( "" ); - _tree->header()->hide(); + //FIXME +// _tree->addColumn( "" ); +// _tree->header()->hide(); + _tree->setRootIsDecorated( true ); _tree->setSortByInsertionSequence( true ); connect( _tree, SIGNAL( selectionChanged ( void ) ), this, SLOT ( treeSelectionChanged ( void ) ) ); - connect( _tree, SIGNAL( spacePressed ( Q3ListViewItem * ) ), - this, SLOT ( sendTreeEvent ( Q3ListViewItem * ) ) ); + connect( _tree, SIGNAL( spacePressed ( QTreeWidgetItem * ) ), + this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) ); - connect( _tree, SIGNAL( doubleClicked ( Q3ListViewItem * ) ), - this, SLOT ( sendTreeEvent ( Q3ListViewItem * ) ) ); + connect( _tree, SIGNAL( doubleClicked ( QTreeWidgetItem * ) ), + this, SLOT ( sendTreeEvent ( QTreeWidgetItem * ) ) ); // Bottom gradient @@ -937,14 +939,15 @@ { YQSignalBlocker sigBlocker( _tree ); - _tree->setSelected( item, true ); - _tree->ensureItemVisible( item ); + + item->setSelected(true); + //FIXME _tree->ensureItemVisible( item ); } } } -void YQWizard::sendTreeEvent( Q3ListViewItem * listViewItem ) +void YQWizard::sendTreeEvent( QTreeWidgetItem * listViewItem ) { if ( listViewItem ) { @@ -957,9 +960,9 @@ void YQWizard::treeSelectionChanged() -{ +{ //FIXME is currentItem correct or selected.first if ( _tree ) - sendTreeEvent( _tree->selectedItem() ); + sendTreeEvent( _tree->currentItem() ); } @@ -967,7 +970,7 @@ { if ( _tree ) { - Q3ListViewItem * sel = _tree->selectedItem(); + QTreeWidgetItem * sel = _tree->currentItem(); if ( sel ) { Modified: branches/tmp/coolo/qt4-port/src/YQWizard.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWizard.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/YQWizard.h (original) +++ branches/tmp/coolo/qt4-port/src/YQWizard.h Fri Nov 30 12:03:13 2007 @@ -48,7 +48,7 @@ class QToolButton; class Q3WidgetStack; class YReplacePoint; - +class QTreeWidgetItem; class YQAlignment; class YQReplacePoint; class QY2ListView; @@ -447,7 +447,7 @@ * tree item. * If the item has an ID, that ID will be returned to UI::UserInput(). **/ - void sendTreeEvent( Q3ListViewItem * item ); + void sendTreeEvent( QTreeWidgetItem * item ); /** * Internal notification that the tree selection has changed. @@ -715,8 +715,8 @@ , _id( id ) {} - virtual QString text(int index) const { return Q3ListViewItem::text(index); } - QString text() const { return Q3ListViewItem::text(0); } + virtual QString text(int index) const { return QTreeWidgetItem::text(index); } + QString text() const { return QTreeWidgetItem::text(0); } QString id() const { return _id; } private: Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc Fri Nov 30 12:03:13 2007 @@ -141,7 +141,7 @@ false, // no autoFill - need to connect to details view first false ); // no autoFilter - filterMatch() is not connected Q_CHECK_PTR( _patternList ); - _patternList->header()->hide(); + //FIXME _patternList->header()->hide(); } if ( ! _patternList ) @@ -161,7 +161,7 @@ false, // no autoFill - need to connect to details view first false ); // no autoFilter - filterMatch() is not connected Q_CHECK_PTR( _selList ); - _selList->header()->hide(); + //FIXME _selList->header()->hide(); } if ( _wizard ) // No button box - add "Details..." button here Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc Fri Nov 30 12:03:13 2007 @@ -192,7 +192,7 @@ bool YQPkgChangesDialog::isEmpty() const { - return _pkgList->firstChild() == 0; + return _pkgList->topLevelItemCount() == 0; } Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc Fri Nov 30 12:03:13 2007 @@ -60,7 +60,8 @@ YQPkgConflictList::YQPkgConflictList( QWidget * parent ) : QY2ListView( parent ) { - addColumn( _( "Dependency Conflict" ) ); + + setHeaderLabel( _( "Dependency Conflict" ) ); setRootIsDecorated( true ); setSortByInsertionSequence( true ); } @@ -96,9 +97,10 @@ { zypp::ProblemSolutionList userChoices; - Q3ListViewItem * child = firstChild(); + int count=0; + QTreeWidgetItem * child; - while ( child ) + while ( (child = topLevelItem(count)) ) { YQPkgConflict * conflict = dynamic_cast<YQPkgConflict *> (child); @@ -110,7 +112,7 @@ userChoices.push_back( userChoice ); } - child = child->nextSibling(); + count++; } zypp::getZYpp()->resolver()->applySolutions( userChoices ); @@ -166,13 +168,13 @@ // Recursively write all items + int count=0; + const QTreeWidgetItem * item; - const Q3ListViewItem * item = firstChild(); - - while ( item ) + while ( (item = topLevelItem(count)) ) { saveItemToFile( file, item ); - item = item->nextSibling(); + count++; } @@ -190,7 +192,7 @@ void YQPkgConflictList::saveItemToFile( FILE * file, - const Q3ListViewItem * item ) const + const QTreeWidgetItem * item ) const { if ( ! item || ! file ) return; @@ -227,7 +229,7 @@ { // Recursively write children - const Q3ListViewItem * child = item->firstChild(); + const QTreeWidgetItem * child = item->firstChild(); while ( child ) { @@ -239,7 +241,7 @@ void -YQPkgConflictList::dumpList( Q3ListViewItem * parent, +YQPkgConflictList::dumpList( QTreeWidgetItem * parent, const QString & longText, const QString & header, int splitThreshold ) @@ -321,8 +323,8 @@ QPixmap icon = YQIconPool::normalPkgConflict(); setTextColor( BRIGHT_RED ); - setText( 0, fromUTF8( problem()->description() ) ); - setPixmap( 0, icon ); + setText( 0, Qt::DisplayRole, fromUTF8( problem()->description() ) ); + setData( 0, Qt::DecorationRole, icon ); } @@ -332,8 +334,7 @@ _resolutionsHeader = new QY2CheckListItem( this, // Heading for the choices // how to resolve this conflict - _( "Conflict Resolution:" ), - Q3CheckListItem::Controller ); + _( "Conflict Resolution:" ) ); Q_CHECK_PTR( _resolutionsHeader ); _resolutionsHeader->setOpen( true ); _resolutionsHeader->setBackgroundColor( LIGHT_GREY ); @@ -364,9 +365,10 @@ zypp::ProblemSolution_Ptr YQPkgConflict::userSelectedResolution() { - Q3ListViewItem * item = _resolutionsHeader->firstChild(); + int count = 0; + QTreeWidgetItem * item; - while ( item ) + while ( item = _resolutionsHeader->topLevelItem(count) ) { YQPkgConflictResolution * res = dynamic_cast<YQPkgConflictResolution *> (item); @@ -380,7 +382,7 @@ return solution; } - item = item->nextSibling(); + count++; } return zypp::ProblemSolution_Ptr(); // Null pointer @@ -395,8 +397,8 @@ zypp::ProblemSolution_Ptr solution ) : QY2CheckListItem( parent, fromUTF8( solution->description() ), - Q3CheckListItem::RadioButton ) - , _solution( solution ) + /*Q3CheckListItem::RadioButton) */ + , _solution( solution )) { YQPkgConflictList::dumpList( this, fromUTF8( solution->details() ) ); } Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.h Fri Nov 30 12:03:13 2007 @@ -63,12 +63,12 @@ /** * Check if the conflict list is empty. **/ - bool isEmpty() const { return childCount() == 0; } + bool isEmpty() const { return topLevelItemCount() == 0; } /** * Returns the number of conflicts in the list. **/ - int count() const { return childCount(); } + int count() const { return topLevelItemCount(); } public slots: @@ -108,7 +108,7 @@ * "More...". * If 'header' is not empty, it will be added as the parent of the lines. **/ - static void dumpList( Q3ListViewItem * parent, + static void dumpList( QTreeWidgetItem * parent, const QString & longText, const QString & header = QString::null, int splitThreshold = 5 ); @@ -118,7 +118,7 @@ /** * (Recursively) save one item to file. **/ - void saveItemToFile( FILE * file, const Q3ListViewItem * item ) const; + void saveItemToFile( FILE * file, const QTreeWidgetItem * item ) const; signals: Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc Fri Nov 30 12:03:13 2007 @@ -131,7 +131,7 @@ void YQPkgList::pkgObjClicked( int button, - Q3ListViewItem * listViewItem, + QTreeWidgetItem * listViewItem, int col, const QPoint & pos ) { @@ -194,7 +194,7 @@ YQPkgList::setInstallCurrentSourceRpm( bool installSourceRpm, bool selectNextItem ) { - Q3ListViewItem * listViewItem = selectedItem(); + QTreeWidgetItem * listViewItem = selectedItem(); if ( ! listViewItem ) return; @@ -220,7 +220,7 @@ if ( ! _editable ) return; - Q3ListViewItem * listViewItem = firstChild(); + QTreeWidgetItem * listViewItem = firstChild(); while ( listViewItem ) { @@ -407,7 +407,7 @@ // Write all items // - const Q3ListViewItem * item = firstChild(); + const QTreeWidgetItem * item = firstChild(); while ( item ) { @@ -721,7 +721,7 @@ * +1 if this > other **/ int -YQPkgListItem::compare( Q3ListViewItem * otherListViewItem, +YQPkgListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { @@ -758,7 +758,7 @@ QColorGroup cg = colorGroup; cg.setColor( QColorGroup::Text, QColor( 0xA0, 0xA0, 0xA0 ) ); - Q3ListViewItem::paintCell( painter, cg, column, width, alignment ); + QTreeWidgetItem::paintCell( painter, cg, column, width, alignment ); } else { @@ -774,7 +774,7 @@ cg.setColor( QColorGroup::Text, QColor( 0xFF, 0, 0 ) ); // Foreground } - Q3ListViewItem::paintCell( painter, cg, column, width, alignment ); + QTreeWidgetItem::paintCell( painter, cg, column, width, alignment ); } else if ( candidateIsNewer() ) { @@ -788,11 +788,11 @@ cg.setColor( QColorGroup::Base, QColor( 0xF0, 0xF0, 0xF0 ) ); // Background } - Q3ListViewItem::paintCell( painter, cg, column, width, alignment ); + QTreeWidgetItem::paintCell( painter, cg, column, width, alignment ); } else { - Q3ListViewItem::paintCell( painter, colorGroup, column, width, alignment ); + QTreeWidgetItem::paintCell( painter, colorGroup, column, width, alignment ); } } } Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.h Fri Nov 30 12:03:13 2007 @@ -119,7 +119,7 @@ * Reimplemented from YQPkgObjList. **/ virtual void pkgObjClicked( int button, - Q3ListViewItem * item, + QTreeWidgetItem * item, int col, const QPoint & pos ); @@ -269,7 +269,7 @@ * * Reimplemented from QListViewItem **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc Fri Nov 30 12:03:13 2007 @@ -67,14 +67,14 @@ createActions(); - connect( this, SIGNAL( columnClicked ( int, Q3ListViewItem *, int, const QPoint & ) ), - this, SLOT ( pkgObjClicked ( int, Q3ListViewItem *, int, const QPoint & ) ) ); + connect( this, SIGNAL( columnClicked ( int, QTreeWidgetItem *, int, const QPoint & ) ), + this, SLOT ( pkgObjClicked ( int, QTreeWidgetItem *, int, const QPoint & ) ) ); - connect( this, SIGNAL( columnDoubleClicked ( int, Q3ListViewItem *, int, const QPoint & ) ), - this, SLOT ( pkgObjClicked ( int, Q3ListViewItem *, int, const QPoint & ) ) ); + connect( this, SIGNAL( columnDoubleClicked ( int, QTreeWidgetItem *, int, const QPoint & ) ), + this, SLOT ( pkgObjClicked ( int, QTreeWidgetItem *, int, const QPoint & ) ) ); - connect( this, SIGNAL( selectionChanged ( Q3ListViewItem * ) ), - this, SLOT ( selectionChangedInternal( Q3ListViewItem * ) ) ); + connect( this, SIGNAL( selectionChanged ( QTreeWidgetItem * ) ), + this, SLOT ( selectionChangedInternal( QTreeWidgetItem * ) ) ); } @@ -122,7 +122,7 @@ void YQPkgObjList::pkgObjClicked( int button, - Q3ListViewItem * listViewItem, + QTreeWidgetItem * listViewItem, int col, const QPoint & pos ) { @@ -158,7 +158,7 @@ void -YQPkgObjList::selectionChangedInternal( Q3ListViewItem * listViewItem ) +YQPkgObjList::selectionChangedInternal( QTreeWidgetItem * listViewItem ) { YQPkgObjListItem * item = dynamic_cast<YQPkgObjListItem *> (listViewItem); @@ -267,7 +267,7 @@ void YQPkgObjList::setCurrentStatus( ZyppStatus newStatus, bool doSelectNextItem ) { - Q3ListViewItem * listViewItem = selectedItem(); + QTreeWidgetItem * listViewItem = selectedItem(); if ( ! listViewItem ) return; @@ -306,7 +306,7 @@ return; YQUI::ui()->busyCursor(); - Q3ListViewItemIterator it( this ); + QTreeWidgetItemIterator it( this ); while ( *it ) { @@ -341,7 +341,7 @@ void YQPkgObjList::selectNextItem() { - Q3ListViewItem * item = selectedItem(); + QTreeWidgetItem * item = selectedItem(); if ( item && item->nextSibling() ) { @@ -580,7 +580,7 @@ } - Q3ListViewItem * selectedListViewItem = selectedItem(); + QTreeWidgetItem * selectedListViewItem = selectedItem(); if ( selectedListViewItem ) { @@ -708,11 +708,11 @@ YQPkgObjList::applyExcludeRules() { // y2debug( "Applying exclude rules" ); - Q3ListViewItemIterator listView_it( this ); + QTreeWidgetItemIterator listView_it( this ); while ( *listView_it ) { - Q3ListViewItem * current_item = *listView_it; + QTreeWidgetItem * current_item = *listView_it; // Advance iterator now so it remains valid even if there are changes // to the QListView, e.g., if the current item is excluded and thus @@ -726,7 +726,7 @@ while ( excluded_it != _excludedItems->end() ) { - Q3ListViewItem * current_item = (*excluded_it).first; + QTreeWidgetItem * current_item = (*excluded_it).first; // Advance iterator now so it remains valid even if there are changes // to the excluded items, e.g., if the current item is un-excluded and thus @@ -764,7 +764,7 @@ void -YQPkgObjList::applyExcludeRules( Q3ListViewItem * listViewItem ) +YQPkgObjList::applyExcludeRules( QTreeWidgetItem * listViewItem ) { YQPkgObjListItem * item = dynamic_cast<YQPkgObjListItem *>( listViewItem ); @@ -817,7 +817,7 @@ if ( exclude ) { - Q3ListViewItem * parentItem = item->parent(); + QTreeWidgetItem * parentItem = item->parent(); if ( parentItem ) parentItem->takeItem( item ); @@ -830,7 +830,7 @@ { if ( _excludedItems->contains( item ) ) { - Q3ListViewItem * oldParent = _excludedItems->oldParentItem( item ); + QTreeWidgetItem * oldParent = _excludedItems->oldParentItem( item ); _excludedItems->remove( item ); if ( oldParent ) @@ -946,7 +946,7 @@ void YQPkgObjListItem::setText( int column, const string text ) { - Q3ListViewItem::setText( column, fromUTF8( text.c_str() ) ); + QTreeWidgetItem::setText( column, fromUTF8( text.c_str() ) ); } @@ -1364,7 +1364,7 @@ * +1 if this > other **/ int -YQPkgObjListItem::compare( Q3ListViewItem * otherListViewItem, +YQPkgObjListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { @@ -1482,7 +1482,7 @@ bool -YQPkgObjList::ExcludeRule::match( Q3ListViewItem * item ) +YQPkgObjList::ExcludeRule::match( QTreeWidgetItem * item ) { if ( ! _enabled ) return false; @@ -1512,13 +1512,13 @@ } -void YQPkgObjList::ExcludedItems::add( Q3ListViewItem * item, Q3ListViewItem * oldParent ) +void YQPkgObjList::ExcludedItems::add( QTreeWidgetItem * item, QTreeWidgetItem * oldParent ) { _excludeMap.insert( ItemPair( item, oldParent ) ); } -void YQPkgObjList::ExcludedItems::remove( Q3ListViewItem * item ) +void YQPkgObjList::ExcludedItems::remove( QTreeWidgetItem * item ) { ItemMap::iterator it = _excludeMap.find( item ); @@ -1542,13 +1542,13 @@ } -bool YQPkgObjList::ExcludedItems::contains( Q3ListViewItem * item ) +bool YQPkgObjList::ExcludedItems::contains( QTreeWidgetItem * item ) { return ( _excludeMap.find( item ) != _excludeMap.end() ); } -Q3ListViewItem * YQPkgObjList::ExcludedItems::oldParentItem( Q3ListViewItem * item ) +QTreeWidgetItem * YQPkgObjList::ExcludedItems::oldParentItem( QTreeWidgetItem * item ) { ItemMap::iterator it = _excludeMap.find( item ); Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.h Fri Nov 30 12:03:13 2007 @@ -139,7 +139,7 @@ /** * Apply all exclude rules of this list to one item. **/ - void applyExcludeRules( Q3ListViewItem * ); + void applyExcludeRules( QTreeWidgetItem * ); /** * Exclude or include an item, i.e. remove it from the visible items @@ -177,7 +177,7 @@ * Dispatcher slot for mouse click: cycle status depending on column. **/ virtual void pkgObjClicked( int button, - Q3ListViewItem * item, + QTreeWidgetItem * item, int col, const QPoint & pos ); @@ -247,7 +247,7 @@ /** * Dispatcher slot for selection change - internal only. **/ - virtual void selectionChangedInternal( Q3ListViewItem * item ); + virtual void selectionChangedInternal( QTreeWidgetItem * item ); signals: @@ -524,7 +524,7 @@ * * Reimplemented from QListViewItem **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; @@ -625,7 +625,7 @@ * confused which one to use. **/ void setText( int column, const QString & text ) - { Q3ListViewItem::setText( column, text ); } + { QTreeWidgetItem::setText( column, text ); } /** * Set a column text via Edition. @@ -716,7 +716,7 @@ * Returns 'true' if the item matches this exclude rule, * i.e. if it should be excluded. **/ - bool match( Q3ListViewItem * item ); + bool match( QTreeWidgetItem * item ); private: @@ -731,8 +731,8 @@ { public: - typedef std::map <Q3ListViewItem *, Q3ListViewItem *> ItemMap; - typedef std::pair<Q3ListViewItem *, Q3ListViewItem *> ItemPair; + typedef std::map <QTreeWidgetItem *, QTreeWidgetItem *> ItemMap; + typedef std::pair<QTreeWidgetItem *, QTreeWidgetItem *> ItemPair; typedef ItemMap::iterator iterator; /** @@ -752,13 +752,13 @@ * oldParent is the previous parent item of this item * or 0 if it was a root item. **/ - void add( Q3ListViewItem * item, Q3ListViewItem * oldParent ); + void add( QTreeWidgetItem * item, QTreeWidgetItem * oldParent ); /** * Remove a list item from the excluded items and transfer ownership back * to the caller. **/ - void remove( Q3ListViewItem * item ); + void remove( QTreeWidgetItem * item ); /** * Clear the excluded items. Delete all items still excluded. @@ -768,13 +768,13 @@ /** * Returns 'true' if the specified item is in the excluded items. **/ - bool contains( Q3ListViewItem * item ); + bool contains( QTreeWidgetItem * item ); /** * Returns the old parent of this item so it can be reparented * or 0 if it was a root item. **/ - Q3ListViewItem * oldParentItem( Q3ListViewItem * item ); + QTreeWidgetItem * oldParentItem( QTreeWidgetItem * item ); /** * Returns the number of items Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc Fri Nov 30 12:03:13 2007 @@ -70,7 +70,7 @@ if ( autoFilter ) { - connect( this, SIGNAL( selectionChanged( Q3ListViewItem * ) ), + connect( this, SIGNAL( selectionChanged( QTreeWidgetItem * ) ), this, SLOT ( filter() ) ); } @@ -214,7 +214,7 @@ YQPkgPatternListItem * YQPkgPatternList::selection() const { - Q3ListViewItem * item = selectedItem(); + QTreeWidgetItem * item = selectedItem(); if ( ! item ) return 0; @@ -225,7 +225,7 @@ void YQPkgPatternList::pkgObjClicked( int button, - Q3ListViewItem * listViewItem, + QTreeWidgetItem * listViewItem, int col, const QPoint & pos ) { @@ -252,7 +252,7 @@ void YQPkgPatternList::selectSomething() { - Q3ListViewItemIterator it( this ); + QTreeWidgetItemIterator it( this ); while ( *it ) { @@ -332,7 +332,7 @@ * +1 if this > other **/ int -YQPkgPatternListItem::compare( Q3ListViewItem * otherListViewItem, +YQPkgPatternListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { @@ -346,7 +346,7 @@ if ( otherCategoryItem ) // Patterns without category should always be sorted return -1; // before any category - return Q3ListViewItem::compare( otherListViewItem, col, ascending ); + return QTreeWidgetItem::compare( otherListViewItem, col, ascending ); } @@ -403,7 +403,7 @@ void YQPkgPatternCategoryItem::setOpen( bool open ) { - Q3ListViewItem::setOpen( open ); + QTreeWidgetItem::setOpen( open ); setTreeIcon(); } @@ -428,7 +428,7 @@ * +1 if this > other **/ int -YQPkgPatternCategoryItem::compare( Q3ListViewItem * otherListViewItem, +YQPkgPatternCategoryItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { @@ -443,7 +443,7 @@ if ( otherPatternListitem ) // Patterns without category should always be sorted return 1; // before any category - return Q3ListViewItem::compare( otherListViewItem, col, ascending ); + return QTreeWidgetItem::compare( otherListViewItem, col, ascending ); } Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.h Fri Nov 30 12:03:13 2007 @@ -92,7 +92,7 @@ * Reimplemented from YQPkgObjList. **/ virtual void pkgObjClicked( int button, - Q3ListViewItem * item, + QTreeWidgetItem * item, int col, const QPoint & pos ); @@ -190,7 +190,7 @@ * Reimplemented from QListViewItem: * Sort by zypp::Pattern::order() only. **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; @@ -259,7 +259,7 @@ * Reimplemented from QListViewItem: * Sort by zypp::Pattern::order() only. **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc Fri Nov 30 12:03:13 2007 @@ -46,7 +46,7 @@ if ( autoFilter ) { - connect( this, SIGNAL( selectionChanged( Q3ListViewItem * ) ), + connect( this, SIGNAL( selectionChanged( QTreeWidgetItem * ) ), this, SLOT ( filter() ) ); } @@ -158,7 +158,7 @@ YQPkgSelListItem * YQPkgSelList::selection() const { - Q3ListViewItem * item = selectedItem(); + QTreeWidgetItem * item = selectedItem(); if ( ! item ) return 0; @@ -214,7 +214,7 @@ * +1 if this > other **/ int -YQPkgSelListItem::compare( Q3ListViewItem * otherListViewItem, +YQPkgSelListItem::compare( QTreeWidgetItem * otherListViewItem, int col, bool ascending ) const { Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h?rev=42533&r1=42532&r2=42533&view=diff ============================================================================== --- branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h (original) +++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h Fri Nov 30 12:03:13 2007 @@ -144,7 +144,7 @@ * Reimplemented from QListViewItem: * Sort by zypp::Selection::order() only. **/ - virtual int compare( Q3ListViewItem * other, + virtual int compare( QTreeWidgetItem * other, int col, bool ascending ) const; -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
dmacvicar@svn.opensuse.org