Author: dmacvicar
Date: Mon Dec 3 16:59:31 2007
New Revision: 42621
URL: http://svn.opensuse.org/viewcvs/yast?rev=42621&view=rev
Log:
compile
Modified:
branches/tmp/coolo/qt4-port/src/QY2ListView.cc
branches/tmp/coolo/qt4-port/src/QY2Settings.cc
branches/tmp/coolo/qt4-port/src/QY2Settings.h
branches/tmp/coolo/qt4-port/src/YQDialog.h
branches/tmp/coolo/qt4-port/src/YQRichText.cc
branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h
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=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2ListView.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2ListView.cc Mon Dec 3 16:59:31 2007
@@ -19,8 +19,8 @@
/-*/
-#include
-#include
+#include <QPixmap>
+#include <QHeaderView>
#include <QMouseEvent>
#include "QY2ListView.h"
@@ -36,13 +36,14 @@
, _finalSizeChangeExpected( false )
{
//FIXME QTreeWidget::setShowToolTips( false );
+ setRootIsDecorated(false);
#if FIXME_TOOLTIP
_toolTip = new QY2ListViewToolTip( this );
#endif
-// if ( header() )
-// header()->installEventFilter( this );
+ if ( header() )
+ header()->installEventFilter( this );
connect( this, SIGNAL( columnResized ( int, int, int ) ),
this, SLOT ( columnWidthChanged( int, int, int ) ) );
@@ -238,18 +239,18 @@
{
QTreeWidgetItem * item = itemAt( mapToGlobal( ev->pos() ) );
-// 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;
-//
+ if ( item && ( item->flags() & Qt::ItemIsEnabled ) )
+ {
+ int col = header()->logicalIndexAt( 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 );
}
@@ -283,29 +284,29 @@
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 QTreeWidget::eventFilter( obj, event );
}
@@ -426,15 +427,17 @@
QY2CheckListItem::QY2CheckListItem( QY2ListView * parentListView,
const QString & text )
- : QTreeWidgetItem( parentListView, QStringList(text), 1 )
+ : QTreeWidgetItem( parentListView, QStringList(text))
{
+ setFlags(Qt::ItemIsUserCheckable);
+ setCheckState(0, Qt::Unchecked);
_serial = parentListView->nextSerial();
}
QY2CheckListItem::QY2CheckListItem( QTreeWidgetItem * parentItem,
const QString & text )
- : QTreeWidgetItem( parentItem, QStringList(text), 1 )
+ : QTreeWidgetItem( parentItem, QStringList(text))
{
_serial = 0;
QY2ListView * parentListView = dynamic_cast ( treeWidget() );
Modified: branches/tmp/coolo/qt4-port/src/QY2Settings.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2Settings.cc?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2Settings.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2Settings.cc Mon Dec 3 16:59:31 2007
@@ -22,8 +22,8 @@
#include "QY2Settings.h"
-#include
-#include
+#include <QFile>
+#include <QRegExp>
#include <iostream>
@@ -36,8 +36,6 @@
: _fileName( fileName )
, _accessMode( accessMode )
{
- _sections.setAutoDelete( true );
-
if ( _accessMode == ReadOnly || _accessMode == ReadWrite )
load();
else
@@ -89,14 +87,14 @@
QStringList sectionList;
SectionIterator it( _sections );
- while ( *it )
+ while ( it.hasNext() )
{
- QString sectionName = (*it)->name();
+ QString sectionName = (it.value())->name();
if ( includeUnnamed || ! sectionName.isEmpty() )
sectionList.append( sectionName );
- ++it;
+ it.next();
}
return sectionList;
@@ -165,8 +163,8 @@
return false;
}
- Q3TextStream str( &file );
- str.setEncoding( Q3TextStream::UnicodeUTF8 );
+ QTextStream str( &file );
+ str.setAutoDetectUnicode(true);
QString line;
int lineCount = 0;
@@ -239,8 +237,8 @@
return false;
}
- Q3TextStream str( &file );
- str.setEncoding( Q3TextStream::UnicodeUTF8 );
+ QTextStream str( &file );
+ str.setAutoDetectUnicode(true);
// The default section must be saved first since it doesn't have a section
// name that could be used for a headline
@@ -248,11 +246,11 @@
SectionIterator sectIt( _sections );
- while ( *sectIt )
+ while ( sectIt.hasNext() )
{
- if ( *sectIt != _defaultSection )
- saveSection( str, *sectIt );
- ++sectIt;
+ if ( sectIt.value() != _defaultSection )
+ saveSection( str, sectIt.value() );
+ sectIt.next();
}
_dirty = false;
@@ -261,7 +259,7 @@
}
-void QY2Settings::saveSection( Q3TextStream & str, Section * sect )
+void QY2Settings::saveSection( QTextStream & str, Section * sect )
{
// Section header
Modified: branches/tmp/coolo/qt4-port/src/QY2Settings.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2Settings.h?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2Settings.h (original)
+++ branches/tmp/coolo/qt4-port/src/QY2Settings.h Mon Dec 3 16:59:31 2007
@@ -22,11 +22,11 @@
#ifndef QY2Settings_h
#define QY2Settings_h
-#include
-#include
-#include
-#include
-#include
+#include <QString>
+#include <QMap>
+#include <QHash>
+#include <QStringList>
+#include <QTextStream>
/**
* Utility class that handles program settings in .ini file format:
@@ -232,7 +232,7 @@
/**
* Save one section to a stream
**/
- void saveSection( Q3TextStream & stream, Section * section );
+ void saveSection( QTextStream & stream, Section * section );
//
@@ -247,9 +247,9 @@
bool _dirty;
Section * _defaultSection;
- Q3Dict<Section> _sections;
+ QMap _sections;
- typedef Q3DictIterator<Section> SectionIterator;
+ typedef QMapIterator SectionIterator;
};
#endif // QY2Settings_h
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.h?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.h Mon Dec 3 16:59:31 2007
@@ -20,9 +20,9 @@
#ifndef YQDialog_h
#define YQDialog_h
-#include
-#include
-#include
+#include <QFrame>
+#include <QEvent>
+#include <QWidget>
#include "YDialog.h"
Modified: branches/tmp/coolo/qt4-port/src/YQRichText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRichText.cc?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRichText.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQRichText.cc Mon Dec 3 16:59:31 2007
@@ -22,7 +22,7 @@
#include <QColorGroup>
#include <QScrollBar>
#include <QRegExp>
-#include <QEvent>
+#include <QKeyEvent>
#include <QVBoxLayout>
#include "YEvent.h"
Modified: branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc Mon Dec 3 16:59:31 2007
@@ -21,7 +21,7 @@
#include <QListWidget>
#include
#include <QPixmap>
-#include <QEvent>
+#include <QKeyEvent>
#include <QVBoxLayout>
#define y2log_component "qt-ui"
#include
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc Mon Dec 3 16:59:31 2007
@@ -25,18 +25,17 @@
#include
#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-//Added by qt3to4:
-#include
-#include
+#include <QLabel>
+#include <QKeyEvent>
+#include <QLayout>
+#include <QMenu>
+#include <QPushButton>
+#include <QDateTime>
+#include <QPainter>
+#include <QMessageBox>
+#include <QDesktopWidget>
+#include <QPixmap>
+#include <QBoxLayout>
#include "YQPkgConflictDialog.h"
#include "YQPkgConflictList.h"
@@ -81,7 +80,7 @@
// Layout for the dialog (can't simply insert a QVbox)
- Q3VBoxLayout * layout = new Q3VBoxLayout( this, MARGIN, SPACING );
+ QVBoxLayout * layout = new QVBoxLayout( this, MARGIN, SPACING );
Q_CHECK_PTR( layout );
// Conflict list
@@ -96,37 +95,38 @@
// Button box
-
- Q3HBox * buttonBox = new Q3HBox( this );
+ QHBoxLayout * buttonBox = new QHBoxLayout(this);
Q_CHECK_PTR( buttonBox );
buttonBox->setSpacing( SPACING );
buttonBox->setMargin ( MARGIN );
- layout->addWidget( buttonBox );
-
+ layout->addLayout( buttonBox );
// "OK" button
- QPushButton * button = new QPushButton( _( "&OK -- Try Again" ), buttonBox );
+ QPushButton * button = new QPushButton( _( "&OK -- Try Again" ), this);
+ buttonBox->addWidget(button);
Q_CHECK_PTR( button );
button->setDefault( true );
connect( button, SIGNAL( clicked() ),
this, SLOT ( solveAndShowConflicts() ) );
- addHStretch( buttonBox );
+ // FIXME addHStretch( buttonBox );
// "Expert" menu button
- button = new QPushButton( _( "&Expert" ), buttonBox );
+ button = new QPushButton( _( "&Expert" ), this );
+ buttonBox->addWidget(button);
+
Q_CHECK_PTR( button );
- addHStretch( buttonBox );
+ //FIXME addHStretch( buttonBox );
// "Expert" menu
- _expertMenu = new Q3PopupMenu( button );
+ _expertMenu = new QMenu( button );
Q_CHECK_PTR( _expertMenu );
button->setPopup( _expertMenu );
@@ -136,7 +136,8 @@
// "Cancel" button
- button = new QPushButton( _( "&Cancel" ), buttonBox );
+ button = new QPushButton( _( "&Cancel" ), this);
+ buttonBox->addWidget(button);
Q_CHECK_PTR( button );
connect( button, SIGNAL( clicked() ),
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h?rev=42621&r1=42620&r2=42621&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h Mon Dec 3 16:59:31 2007
@@ -20,15 +20,14 @@
#ifndef YQPkgConflictDialog_h
#define YQPkgConflictDialog_h
-#include
-//Added by qt3to4:
-#include
-#include
+#include <QDialog>
+#include <QMenu>
+#include <QLabel>
class YQPkgConflictList;
class PMManager;
class QPushButton;
-class Q3PopupMenu;
+class QMenu;
class QLabel;
@@ -152,7 +151,7 @@
//
YQPkgConflictList * _conflictList;
- Q3PopupMenu * _expertMenu;
+ QMenu * _expertMenu;
QLabel * _busyPopup;
double _totalSolveTime;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org