[yast-commit] r42542 - in /branches/tmp/coolo/qt4-port/src: YQMultiProgressMeter.cc YQMultiSelectionBox.cc YQMultiSelectionBox.h
Author: dmacvicar
Date: Fri Nov 30 12:03:26 2007
New Revision: 42542
URL: http://svn.opensuse.org/viewcvs/yast?rev=42542&view=rev
Log:
more porting
Modified:
branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc
branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc
branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h
Modified: branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc?rev=42542&r1=42541&r2=42542&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc Fri Nov 30 12:03:26 2007
@@ -88,8 +88,8 @@
QPainter painter( this );
- if ( ! event->erased() )
- painter.eraseRect( event->rect() );
+// if ( ! event->erased() )
+// painter.eraseRect( event->rect() );
int totalLength = horizontal() ? width() : height();
int thickness = horizontal() ? height() : width();
@@ -266,7 +266,7 @@
points.setPoint( p++, offset + length, border + thickness - indent );
points.setPoint( p++, offset + length, border + indent );
- painter.setBrush( palette().active().highlight() );
+ painter.setBrush( palette().highlight() );
painter.setPen( Qt::NoPen );
painter.drawConvexPolygon( points );
}
@@ -283,7 +283,7 @@
points.setPoint( p++, offset + fillStart, border + fillHeight );
points.setPoint( p++, offset + fillStart, border + thickness - fillHeight );
- painter.setBrush( palette().active().highlight() );
+ painter.setBrush( palette().highlight() );
painter.setPen( Qt::NoPen );
painter.drawConvexPolygon( points );
}
@@ -294,12 +294,12 @@
// Draw outline
//
- const QColor & dark = palette().active().dark();
- const QColor & light = palette().active().light();
+ const QBrush & dark = palette().dark();
+ const QBrush & light = palette().light();
// Draw arrow base (left)
- painter.setPen( dark );
+ painter.setBrush( dark );
painter.setPen( Qt::SolidLine );
painter.drawLine( offset, border,
offset, border + thickness );
@@ -312,7 +312,7 @@
// Draw arrow point (right)
- painter.setPen( light );
+ painter.setBrush( light );
painter.drawLine( offset + length - 1, border + indent,
offset + length - 1, border + thickness - indent );
@@ -331,9 +331,7 @@
offset -= spacing() / 2 + 1; // integer division rounds down!
- const QColor & color = palette().active().foreground();
- painter.setPen( color );
- painter.setPen( Qt::SolidLine );
+ const QBrush & color = palette().foreground();
painter.setBrush( color );
// painter.setBrush( NoBrush );
Modified: branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc?rev=42542&r1=42541&r2=42542&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc Fri Nov 30 12:03:26 2007
@@ -55,15 +55,15 @@
YUI_CHECK_NEW( _caption );
layout->addWidget( _caption );
- _qt_listView = new Q3ListView( this );
+ _qt_listView = new QTreeWidget( this );
YUI_CHECK_NEW( _qt_listView );
layout->addWidget( _qt_listView );
_qt_listView->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
- _qt_listView->addColumn( "" ); // QListView doesn't have one single column by default!
- _qt_listView->setSorting( 0, false );
- _qt_listView->header()->setStretchEnabled( true );
- _qt_listView->header()->hide();
+ _qt_listView->setHeaderLabels( QStringList("") ); // QListView doesn't have one single column by default!
+ _qt_listView->setSorting(0, false );
+// FIXME _qt_listView->header()->setStretchEnabled( true );
+// FIXME _qt_listView->header()->hide();
_caption->setBuddy( _qt_listView );
// Very small default size if specified
@@ -110,7 +110,7 @@
// Take care of the QListView's keyboard focus
if ( ! _qt_listView->selectedItem() )
- _qt_listView->setSelected( msbItem, true );
+ msbItem->setSelected( true );
}
@@ -130,7 +130,7 @@
YQSignalBlocker sigBlocker( _qt_listView );
YMultiSelectionBox::deselectAllItems();
- Q3ListViewItemIterator it( _qt_listView );
+ QTreeWidgetItemIterator it( _qt_listView );
while ( *it )
{
@@ -179,7 +179,7 @@
// For the purpose of this function, QListView::currentItem() is the
// minimum requirement.
- Q3ListViewItem * currentQItem = _qt_listView->currentItem();
+ QTreeWidgetItem * currentQItem = _qt_listView->currentItem();
if ( currentQItem )
{
@@ -213,7 +213,7 @@
YQMultiSelectionBoxItem * msbItem = findItem( yItem );
if ( msbItem )
- _qt_listView->setSelected( msbItem, true );
+ msbItem->setSelected( true );
// This does NOT change the item's check box!
// (see explanations in YQMultiSelectionBox::currentItem() avove)
@@ -226,14 +226,14 @@
{
_caption->setEnabled( enabled );
_qt_listView->setEnabled( enabled );
- _qt_listView->triggerUpdate();
+ //FIXME _qt_listView->triggerUpdate();
YWidget::setEnabled( enabled );
}
int YQMultiSelectionBox::preferredWidth()
{
- int hintWidth = _caption->isShown() ?
+ int hintWidth = !_caption->isHidden() ?
_caption->sizeHint().width() + frameWidth() : 0;
return max( 80, hintWidth );
@@ -242,7 +242,7 @@
int YQMultiSelectionBox::preferredHeight()
{
- int hintHeight = _caption->isShown() ? _caption->sizeHint().height() : 0;
+ int hintHeight = !_caption->isHidden() ? _caption->sizeHint().height() : 0;
int visibleLines = shrinkable() ? SHRINKABLE_VISIBLE_LINES : DEFAULT_VISIBLE_LINES;
hintHeight += visibleLines * _qt_listView->fontMetrics().lineSpacing();
hintHeight += _qt_listView->frameWidth() * 2;
@@ -301,7 +301,7 @@
YQMultiSelectionBox::findItem( YItem * wantedItem )
{
// FIXME: Don't search through all items, use the YItem::data() pointer instead
- Q3ListViewItemIterator it( _qt_listView );
+ QTreeWidgetItemIterator it( _qt_listView );
while ( *it )
{
@@ -325,9 +325,9 @@
YQMultiSelectionBoxItem::YQMultiSelectionBoxItem( YQMultiSelectionBox * parent,
- Q3ListView * listView,
+ QTreeWidget * listView,
YItem * yItem )
- : Q3CheckListItem( listView, fromUTF8( yItem->label() ), Q3CheckListItem::CheckBox )
+ : QTreeWidgetItem( listView, fromUTF8( yItem->label() ) )
, _yItem( yItem )
, _multiSelectionBox( parent )
{
@@ -342,7 +342,7 @@
{
_yItem->setSelected( newState );
_multiSelectionBox->sendValueChanged();
- Q3CheckListItem::stateChange( newState );
+ //FIXME Q3CheckListItem::stateChange( newState );
}
Modified: branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h?rev=42542&r1=42541&r2=42542&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h Fri Nov 30 12:03:26 2007
@@ -21,7 +21,7 @@
#define YQMultiSelectionBox_h
#include <QFrame>
-#include <Q3CheckListItem>
+#include <QTreeWidgetItem>
#include
participants (1)
-
dmacvicar@svn.opensuse.org