Author: coolo
Date: Mon Nov 26 11:13:17 2007
New Revision: 42380
URL: http://svn.opensuse.org/viewcvs/yast?rev=42380&view=rev
Log:
picking up branches/tmp/sh/qt4-port/, merging it with trunk
and making it work
Modified:
branches/tmp/coolo/qt4-port/Makefile.cvs
branches/tmp/coolo/qt4-port/acinclude.m4
branches/tmp/coolo/qt4-port/configure.in.in
branches/tmp/coolo/qt4-port/src/Makefile.am
branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc
branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc
branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h
branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc
branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h
branches/tmp/coolo/qt4-port/src/QY2LayoutUtils.cc
branches/tmp/coolo/qt4-port/src/QY2ListView.cc
branches/tmp/coolo/qt4-port/src/QY2ListView.h
branches/tmp/coolo/qt4-port/src/QY2Settings.cc
branches/tmp/coolo/qt4-port/src/QY2Settings.h
branches/tmp/coolo/qt4-port/src/YQApplication.cc
branches/tmp/coolo/qt4-port/src/YQApplication.h
branches/tmp/coolo/qt4-port/src/YQBarGraph.cc
branches/tmp/coolo/qt4-port/src/YQCheckBox.cc
branches/tmp/coolo/qt4-port/src/YQCheckBox.h
branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc
branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.h
branches/tmp/coolo/qt4-port/src/YQComboBox.cc
branches/tmp/coolo/qt4-port/src/YQComboBox.h
branches/tmp/coolo/qt4-port/src/YQDateField.cc
branches/tmp/coolo/qt4-port/src/YQDateField.h
branches/tmp/coolo/qt4-port/src/YQDialog.cc
branches/tmp/coolo/qt4-port/src/YQDialog.h
branches/tmp/coolo/qt4-port/src/YQDownloadProgress.cc
branches/tmp/coolo/qt4-port/src/YQDownloadProgress.h
branches/tmp/coolo/qt4-port/src/YQDumbTab.cc
branches/tmp/coolo/qt4-port/src/YQFrame.cc
branches/tmp/coolo/qt4-port/src/YQFrame.h
branches/tmp/coolo/qt4-port/src/YQGenericButton.cc
branches/tmp/coolo/qt4-port/src/YQIconPool.cc
branches/tmp/coolo/qt4-port/src/YQIconPool.h
branches/tmp/coolo/qt4-port/src/YQImage.cc
branches/tmp/coolo/qt4-port/src/YQInputField.cc
branches/tmp/coolo/qt4-port/src/YQInputField.h
branches/tmp/coolo/qt4-port/src/YQIntField.cc
branches/tmp/coolo/qt4-port/src/YQIntField.h
branches/tmp/coolo/qt4-port/src/YQLabel.cc
branches/tmp/coolo/qt4-port/src/YQLogView.cc
branches/tmp/coolo/qt4-port/src/YQLogView.h
branches/tmp/coolo/qt4-port/src/YQMenuButton.cc
branches/tmp/coolo/qt4-port/src/YQMenuButton.h
branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.cc
branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.h
branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc
branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.h
branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc
branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h
branches/tmp/coolo/qt4-port/src/YQProgressBar.cc
branches/tmp/coolo/qt4-port/src/YQProgressBar.h
branches/tmp/coolo/qt4-port/src/YQPushButton.cc
branches/tmp/coolo/qt4-port/src/YQRadioButton.cc
branches/tmp/coolo/qt4-port/src/YQRadioButton.h
branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc
branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.h
branches/tmp/coolo/qt4-port/src/YQRichText.cc
branches/tmp/coolo/qt4-port/src/YQRichText.h
branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc
branches/tmp/coolo/qt4-port/src/YQSelectionBox.h
branches/tmp/coolo/qt4-port/src/YQSlider.cc
branches/tmp/coolo/qt4-port/src/YQSlider.h
branches/tmp/coolo/qt4-port/src/YQTable.cc
branches/tmp/coolo/qt4-port/src/YQTable.h
branches/tmp/coolo/qt4-port/src/YQTimeField.cc
branches/tmp/coolo/qt4-port/src/YQTimeField.h
branches/tmp/coolo/qt4-port/src/YQTree.cc
branches/tmp/coolo/qt4-port/src/YQTree.h
branches/tmp/coolo/qt4-port/src/YQUI.h
branches/tmp/coolo/qt4-port/src/YQUIComponent.h
branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc
branches/tmp/coolo/qt4-port/src/YQUI_core.cc
branches/tmp/coolo/qt4-port/src/YQUI_widgets.cc
branches/tmp/coolo/qt4-port/src/YQUI_x11.cc
branches/tmp/coolo/qt4-port/src/YQWidgetCaption.cc
branches/tmp/coolo/qt4-port/src/YQWizard.cc
branches/tmp/coolo/qt4-port/src/YQWizard.h
branches/tmp/coolo/qt4-port/src/YQWizardButton.cc
branches/tmp/coolo/qt4-port/src/pkg/Makefile.am
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelector.h
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPackageSelectorBase.h
branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPatternSelector.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgChangesDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.h
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/YQPkgDescriptionDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDescriptionView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageWarningDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgGenericDetailsView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgGenericDetailsView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgLangList.cc
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/YQPkgPatchFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.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/YQPkgProductDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRpmGroupTagsFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRpmGroupTagsFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSearchFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSearchFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelDescriptionView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgStatusFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgStatusFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgTechnicalDetailsView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgTextDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgTextDialog.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgUpdateProblemFilterView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgUpdateProblemFilterView.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.h
branches/tmp/coolo/qt4-port/src/pkg/YQSimplePatchSelector.cc
branches/tmp/coolo/qt4-port/src/pkg/YQSimplePatchSelector.h
branches/tmp/coolo/qt4-port/src/utf8.h
branches/tmp/coolo/qt4-port/yast2-qt.spec.in
Modified: branches/tmp/coolo/qt4-port/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/Makefile.cvs?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/Makefile.cvs (original)
+++ branches/tmp/coolo/qt4-port/Makefile.cvs Mon Nov 26 11:13:17 2007
@@ -7,7 +7,7 @@
PREFIX = /usr
configure: all
- ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB) --with-qt-dir=/usr/lib/qt3 --with-qt-libdir=/usr/lib/qt3/$(LIB)
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
all:
y2tool y2autoconf
Modified: branches/tmp/coolo/qt4-port/acinclude.m4
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/acinclude.m4?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/acinclude.m4 (original)
+++ branches/tmp/coolo/qt4-port/acinclude.m4 Mon Nov 26 11:13:17 2007
@@ -4,7 +4,7 @@
dnl See file COPYING for license
dnl
dnl Author: Stefan Hundhammer
-dnl Updated: 2001-12-14
+dnl Updated: 2007-07-25
dnl
@@ -14,11 +14,11 @@
AC_DEFUN([AC_MIN_QT_VERSION],
[
AC_MSG_CHECKING([for Qt $2 or higher])
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -I$QTDIR/include"
+dnl save_CFLAGS="$CFLAGS"
+dnl CFLAGS="$CFLAGS -I$QTDIR/include"
AC_TRY_COMPILE([
-#include
+#include
],
[
#if QT_VERSION < $1
@@ -29,9 +29,26 @@
[AC_MSG_ERROR([Qt $2 or higher required!
Check whether the Qt base packages and the Qt development packages
-are installed and QTDIR is set correctly.
+are installed!
])]
)
-CFLAGS="$save_CFLAGS"
+dnl CFLAGS="$save_CFLAGS"
])
+
+dnl AC_QTDIRS
+dnl Sets up directories for Qt
+AC_DEFUN([AC_QTDIRS],
+MOC=/usr/bin/moc
+QT_INCLUDEDIR=/usr/include/Qt
+QT_LIBDIR=/usr/lib
+QT_SHAREDIR=/usr/share/qt4
+QT_TRANSLATIONSDIR=${QT_SHAREDIR}/translations
+QT_PLUGINDIR=/usr/lib/qt4/plugins
+AC_SUBST(MOC)
+AC_SUBST(QT_INCLUDEDIR)
+AC_SUBST(QT_LIBDIR)
+AC_SUBST(QT_SHAREDIR)
+AC_SUBST(QT_TRANSLATIONSDIR)
+AC_SUBST(QT_PLUGINDIR)
+)
\ No newline at end of file
Modified: branches/tmp/coolo/qt4-port/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/configure.in.in?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/configure.in.in (original)
+++ branches/tmp/coolo/qt4-port/configure.in.in Mon Nov 26 11:13:17 2007
@@ -7,14 +7,15 @@
## some common checks
@YAST2-CHECKS-COMMON@
@YAST2-CHECKS-PROGRAM@
-@YAST2-CHECKS-QT@
+@YAST2-CHECKS-QT4@
## special stuff
-AC_MIN_QT_VERSION(301,3.01)
+AC_MIN_QT_VERSION(0x040201,4.2.1)
+AC_QTDIRS
AC_MSG_CHECKING([X font directory])
-#ugh, /etc/YaST2/XVersion is in yast2.rpm which is only built after us
-#so let's hardcode, like in the spec file anyway
+# /etc/YaST2/XVersion is in yast2.rpm which is only built after us
+# so let's hardcode like in the spec file anyway
case "$x_includes" in
*X11R6*) Xfontsdir=$prefix/X11R6/lib/X11/fonts ;;
*) Xfontsdir=$prefix/share/fonts ;;
Modified: branches/tmp/coolo/qt4-port/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/Makefile.am?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/Makefile.am (original)
+++ branches/tmp/coolo/qt4-port/src/Makefile.am Mon Nov 26 11:13:17 2007
@@ -2,22 +2,19 @@
# Makefile.am for qt/src
#
-SUBDIRS = pkg
+# SUBDIRS = pkg
AM_CXXFLAGS = -DY2LOG=\"ui-qt\" \
+ -DQT3_SUPPORT \
-DQT_THREAD_SUPPORT \
-DLOCALEDIR=\"${localedir}\" \
- -DQT_LOCALEDIR=\"$(QTDIR)/translations\" \
+ -DQT_LOCALEDIR=\"$(QT_TRANSLATIONSDIR)\" \
-DICONDIR=\"${themedir}/current\" \
-DTHEMEDIR=\"${themedir}/current\" \
- -DHELPIMAGEDIR=\"${imagedir}\" \
-DLANG_FONTS_FILE=\"${lang_fontsdir}/lang_fonts\" \
- -DQTLIBDIR=\"$(QTLIBDIR)\" \
+ -DQTLIBDIR=\"$(QT_LIBDIR)\" \
-fmessage-length=0
-
-MOC = $(QTDIR)/bin/moc
-
serversdir = $(execcompdir)/servers
lang_fontsdir=$(ydatadir)
@@ -31,8 +28,7 @@
libpy2qt_la_LIBADD = \
-L$(plugindir) -lpy2UI \
- -L$(QTLIBDIR) -lqt-mt \
- -lX11 -lXext -lSM -lICE
+ -L$(QTLIBDIR) -lQtGui -lQt3Support
# libpy2qt_la_LIBADD = \
# -Lpkg -ly2qt_pkg \
@@ -66,11 +62,11 @@
YQBarGraph.cc \
YQCheckBox.cc \
YQCheckBoxFrame.cc \
+ \
YQComboBox.cc \
YQDateField.cc \
YQDialog.cc \
YQDownloadProgress.cc \
- YQDumbTab.cc \
YQEBunny.cc \
YQEmpty.cc \
YQFrame.cc \
@@ -80,25 +76,19 @@
YQIntField.cc \
YQLabel.cc \
YQLayoutBox.cc \
- YQLogView.cc \
YQMenuButton.cc \
- YQMultiLineEdit.cc \
YQMultiProgressMeter.cc \
- YQMultiSelectionBox.cc \
YQPartitionSplitter.cc \
YQProgressBar.cc \
YQPushButton.cc \
YQRadioButton.cc \
YQRadioButtonGroup.cc \
YQReplacePoint.cc \
- YQRichText.cc \
YQSelectionBox.cc \
YQSlider.cc \
YQSpacing.cc \
YQSquash.cc \
- YQTable.cc \
YQTimeField.cc \
- YQTree.cc \
YQWizard.cc \
YQWizardButton.cc \
\
@@ -108,10 +98,15 @@
QY2CharValidator.cc \
QY2ListView.cc \
QY2Settings.cc \
- QY2LayoutUtils.cc
-
-
-
+ QY2LayoutUtils.cc \
+ \
+ YQTable.cc \
+ YQTree.cc \
+ YQLogView.cc \
+ YQMultiLineEdit.cc \
+ YQDumbTab.cc \
+ YQMultiSelectionBox.cc \
+ YQRichText.cc
# Note: QY2LayoutUtils and QY2Settings don't need any .moc file: No QObjects
@@ -276,4 +271,4 @@
CLEANFILES = *.moc
-INCLUDES = -I$(srcdir)/pkg -I$(QTDIR)/include -I$(includedir) -I$(includedir)/yui
+INCLUDES = -I$(srcdir)/pkg `pkg-config --cflags QtGui` `pkg-config --cflags QtCore` `pkg-config --cflags Qt3Support` -I$(includedir) -I$(includedir)/yui
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2CharValidator.cc Mon Nov 26 11:13:17 2007
@@ -52,7 +52,7 @@
// There might be more than one new character - the user might have copied
// some longer text via the X clipboard.
- for ( unsigned i=0; i < fieldContents.length(); i++ )
+ for ( int i=0; i < fieldContents.length(); i++ )
{
if ( ! validChars().contains( fieldContents[i] ) )
return QValidator::Invalid;
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.cc Mon Nov 26 11:13:17 2007
@@ -19,10 +19,12 @@
/-*/
-#include
+#include
#include
#include
-#include
+#include
+//Added by qt3to4:
+#include
#define y2log_component "qt-pkg"
#include
@@ -38,34 +40,34 @@
QY2ComboTabWidget::QY2ComboTabWidget( const QString & label,
QWidget * parent,
const char * name )
- : QVBox( parent, name )
+ : Q3VBox( parent, name )
{
- setFrameStyle( QFrame::Panel | QFrame::Raised );
+ setFrameStyle( Q3Frame::Panel | Q3Frame::Raised );
setLineWidth(2);
setMidLineWidth(2);
setSpacing( SPACING );
setMargin ( MARGIN );
- QHBox * hbox = new QHBox( this );
- CHECK_PTR( hbox );
+ Q3HBox * hbox = new Q3HBox( this );
+ Q_CHECK_PTR( hbox );
hbox->setSpacing( SPACING );
hbox->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
combo_label = new QLabel( label, hbox );
- CHECK_PTR( combo_label );
+ Q_CHECK_PTR( combo_label );
combo_box = new QComboBox( hbox );
- CHECK_PTR( combo_box );
+ Q_CHECK_PTR( combo_box );
combo_label->setBuddy( combo_box );
combo_box->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) ); // hor/vert
connect( combo_box, SIGNAL( activated( int ) ),
this, SLOT ( showPage ( int ) ) );
- widget_stack = new QWidgetStack( this );
- CHECK_PTR( widget_stack );
+ widget_stack = new Q3WidgetStack( this );
+ Q_CHECK_PTR( widget_stack );
}
@@ -123,7 +125,7 @@
// Search the dict for this page
- QIntDictIterator<QWidget> it( pages );
+ Q3IntDictIterator<QWidget> it( pages );
while ( it.current() )
{
Modified: branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h (original)
+++ branches/tmp/coolo/qt4-port/src/QY2ComboTabWidget.h Mon Nov 26 11:13:17 2007
@@ -22,13 +22,13 @@
#ifndef QY2ComboTabWidget_h
#define QY2ComboTabWidget_h
-#include
+#include
#include
-#include
+#include
class QComboBox;
class QLabel;
-class QWidgetStack;
+class Q3WidgetStack;
class QWidget;
@@ -36,7 +36,7 @@
* This widget is very much like a QTabWidget, but it uses a combo box above
* the tab pages rather than a ( scrolled ) one-line row of tabs.
**/
-class QY2ComboTabWidget : public QVBox
+class QY2ComboTabWidget : public Q3VBox
{
Q_OBJECT
@@ -95,8 +95,8 @@
QComboBox * combo_box;
QLabel * combo_label;
- QWidgetStack * widget_stack;
- QIntDict<QWidget> pages;
+ Q3WidgetStack * widget_stack;
+ Q3IntDict<QWidget> pages;
};
#endif // QY2ComboTabWidget_h
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.cc Mon Nov 26 11:13:17 2007
@@ -62,7 +62,7 @@
}
saveColumnWidths();
- setSelectionMode( QListView::NoSelection );
+ setSelectionMode( Q3ListView::NoSelection );
}
@@ -167,7 +167,7 @@
* +1 if this > other
**/
int
-QY2DiskUsageListItem::compare( QListViewItem * otherListViewItem,
+QY2DiskUsageListItem::compare( Q3ListViewItem * otherListViewItem,
int col,
bool ascending ) const
{
@@ -241,7 +241,7 @@
// Intentionally bypassing the direct parent class method, use the grandparent's:
// Don't let QY2ListViewItem::_textColor / _backgroundColor interfere with our colors.
- QListViewItem::paintCell( painter, cg, column, width, alignment );
+ Q3ListViewItem::paintCell( painter, cg, column, width, alignment );
}
}
@@ -276,7 +276,7 @@
QPen pen( painter->pen() );
pen.setWidth(0);
painter->setPen( pen );
- painter->setBrush( NoBrush );
+ painter->setBrush( Qt::NoBrush );
fillWidth = (int) ( ( w - 2 * penWidth ) * percent / 100.0 );
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h (original)
+++ branches/tmp/coolo/qt4-port/src/QY2DiskUsageList.h Mon Nov 26 11:13:17 2007
@@ -177,7 +177,7 @@
* confused which one to use.
**/
void setText( int column, const QString & text )
- { QListViewItem::setText( column, text ); }
+ { Q3ListViewItem::setText( column, text ); }
/**
* Set a column text via FSize.
@@ -193,7 +193,7 @@
*
* Reimplemented from QY2ListViewItem.
**/
- virtual int compare( QListViewItem * other,
+ virtual int compare( Q3ListViewItem * other,
int col,
bool ascending ) const;
Modified: branches/tmp/coolo/qt4-port/src/QY2LayoutUtils.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/QY2LayoutUtils.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2LayoutUtils.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2LayoutUtils.cc Mon Nov 26 11:13:17 2007
@@ -21,6 +21,7 @@
#include
#include
+#include <QDesktopWidget>
#include "QY2LayoutUtils.h"
@@ -45,7 +46,7 @@
QWidget * addVSpacing( QWidget * parent, int height )
{
QWidget * spacer = new QWidget( parent );
- CHECK_PTR( spacer );
+ Q_CHECK_PTR( spacer );
spacer->setFixedHeight( height );
return spacer;
@@ -55,7 +56,7 @@
QWidget * addHSpacing( QWidget * parent, int width )
{
QWidget * spacer = new QWidget( parent );
- CHECK_PTR( spacer );
+ Q_CHECK_PTR( spacer );
spacer->setFixedWidth( width );
return spacer;
@@ -72,7 +73,7 @@
QSize
limitToScreenSize( const QWidget * widget, const QSize & desiredSize )
{
- QSize availableSize = qApp->desktop()->availableGeometry( const_cast (widget) ).size();
+ QSize availableSize = QApplication::desktop()->availableGeometry( const_cast (widget) ).size();
// Subtract WM decorations. There seems to be no reliable way to tell if
// this is necessary at all (even fvwm2 claims it is a NETWM compliant
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2ListView.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2ListView.cc Mon Nov 26 11:13:17 2007
@@ -20,23 +20,26 @@
#include
-#include
-
+#include
+#include <QMouseEvent>
#include "QY2ListView.h"
QY2ListView::QY2ListView( QWidget * parent )
- : QListView( parent )
+ : Q3ListView( parent )
, _mousePressedItem(0)
, _mousePressedCol( -1 )
- , _mousePressedButton( NoButton )
+ , _mousePressedButton( Qt::NoButton )
, _sortByInsertionSequence( false )
, _nextSerial(0)
, _mouseButton1PressedInHeader( false )
, _finalSizeChangeExpected( false )
{
- QListView::setShowToolTips( false );
+ Q3ListView::setShowToolTips( false );
+
+#if FIXME_TOOLTIP
_toolTip = new QY2ListViewToolTip( this );
+#endif
if ( header() )
header()->installEventFilter( this );
@@ -48,15 +51,17 @@
QY2ListView::~QY2ListView()
{
+#if FIXME_TOOLTIP
if ( _toolTip )
delete _toolTip;
+#endif
}
void
QY2ListView::selectSomething()
{
- QListViewItemIterator it( this );
+ Q3ListViewItemIterator it( this );
while ( *it )
{
@@ -76,7 +81,7 @@
void
QY2ListView::clear()
{
- QListView::clear();
+ Q3ListView::clear();
restoreColumnWidths();
}
@@ -84,7 +89,7 @@
void
QY2ListView::updateItemStates()
{
- QListViewItemIterator it( this );
+ Q3ListViewItemIterator it( this );
while ( *it )
{
@@ -101,7 +106,7 @@
void
QY2ListView::updateItemData()
{
- QListViewItemIterator it( this );
+ Q3ListViewItemIterator it( this );
while ( *it )
{
@@ -116,7 +121,7 @@
QString
-QY2ListView::toolTip( QListViewItem * listViewItem, int column )
+QY2ListView::toolTip( Q3ListViewItem * listViewItem, int column )
{
if ( ! listViewItem )
return QString::null;
@@ -177,7 +182,7 @@
void
QY2ListView::contentsMousePressEvent( QMouseEvent * ev )
{
- QListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
+ Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
if ( item && item->isEnabled() )
{
@@ -193,14 +198,14 @@
}
// Call base class method
- QListView::contentsMousePressEvent( ev );
+ Q3ListView::contentsMousePressEvent( ev );
}
void
QY2ListView::contentsMouseReleaseEvent( QMouseEvent * ev )
{
- QListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
+ Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
if ( item && item->isEnabled() && item == _mousePressedItem )
{
@@ -219,17 +224,17 @@
_mousePressedItem = 0;
_mousePressedCol = -1;
- _mousePressedButton = NoButton;
+ _mousePressedButton = Qt::NoButton;
// Call base class method
- QListView::contentsMouseReleaseEvent( ev );
+ Q3ListView::contentsMouseReleaseEvent( ev );
}
void
QY2ListView::contentsMouseDoubleClickEvent( QMouseEvent * ev )
{
- QListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
+ Q3ListViewItem * item = itemAt( contentsToViewport( ev->pos() ) );
if ( item && item->isEnabled() )
{
@@ -241,10 +246,10 @@
_mousePressedItem = 0;
_mousePressedCol = -1;
- _mousePressedButton = NoButton;
+ _mousePressedButton = Qt::NoButton;
// Call base class method
- QListView::contentsMouseDoubleClickEvent( ev );
+ Q3ListView::contentsMouseDoubleClickEvent( ev );
}
@@ -300,7 +305,7 @@
}
}
- return QListView::eventFilter( obj, event );
+ return Q3ListView::eventFilter( obj, event );
}
@@ -325,15 +330,15 @@
QY2ListViewItem::QY2ListViewItem( QY2ListView * parentListView,
const QString & text )
- : QListViewItem( parentListView, text )
+ : Q3ListViewItem( parentListView, text )
{
_serial = parentListView->nextSerial();
}
-QY2ListViewItem::QY2ListViewItem( QListViewItem * parentItem,
+QY2ListViewItem::QY2ListViewItem( Q3ListViewItem * parentItem,
const QString & text )
- : QListViewItem( parentItem, text )
+ : Q3ListViewItem( parentItem, text )
{
_serial = 0;
@@ -358,7 +363,7 @@
* +1 if this > other
**/
int
-QY2ListViewItem::compare( QListViewItem * otherListViewItem,
+QY2ListViewItem::compare( Q3ListViewItem * otherListViewItem,
int col,
bool ascending ) const
{
@@ -392,7 +397,7 @@
}
- return QListViewItem::compare( otherListViewItem, col, ascending );
+ return Q3ListViewItem::compare( otherListViewItem, col, ascending );
}
@@ -408,7 +413,7 @@
if ( _textColor.isValid() ) cg.setColor( QColorGroup::Text, _textColor );
if ( _backgroundColor.isValid() ) cg.setColor( QColorGroup::Base, _backgroundColor );
- QListViewItem::paintCell( painter, cg, column, width, alignment );
+ Q3ListViewItem::paintCell( painter, cg, column, width, alignment );
}
@@ -418,17 +423,17 @@
QY2CheckListItem::QY2CheckListItem( QY2ListView * parentListView,
const QString & text,
- QCheckListItem::Type type )
- : QCheckListItem( parentListView, text, type )
+ Q3CheckListItem::Type type )
+ : Q3CheckListItem( parentListView, text, type )
{
_serial = parentListView->nextSerial();
}
-QY2CheckListItem::QY2CheckListItem( QListViewItem * parentItem,
+QY2CheckListItem::QY2CheckListItem( Q3ListViewItem * parentItem,
const QString & text,
- QCheckListItem::Type type )
- : QCheckListItem( parentItem, text, type )
+ Q3CheckListItem::Type type )
+ : Q3CheckListItem( parentItem, text, type )
{
_serial = 0;
QY2ListView * parentListView = dynamic_cast ( listView() );
@@ -438,10 +443,10 @@
}
-QY2CheckListItem::QY2CheckListItem( QCheckListItem * parentItem,
+QY2CheckListItem::QY2CheckListItem( Q3CheckListItem * parentItem,
const QString & text,
- QCheckListItem::Type type )
- : QCheckListItem( parentItem, text, type )
+ Q3CheckListItem::Type type )
+ : Q3CheckListItem( parentItem, text, type )
{
_serial = 0;
QY2ListView * parentListView = dynamic_cast ( listView() );
@@ -465,7 +470,7 @@
* +1 if this > other
**/
int
-QY2CheckListItem::compare( QListViewItem * otherListViewItem,
+QY2CheckListItem::compare( Q3ListViewItem * otherListViewItem,
int col,
bool ascending ) const
{
@@ -500,7 +505,7 @@
}
- return QListViewItem::compare( otherListViewItem, col, ascending );
+ return Q3ListViewItem::compare( otherListViewItem, col, ascending );
}
@@ -516,15 +521,16 @@
if ( _textColor.isValid() ) cg.setColor( QColorGroup::Text, _textColor );
if ( _backgroundColor.isValid() ) cg.setColor( QColorGroup::Base, _backgroundColor );
- QCheckListItem::paintCell( painter, cg, column, width, alignment );
+ Q3CheckListItem::paintCell( painter, cg, column, width, alignment );
}
+#if FIXME_TOOLTIP
void
QY2ListViewToolTip::maybeTip( const QPoint & pos )
{
- QHeader * header = _listView->header();
- QListViewItem * item = _listView->itemAt( pos );
+ Q3Header * header = _listView->header();
+ Q3ListViewItem * item = _listView->itemAt( pos );
if ( ! item )
return;
@@ -565,5 +571,7 @@
}
}
+#endif
+
#include "QY2ListView.moc"
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2ListView.h (original)
+++ branches/tmp/coolo/qt4-port/src/QY2ListView.h Mon Nov 26 11:13:17 2007
@@ -22,21 +22,23 @@
#ifndef QY2ListView_h
#define QY2ListView_h
-#include
+#include
#include
#include
#include
#include <vector>
+#define FIXME_TOOLTIP 0
+
class QY2ListViewItem;
class QY2ListViewToolTip;
/**
- * @short Enhanced QListView
+ * @short Enhanced Q3ListView
**/
-class QY2ListView : public QListView
+class QY2ListView : public Q3ListView
{
Q_OBJECT
@@ -63,7 +65,7 @@
virtual void selectSomething();
/**
- * Reimplemented from QListView:
+ * Reimplemented from Q3ListView:
* Adjust header sizes after clearing contents.
**/
virtual void clear();
@@ -100,7 +102,7 @@
* Emitted for mouse clicks on an item
**/
void columnClicked ( int button,
- QListViewItem * item,
+ Q3ListViewItem * item,
int col,
const QPoint & pos );
@@ -108,7 +110,7 @@
* Emitted for mouse double clicks on an item
**/
void columnDoubleClicked ( int button,
- QListViewItem * item,
+ Q3ListViewItem * item,
int col,
const QPoint & pos );
@@ -125,7 +127,7 @@
*
* Derived classes may handle this differently.
**/
- virtual QString toolTip( QListViewItem * item, int column );
+ virtual QString toolTip( Q3ListViewItem * item, int column );
/**
* Returns 'true' if the sort order should always be the item insertion
@@ -192,7 +194,7 @@
// Data members
//
- QListViewItem * _mousePressedItem;
+ Q3ListViewItem * _mousePressedItem;
int _mousePressedCol;
int _mousePressedButton;
@@ -208,9 +210,9 @@
/**
- * Enhanced QListViewItem
+ * Enhanced Q3ListViewItem
**/
-class QY2ListViewItem: public QListViewItem
+class QY2ListViewItem: public Q3ListViewItem
{
public:
@@ -224,7 +226,7 @@
/**
* Constructor for deeper level items.
**/
- QY2ListViewItem( QListViewItem * parentItem,
+ QY2ListViewItem( Q3ListViewItem * parentItem,
const QString & text = QString::null );
/**
@@ -255,9 +257,9 @@
* 0 if this == other
* +1 if this > other
*
- * Reimplemented from QListViewItem
+ * Reimplemented from Q3ListViewItem
**/
- virtual int compare( QListViewItem * other,
+ virtual int compare( Q3ListViewItem * other,
int col,
bool ascending ) const;
@@ -293,10 +295,10 @@
protected:
/**
- * Paint method. Reimplemented from @ref QListViewItem so different
+ * Paint method. Reimplemented from @ref Q3ListViewItem so different
* colors can be used.
*
- * Reimplemented from QListViewItem.
+ * Reimplemented from Q3ListViewItem.
**/
virtual void paintCell( QPainter * painter,
const QColorGroup & colorGroup,
@@ -319,7 +321,7 @@
/**
* Enhanced QCheckListItem
**/
-class QY2CheckListItem: public QCheckListItem
+class QY2CheckListItem: public Q3CheckListItem
{
public:
@@ -328,23 +330,23 @@
**/
QY2CheckListItem( QY2ListView * parentListView,
const QString & text,
- QCheckListItem::Type type );
+ Q3CheckListItem::Type type );
/**
* Constructor for deeper level items.
**/
- QY2CheckListItem( QListViewItem * parentItem,
+ QY2CheckListItem( Q3ListViewItem * parentItem,
const QString & text,
- QCheckListItem::Type type );
+ Q3CheckListItem::Type type );
/**
* Constructor for deeper level items for QCheckListItem parents.
**/
- QY2CheckListItem( QCheckListItem * parentItem,
+ QY2CheckListItem( Q3CheckListItem * parentItem,
const QString & text,
- QCheckListItem::Type type );
+ Q3CheckListItem::Type type );
/**
* Destructor
@@ -374,9 +376,9 @@
* 0 if this == other
* +1 if this > other
*
- * Reimplemented from QListViewItem
+ * Reimplemented from Q3ListViewItem
**/
- virtual int compare( QListViewItem * other,
+ virtual int compare( Q3ListViewItem * other,
int col,
bool ascending ) const;
@@ -412,10 +414,10 @@
protected:
/**
- * Paint method. Reimplemented from @ref QListViewItem so different
+ * Paint method. Reimplemented from @ref Q3ListViewItem so different
* colors can be used.
*
- * Reimplemented from QListViewItem.
+ * Reimplemented from Q3ListViewItem.
**/
virtual void paintCell( QPainter * painter,
const QColorGroup & colorGroup,
@@ -434,6 +436,7 @@
};
+#if FIXME_TOOLTIP
/**
* Tool tip for a QY2ListView widget: Enables individual tool tips specific to
* each list item and each column. Overwrite QY2ListViewItem::toolTip() to use
@@ -447,7 +450,8 @@
* Constructor.
**/
QY2ListViewToolTip( QY2ListView * parent )
- : QToolTip( parent->viewport() ), _listView( parent ) {}
+ : QToolTip( parent->viewport() )
+ , _listView( parent ) {}
/**
* Destructor (to make gcc 4.x happy)
@@ -471,5 +475,6 @@
QY2ListView * _listView;
};
+#endif
#endif // ifndef QY2ListView_h
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2Settings.cc (original)
+++ branches/tmp/coolo/qt4-port/src/QY2Settings.cc Mon Nov 26 11:13:17 2007
@@ -47,7 +47,7 @@
void QY2Settings::initSections()
{
_defaultSection = new Section( "" );
- CHECK_PTR( _defaultSection );
+ Q_CHECK_PTR( _defaultSection );
_currentSection = _defaultSection;
_sections.insert( "", _defaultSection );
@@ -154,10 +154,10 @@
QFile file( _fileName );
- if ( ! file.open( IO_ReadOnly ) )
+ if ( ! file.open( QIODevice::ReadOnly ) )
{
- cerr << "Can't load settings from " << _fileName
- << ": " << file.errorString()
+ cerr << "Can't load settings from " << (const char *) _fileName
+ << ": " << (const char *) file.errorString()
<< endl;
_readError = true;
@@ -165,8 +165,8 @@
return false;
}
- QTextStream str( &file );
- str.setEncoding( QTextStream::UnicodeUTF8 );
+ Q3TextStream str( &file );
+ str.setEncoding( Q3TextStream::UnicodeUTF8 );
QString line;
int lineCount = 0;
@@ -230,17 +230,17 @@
QFile file( _fileName );
- if ( ! file.open( IO_WriteOnly ) )
+ if ( ! file.open( QIODevice::WriteOnly ) )
{
- cerr << "Can't save settings to " << _fileName
- << ": " << file.errorString()
+ cerr << "Can't save settings to " << (const char *) _fileName
+ << ": " << (const char *) file.errorString()
<< endl;
return false;
}
- QTextStream str( &file );
- str.setEncoding( QTextStream::UnicodeUTF8 );
+ Q3TextStream str( &file );
+ str.setEncoding( Q3TextStream::UnicodeUTF8 );
// The default section must be saved first since it doesn't have a section
// name that could be used for a headline
@@ -261,7 +261,7 @@
}
-void QY2Settings::saveSection( QTextStream & str, Section * sect )
+void QY2Settings::saveSection( Q3TextStream & str, Section * sect )
{
// Section header
@@ -299,7 +299,7 @@
return;
_currentSection = new Section( sectionName );
- CHECK_PTR( _currentSection );
+ Q_CHECK_PTR( _currentSection );
_sections.insert( sectionName, _currentSection );
_dirty = true;
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/QY2Settings.h (original)
+++ branches/tmp/coolo/qt4-port/src/QY2Settings.h Mon Nov 26 11:13:17 2007
@@ -22,11 +22,11 @@
#ifndef QY2Settings_h
#define QY2Settings_h
-#include
-#include
-#include
+#include
+#include
+#include
#include
-#include
+#include
/**
* Utility class that handles program settings in .ini file format:
@@ -215,7 +215,7 @@
QString _name;
};
-
+
/**
@@ -232,9 +232,9 @@
/**
* Save one section to a stream
**/
- void saveSection( QTextStream & stream, Section * section );
+ void saveSection( Q3TextStream & stream, Section * section );
+
-
//
// Data members
//
@@ -247,9 +247,9 @@
bool _dirty;
Section * _defaultSection;
- QDict<Section> _sections;
-
- typedef QDictIterator<Section> SectionIterator;
+ Q3Dict<Section> _sections;
+
+ typedef Q3DictIterator<Section> SectionIterator;
};
#endif // QY2Settings_h
Modified: branches/tmp/coolo/qt4-port/src/YQApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQApplication.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQApplication.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQApplication.cc Mon Nov 26 11:13:17 2007
@@ -17,8 +17,8 @@
/-*/
-#include
-#include
+#include
+#include
#include
#define y2log_component "qt-ui"
@@ -40,10 +40,10 @@
, _autoHeadingFontSize( -1 )
{
y2debug( "YQApplication constructor start" );
-
+
setIconBasePath( ICONDIR "/icons/22x22/apps/" );
loadPredefinedQtTranslations();
-
+
y2debug( "YQApplication constructor end" );
}
@@ -89,7 +89,7 @@
if ( ! _qtTranslations )
_qtTranslations = new QTranslator();
-
+
_qtTranslations->load( transFile, path );
if ( _qtTranslations->isEmpty() )
@@ -135,7 +135,7 @@
if ( ! _langFonts )
{
_langFonts = new QY2Settings( LANG_FONTS_FILE );
- CHECK_PTR( _langFonts );
+ Q_CHECK_PTR( _langFonts );
if ( _langFonts->readError() )
y2error( "Error reading %s", (const char *) _langFonts->fileName() );
@@ -144,17 +144,17 @@
}
QString lang = language.c_str();
-
+
if ( ! encoding.empty() )
lang += QString( "." ) + encoding.c_str();
-
+
QString key;
if ( ! _langFonts->hasKey( fontKey( lang ) ) ) // Try with encoding ("zh_CN.UTF8" etc.)
{
lang = language.c_str(); // Try without encoding ("zh_CN")
- if ( ! _langFonts->hasKey( fontKey( lang ) ) )
+ if ( ! _langFonts->hasKey( fontKey( lang ) ) )
lang.replace( QRegExp( "_.*$" ), "" ); // Cut off trailing country ("_CN")
}
@@ -320,7 +320,7 @@
#endif
int x = 800;
int y = 600;
-
+
int normal = 10;
int heading = 12;
@@ -368,7 +368,7 @@
_autoNormalFontSize, _autoHeadingFontSize );
}
-
+
#include "YQApplication.moc"
Modified: branches/tmp/coolo/qt4-port/src/YQApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQApplication.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQApplication.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQApplication.h Mon Nov 26 11:13:17 2007
@@ -20,8 +20,8 @@
#ifndef YQApplication_h
#define YQApplication_h
-#include
-#include
+#include
+#include
#include
#include "QY2Settings.h"
@@ -31,11 +31,11 @@
class YQApplication: public QObject, public YApplication
{
Q_OBJECT
-
+
protected:
friend class YQUI;
-
+
/**
* Constructor.
*
@@ -48,9 +48,9 @@
**/
virtual ~YQApplication();
-
+
public:
-
+
/**
* Set language and encoding for the locale environment ($LANG).
*
@@ -66,7 +66,7 @@
**/
virtual void setLanguage( const string & language,
const string & encoding = string() );
-
+
/**
* Load translations for Qt's predefined dialogs like file selection box
* etc.
@@ -124,7 +124,7 @@
**/
void setAutoFonts( bool useAutoFonts );
-
+
protected:
/**
@@ -142,9 +142,9 @@
//
// Data members
//
-
+
// Fonts
-
+
QFont * _currentFont;
QFont * _headingFont;
QFont * _boldFont;
@@ -171,7 +171,7 @@
int _autoNormalFontSize;
int _autoHeadingFontSize;
-
+
};
Modified: branches/tmp/coolo/qt4-port/src/YQBarGraph.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQBarGraph.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQBarGraph.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQBarGraph.cc Mon Nov 26 11:13:17 2007
@@ -87,7 +87,7 @@
segWidth = totalWidth - x_off + YQBarGraphOuterMargin;
}
-
+
//
// Fill the segment
//
@@ -99,18 +99,18 @@
{
// If any of the colors is undefined, use the next default color
// for both so some contrast is ensured.
-
+
segmentColor = defaultSegmentColor( nextDefaultColor );
textColor = defaultTextColor ( nextDefaultColor++ );
}
-
+
painter->setBrush( QColor( segmentColor.red(),
segmentColor.green(),
segmentColor.blue() ) );
painter->setPen( Qt::NoPen );
painter->drawRect( x_off, y_off, segWidth+2, segHeight+2 );
-
+
//
// Draw the label
//
@@ -119,16 +119,17 @@
painter->setPen( QColor( textColor.red(),
textColor.green(),
textColor.blue() ) );
- QString txt = seg.label();
+
+ QString txt = QString::fromStdString( seg.label() );
if ( txt.contains( "%1" ) )
txt = txt.arg( seg.value() ); // substitute variable
-
+
painter->drawText( x_off + YQBarGraphLabelHorizontalMargin,
y_off + YQBarGraphLabelVerticalMargin,
segWidth - 2 * YQBarGraphLabelHorizontalMargin + 1,
segHeight - 2 * YQBarGraphLabelVerticalMargin + 1,
- AlignCenter, txt );
+ Qt::AlignCenter, txt );
// Prepare for the next segment
@@ -137,7 +138,7 @@
}
-YColor
+YColor
YQBarGraph::defaultSegmentColor( unsigned index )
{
switch( index % 8 )
@@ -161,7 +162,7 @@
{
YColor black = YColor( 0, 0, 0 );
YColor white = YColor( 255, 255, 255 );
-
+
switch( index % 8 )
{
case 0: return white;
@@ -194,11 +195,11 @@
for ( int i=0; i < segments(); i++ )
{
- QString txt = segment(i).label();
-
+ QString txt = QString::fromStdString( segment(i).label() );
+
if ( txt.contains( "%1" ) )
txt = txt.arg( segment(i).value() );
-
+
QSize segSize = metrics.size( 0, txt );
width += segSize.width();
}
@@ -220,11 +221,11 @@
for ( int i=0; i < segments(); i++ )
{
- QString txt = segment(i).label();
-
+ QString txt = QString::fromStdString( segment(i).label() );
+
if ( txt.contains( "%1" ) )
txt = txt.arg( segment(i).value() );
-
+
QSize segSize = metrics.size( 0, txt );
height = max( height, segSize.height() );
}
Modified: branches/tmp/coolo/qt4-port/src/YQCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQCheckBox.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQCheckBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQCheckBox.cc Mon Nov 26 11:13:17 2007
@@ -18,7 +18,7 @@
#include
-#include
+#include
#define y2log_component "qt-ui"
#include
@@ -35,7 +35,7 @@
YQCheckBox::YQCheckBox( YWidget * parent,
const string & label,
bool checked )
- : QGroupBox( (QWidget *) parent->widgetRep() )
+ : Q3GroupBox( (QWidget *) parent->widgetRep() )
, YCheckBox( parent, label )
{
setWidgetRep( this );
@@ -45,7 +45,7 @@
_qt_checkBox = new QCheckBox( fromUTF8( label ), this );
YUI_CHECK_NEW( _qt_checkBox );
-
+
layout->addSpacing( SPACING );
layout->addWidget( _qt_checkBox );
layout->addSpacing( SPACING );
@@ -66,11 +66,11 @@
YCheckBoxState
YQCheckBox::value()
{
- switch ( _qt_checkBox->state() )
+ switch ( _qt_checkBox->checkState() )
{
- case QButton::On: return YCheckBox_on;
- case QButton::Off: return YCheckBox_off;
- case QButton::NoChange: return YCheckBox_dont_care;
+ case Qt::Checked: return YCheckBox_on;
+ case Qt::Unchecked: return YCheckBox_off;
+ case Qt::PartiallyChecked: return YCheckBox_dont_care;
}
return YCheckBox_off;
@@ -112,7 +112,7 @@
_qt_checkBox->setFont( useBold ?
YQUI::yqApp()->boldFont() :
YQUI::yqApp()->currentFont() );
-
+
YCheckBox::setUseBoldFont( useBold );
}
@@ -154,7 +154,7 @@
void YQCheckBox::stateChanged( int newState )
{
// y2milestone( "new state: %d", newState );
-
+
if ( notify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
Modified: branches/tmp/coolo/qt4-port/src/YQCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQCheckBox.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQCheckBox.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQCheckBox.h Mon Nov 26 11:13:17 2007
@@ -20,18 +20,18 @@
#ifndef YQCheckBox_h
#define YQCheckBox_h
-#include
+#include <Q3GroupBox>
#include "YCheckBox.h"
class QCheckBox;
-class YQCheckBox : public QGroupBox, public YCheckBox
+class YQCheckBox : public Q3GroupBox, public YCheckBox
{
Q_OBJECT
public:
-
+
/**
* Constructor.
**/
@@ -56,7 +56,7 @@
* Reimplemented from YCheckBox.
**/
virtual YCheckBoxState value();
-
+
/**
* Set the CheckBox value (on/off/don't care).
*
@@ -113,7 +113,7 @@
**/
virtual bool setKeyboardFocus();
-
+
private slots:
/**
@@ -121,9 +121,9 @@
**/
void stateChanged ( int newState );
-
+
protected:
-
+
QCheckBox * _qt_checkBox;
};
Modified: branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.cc Mon Nov 26 11:13:17 2007
@@ -20,6 +20,10 @@
#define y2log_component "qt-ui"
#include
#include
+//Added by qt3to4:
+#include
+#include <Q3GroupBox>
+#include
#include "YQUI.h"
#include "YEvent.h"
#include "utf8.h"
@@ -41,7 +45,7 @@
QGroupBox::setTitle( fromUTF8( label ) );
QGroupBox::setCheckable( true );
preventQGroupBoxAutoEnablement();
-
+
setValue( checked );
}
@@ -72,15 +76,15 @@
{
if ( enabled )
{
- QFrame::setEnabled( true );
+ QGroupBox::setEnabled( true );
handleChildrenEnablement( value() );
}
else
{
- QFrame::setEnabled( true );
+ QGroupBox::setEnabled( true );
YWidget::setChildrenEnabled( false );
}
-
+
YWidget::setEnabled( enabled );
}
@@ -158,13 +162,16 @@
if ( hasChildren() )
{
+#warning possibly this hack is not needed
+ /*
int newChildWidth = max ( 0, newWidth - 2 * frameWidth() - 1 );
int newChildHeight = max ( 0, newHeight - frameWidth() - fontMetrics().height() - TOP_MARGIN - 1 );
firstChild()->setSize( newChildWidth, newChildHeight );
-
+
QWidget * qChild = (QWidget *) firstChild()->widgetRep();
qChild->move( frameWidth(), fontMetrics().height() + TOP_MARGIN );
+ */
}
}
@@ -176,7 +183,7 @@
preferredWidth = max( childPreferredWidth,
(10 + fontMetrics().width( title() ) ) );
- preferredWidth += 2*frameWidth() + 1;
+ // preferredWidth += 2*frameWidth() + 1;
return preferredWidth;
}
@@ -185,15 +192,15 @@
int YQCheckBoxFrame::preferredHeight()
{
int preferredHeight = hasChildren() ? firstChild()->preferredHeight() : 0;
- preferredHeight += frameWidth() + fontMetrics().height() + TOP_MARGIN + 1;
-
+ // preferredHeight += frameWidth() + fontMetrics().height() + TOP_MARGIN + 1;
+
return preferredHeight;
}
bool YQCheckBoxFrame::setKeyboardFocus()
{
- QGroupBox::setFocus();
+ setFocus();
return true;
}
Modified: branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQCheckBoxFrame.h Mon Nov 26 11:13:17 2007
@@ -96,7 +96,7 @@
**/
virtual bool setKeyboardFocus();
-
+
private slots:
/**
Modified: branches/tmp/coolo/qt4-port/src/YQComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQComboBox.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQComboBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQComboBox.cc Mon Nov 26 11:13:17 2007
@@ -34,26 +34,31 @@
#include "YQComboBox.h"
#include "YQSignalBlocker.h"
#include "YQWidgetCaption.h"
-
+#include <QVBoxLayout>
YQComboBox::YQComboBox( YWidget * parent,
const string & label,
bool editable )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YComboBox( parent, label, editable )
, _validator(0)
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
+ layout->addWidget( _caption );
+
_qt_comboBox = new QComboBox( editable, this );
YUI_CHECK_NEW( _caption );
-
+ layout->addWidget( _qt_comboBox );
+
_caption->setBuddy( _qt_comboBox );
#if SEND_SELECTION_CHANGED_EVENT
@@ -102,7 +107,7 @@
{
YComboBox::addItem( item );
QPixmap icon;
-
+
if ( item->hasIconName() )
{
string iconName = iconFullPath( item );
@@ -128,7 +133,7 @@
void YQComboBox::deleteAllItems()
{
YQSignalBlocker sigBlocker( _qt_comboBox );
-
+
_qt_comboBox->clear();
YComboBox::deleteAllItems();
}
Modified: branches/tmp/coolo/qt4-port/src/YQComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQComboBox.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQComboBox.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQComboBox.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQComboBox_h
#define YQComboBox_h
-#include
+#include <QFrame>
#include "YComboBox.h"
class YQWidgetCaption;
@@ -28,7 +28,7 @@
class QY2CharValidator;
-class YQComboBox : public QVBox, public YComboBox
+class YQComboBox : public QFrame, public YComboBox
{
Q_OBJECT
@@ -81,7 +81,7 @@
/**
* Returns 'true' if the given text is valid according to the current
- * setting of ValidChars.
+ * setting of ValidChars.
**/
bool isValidText( const QString & txt ) const;
@@ -134,9 +134,9 @@
**/
void textChanged( const QString &new_text );
-
+
protected:
-
+
/**
* Return this ComboBox's current value as text.
*
Modified: branches/tmp/coolo/qt4-port/src/YQDateField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDateField.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDateField.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDateField.cc Mon Nov 26 11:13:17 2007
@@ -21,6 +21,8 @@
#include
#include
+#include
+#include <QVBoxLayout>
#include "utf8.h"
#include "YQUI.h"
@@ -29,21 +31,26 @@
YQDateField::YQDateField( YWidget * parent, const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YDateField( parent, label )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, fromUTF8( label ) );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
- _qt_dateEdit = new QDateEdit( this );
+ _qt_dateEdit = new Q3DateEdit( this );
YUI_CHECK_NEW( _qt_dateEdit );
+ layout->addWidget( _qt_dateEdit );
- _qt_dateEdit->setAutoAdvance( true );
- _qt_dateEdit->setOrder( QDateEdit::DMY );
+ //_qt_dateEdit->setAutoAdvance( true );
+ _qt_dateEdit->setOrder( Q3DateEdit::DMY );
_caption->setBuddy( _qt_dateEdit );
}
@@ -76,7 +83,7 @@
void YQDateField::setEnabled( bool enabled )
{
- QVBox::setEnabled( enabled );
+ QFrame::setEnabled( enabled );
YWidget::setEnabled( enabled );
}
Modified: branches/tmp/coolo/qt4-port/src/YQDateField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDateField.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDateField.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDateField.h Mon Nov 26 11:13:17 2007
@@ -20,14 +20,14 @@
#ifndef YQDateField_h
#define YQDateField_h
-#include
+#include <QFrame>
#include "YDateField.h"
-class QDateEdit;
+class Q3DateEdit;
class YQWidgetCaption;
-class YQDateField : public QVBox, public YDateField
+class YQDateField : public QFrame, public YDateField
{
Q_OBJECT
@@ -106,7 +106,7 @@
protected:
YQWidgetCaption * _caption;
- QDateEdit * _qt_dateEdit;
+ Q3DateEdit * _qt_dateEdit;
};
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.cc Mon Nov 26 11:13:17 2007
@@ -24,6 +24,7 @@
#include
#include
#include
+#include <QDesktopWidget>
#include "YQUI.h"
#include "YQi18n.h"
@@ -43,24 +44,25 @@
QWidget * qt_parent,
bool default_size )
: QWidget( qt_parent,
- 0, // name
- default_size ? 0 : WStyle_Customize | WStyle_DialogBorder | WType_Modal | WStyle_Dialog ) // WFlags
+ default_size ? Qt::Widget : Qt::Window ) // WFlags
, YDialog( opt )
{
_userResized = false;
_focusButton = 0;
_defaultButton = 0;
-
setWidgetRep( this );
setCaption( hasDefaultSize() ? "YaST2" : "" );
- setFocusPolicy( QWidget::StrongFocus );
+ setFocusPolicy( Qt::StrongFocus );
+
+ if ( ! default_size )
+ setWindowModality( Qt::WindowModal );
if ( hasWarnColor() || hasInfoColor() )
{
QColor normalBackground ( 0, 128, 0 );
QColor inputFieldBackground ( 0, 96, 0 );
- QColor text = white;
+ QColor text = Qt::white;
if ( hasInfoColor() )
{
@@ -75,7 +77,7 @@
setPalette( warnPalette );
}
- _qFrame = new QFrame ( this );
+ _qFrame = new Q3Frame ( this );
bool decorate = ! hasDefaultSize() && ! YQUI::ui()->haveWM();
#if 0
@@ -84,20 +86,20 @@
// None of this works (yet). :-((
clearWFlags( getWFlags() );
- setWFlags( WStyle_Customize | WStyle_DialogBorder | WStyle_StaysOnTop );
+ setWFlags( Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_StaysOnTop );
// decorate = true;
}
#endif
if ( decorate )
{
- _qFrame->setFrameStyle ( QFrame::Box | QFrame::Raised );
+ _qFrame->setFrameStyle ( Q3Frame::Box | Q3Frame::Raised );
_qFrame->setLineWidth(2);
_qFrame->setMidLineWidth(3);
}
else
{
- _qFrame->setFrameStyle ( QFrame::NoFrame );
+ _qFrame->setFrameStyle ( Q3Frame::NoFrame );
}
}
@@ -637,7 +639,7 @@
// button mechanism to work. So let's accept the focus and give it to some
// child widget.
- if ( event->reason() == QFocusEvent::Tab )
+ if ( event->reason() == Qt::TabFocusReason )
{
focusNextPrevChild( true );
}
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.h Mon Nov 26 11:13:17 2007
@@ -20,13 +20,15 @@
#ifndef YQDialog_h
#define YQDialog_h
+#include
+#include
#include
#include "YDialog.h"
class YQGenericButton;
class YQWizard;
-class QFrame;
+class Q3Frame;
class YQDialog : public QWidget, public YDialog
@@ -228,7 +230,7 @@
// Data members
//
- QFrame * _qFrame;
+ Q3Frame * _qFrame;
bool _userResized;
QSize _userSize;
Modified: branches/tmp/coolo/qt4-port/src/YQDownloadProgress.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDownloadProgress.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDownloadProgress.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDownloadProgress.cc Mon Nov 26 11:13:17 2007
@@ -18,7 +18,7 @@
#include
-#include
+#include
#include
#define y2log_component "qt-ui"
#include
@@ -27,27 +27,33 @@
#include "YQUI.h"
#include "YQDownloadProgress.h"
#include "YQWidgetCaption.h"
-
+#include <QVBoxLayout>
+#include <QProgressBar>
YQDownloadProgress::YQDownloadProgress( YWidget * parent,
const string & label,
const string & filename,
YFileSize_t expectedSize )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YDownloadProgress( parent, label, filename, expectedSize )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setMargin( YQWidgetMargin );
+ layout->setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
_qt_progressBar = new QProgressBar( this );
YUI_CHECK_NEW( _qt_progressBar );
+ layout->addWidget( _qt_progressBar );
_qt_progressBar->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
- _qt_progressBar->setTotalSteps( 100 ); // Using percent
- _qt_progressBar->setProgress( currentPercent() );
+ _qt_progressBar->setRange( 0, 100 ); // Using percent
+ _qt_progressBar->setValue( currentPercent() );
_timer = new QTimer( this );
@@ -77,14 +83,14 @@
YQDownloadProgress::setFilename( const string & filename )
{
YDownloadProgress::setFilename( filename );
- _qt_progressBar->setProgress( currentPercent() );
+ _qt_progressBar->setValue( currentPercent() );
}
void
YQDownloadProgress::setExpectedSize( YFileSize_t expectedSize )
{
- _qt_progressBar->setProgress( currentPercent() );
+ _qt_progressBar->setValue( currentPercent() );
YDownloadProgress::setExpectedSize( expectedSize );
}
@@ -92,7 +98,7 @@
void
YQDownloadProgress::pollFileSize()
{
- _qt_progressBar->setProgress( currentPercent() );
+ _qt_progressBar->setValue( currentPercent() );
}
Modified: branches/tmp/coolo/qt4-port/src/YQDownloadProgress.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDownloadProgress.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDownloadProgress.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDownloadProgress.h Mon Nov 26 11:13:17 2007
@@ -20,14 +20,14 @@
#ifndef YQDownloadProgress_h
#define YQDownloadProgress_h
-#include
+#include <QFrame>
#include "YDownloadProgress.h"
class YQWidgetCaption;
class QProgressBar;
-class YQDownloadProgress : public QVBox, public YDownloadProgress
+class YQDownloadProgress : public QFrame, public YDownloadProgress
{
Q_OBJECT
@@ -48,7 +48,7 @@
/**
* Set the label (the text above the progress bar).
- *
+ *
* Reimplemented from YDownloadProgress.
**/
virtual void setLabel( const string & label );
@@ -59,7 +59,7 @@
* Reimplemented from YDownloadProgress.
**/
virtual void setFilename( const string & filename );
-
+
/**
* Change the expected file size.
*
Modified: branches/tmp/coolo/qt4-port/src/YQDumbTab.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDumbTab.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDumbTab.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDumbTab.cc Mon Nov 26 11:13:17 2007
@@ -49,11 +49,11 @@
//
_tabBar = new QTabBar( this );
- CHECK_PTR( _tabBar );
+ Q_CHECK_PTR( _tabBar );
_tabBar->setSizePolicy( QSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ) ); // hor/vert
setFocusProxy( _tabBar );
- setFocusPolicy( TabFocus );
+ setFocusPolicy( Qt::TabFocus );
connect( _tabBar, SIGNAL( selected ( int ) ),
this, SLOT ( slotSelected( int ) ) );
@@ -71,17 +71,14 @@
{
YQSignalBlocker sigBlocker( _tabBar );
YDumbTab::addItem( item );
-
- QTab * tab = new QTab( fromUTF8( item->label() ) );
- YUI_CHECK_NEW( tab );
- y2debug( "Adding tab page [%s]", item->label().c_str() );
- tab->setIdentifier( item->index() );
- _tabBar->addTab( tab );
- item->setData( tab );
+ _tabBar->insertTab( item->index(), fromUTF8( item->label() ) );
+ y2debug( "Adding tab page [%s]", item->label().c_str() );
+#warning YItem::setData
+ // item->setData( tab );
if ( item->selected() )
- _tabBar->setCurrentTab( tab );
+ _tabBar->setCurrentIndex( item->index() );
}
@@ -92,13 +89,10 @@
{
// Don't try to suppress any signals sent here with a YQSignalBlocker,
// otherwise the application code that handles the event will never be executed.
-
- QTab * tab = (QTab *) item->data();
- if ( tab )
- _tabBar->setCurrentTab( tab );
+ _tabBar->setCurrentIndex( item->index() );
}
-
+
YDumbTab::selectItem( item, selected );
}
@@ -110,12 +104,9 @@
it != itemsEnd();
++it )
{
- QTab * tab = (QTab *) (*it)->data();
-
- if ( tab )
- _tabBar->removeTab( tab );
+ _tabBar->removeTab( ( *it )->index() );
}
-
+
YDumbTab::deleteAllItems();
}
@@ -152,7 +143,7 @@
{
int tabBarWidth = _tabBar->sizeHint().width();
int childWidth = hasChildren() ? firstChild()->preferredWidth() : 0;
-
+
return max( tabBarWidth, childWidth );
}
@@ -162,7 +153,7 @@
{
int tabBarHeight = _tabBar->sizeHint().height();
int childHeight = hasChildren() ? firstChild()->preferredHeight() : 0;
-
+
return tabBarHeight + YQDumbTabSpacing + childHeight;
}
@@ -198,12 +189,12 @@
//
// _tabBar (fixed height)
//
-
+
int tabBarHeight = _tabBar->sizeHint().height();
if ( remainingHeight < tabBarHeight )
tabBarHeight = remainingHeight;
-
+
_tabBar->resize( newWidth, tabBarHeight );
remainingHeight -= tabBarHeight;
@@ -212,22 +203,22 @@
//
// Spacing between tabBar and client area
//
-
+
remainingHeight -= YQDumbTabSpacing;
y_offset = newHeight - remainingHeight;
//
// 3D border
//
-
+
remainingHeight -= 2 * YQDumbTabFrameMargin;
remainingWidth -= 2 * YQDumbTabFrameMargin;
x_offset += YQDumbTabFrameMargin;
y_offset += YQDumbTabFrameMargin;
- if ( remainingHeight < 0 )
+ if ( remainingHeight < 0 )
remainingHeight = 0;
-
+
if ( remainingWidth < 0 )
remainingWidth = 0;
@@ -235,7 +226,7 @@
// Client area
//
-
+
firstChild()->setSize( remainingWidth, remainingHeight );
QWidget * qChild = (QWidget *) firstChild()->widgetRep();
Modified: branches/tmp/coolo/qt4-port/src/YQFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQFrame.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQFrame.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQFrame.cc Mon Nov 26 11:13:17 2007
@@ -21,6 +21,8 @@
#include
#include "YQUI.h"
#include "utf8.h"
+//Added by qt3to4:
+#include
using std::max;
@@ -29,7 +31,7 @@
YQFrame::YQFrame( YWidget * parent,
const string & initialLabel )
- : QGroupBox( (QWidget *) parent->widgetRep() )
+ : Q3GroupBox( (QWidget *) parent->widgetRep() )
, YFrame( parent, initialLabel )
{
setWidgetRep ( this );
Modified: branches/tmp/coolo/qt4-port/src/YQFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQFrame.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQFrame.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQFrame.h Mon Nov 26 11:13:17 2007
@@ -20,13 +20,13 @@
#ifndef YQFrame_h
#define YQFrame_h
-#include
+#include
#include "YFrame.h"
class QWidget;
-class YQFrame : public QGroupBox, public YFrame
+class YQFrame : public Q3GroupBox, public YFrame
{
Q_OBJECT
Modified: branches/tmp/coolo/qt4-port/src/YQGenericButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQGenericButton.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQGenericButton.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQGenericButton.cc Mon Nov 26 11:13:17 2007
@@ -20,6 +20,9 @@
#include
#include
#include
+//Added by qt3to4:
+#include
+#include
#define y2log_component "qt-ui"
#include
@@ -127,7 +130,7 @@
if ( qIconName.isEmpty() )
{
- _qPushButton->setIconSet( QIconSet() );
+ _qPushButton->setIconSet( QIcon() );
return;
}
Modified: branches/tmp/coolo/qt4-port/src/YQIconPool.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQIconPool.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQIconPool.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQIconPool.cc Mon Nov 26 11:13:17 2007
@@ -64,6 +64,8 @@
#include "icons/step_current.xpm"
#include "icons/step_todo.xpm"
#include "icons/step_done.xpm"
+//Added by qt3to4:
+#include
YQIconPool * YQIconPool::_iconPool = 0;
Modified: branches/tmp/coolo/qt4-port/src/YQIconPool.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQIconPool.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQIconPool.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQIconPool.h Mon Nov 26 11:13:17 2007
@@ -21,7 +21,7 @@
#define YQIconPool_h
#include
-#include
+#include
class YQIconPool
{
@@ -109,7 +109,7 @@
//
static YQIconPool * _iconPool;
- QPtrDict<QPixmap> _iconCache;
+ Q3PtrDict<QPixmap> _iconCache;
};
Modified: branches/tmp/coolo/qt4-port/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQImage.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQImage.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQImage.cc Mon Nov 26 11:13:17 2007
@@ -20,6 +20,8 @@
#include
#include
#include
+//Added by qt3to4:
+#include
#define y2log_component "qt-ui"
#include
@@ -67,7 +69,7 @@
else
{
y2debug( "Loading animation from %s", imageFileName().c_str() );
- QLabel::setMovie( movie );
+ QLabel::setMovie( &movie );
}
}
else
Modified: branches/tmp/coolo/qt4-port/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQInputField.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQInputField.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQInputField.cc Mon Nov 26 11:13:17 2007
@@ -33,6 +33,7 @@
#include "YQi18n.h"
#include "YQSignalBlocker.h"
#include "YQWidgetCaption.h"
+#include <QVBoxLayout>
// Include low-level X headers AFTER Qt headers:
// X.h pollutes the global namespace (!!!) with pretty useless #defines
@@ -48,21 +49,26 @@
YQInputField::YQInputField( YWidget * parent,
const string & label,
bool passwordMode )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YInputField( parent, label, passwordMode )
, _validator(0)
, _displayingCapsLockWarning( false )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
+ layout->addWidget( _caption );
+
_qt_lineEdit = new YQRawLineEdit( this );
YUI_CHECK_NEW( _qt_lineEdit );
+ layout->addWidget( _qt_lineEdit );
_caption->setBuddy( _qt_lineEdit );
Modified: branches/tmp/coolo/qt4-port/src/YQInputField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQInputField.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQInputField.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQInputField.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQInputField_h
#define YQInputField_h
-#include
+#include <QFrame>
#include
#include "YInputField.h"
@@ -33,7 +33,7 @@
using std::string;
-class YQInputField : public QVBox, public YInputField
+class YQInputField : public QFrame, public YInputField
{
Q_OBJECT
Modified: branches/tmp/coolo/qt4-port/src/YQIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQIntField.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQIntField.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQIntField.cc Mon Nov 26 11:13:17 2007
@@ -28,28 +28,34 @@
#include "YQIntField.h"
#include "YQSignalBlocker.h"
#include "YQWidgetCaption.h"
-
+#include <QVBoxLayout>
YQIntField::YQIntField( YWidget * parent,
const string & label,
int minValue,
int maxValue,
int initialValue )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YIntField( parent, label, minValue, maxValue )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
_qt_spinBox = new QSpinBox( minValue, maxValue,
1, // step
this );
YUI_CHECK_NEW( _qt_spinBox );
+ layout->addWidget( _qt_spinBox );
+
_qt_spinBox->setValue( initialValue );
_caption->setBuddy( _qt_spinBox );
Modified: branches/tmp/coolo/qt4-port/src/YQIntField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQIntField.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQIntField.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQIntField.h Mon Nov 26 11:13:17 2007
@@ -21,7 +21,7 @@
#define YQIntField_h
#include
-#include
+#include <QFrame>
#include "YIntField.h"
@@ -30,7 +30,7 @@
class QSpinBox;
-class YQIntField : public QVBox, public YIntField
+class YQIntField : public QFrame, public YIntField
{
Q_OBJECT
@@ -113,7 +113,7 @@
**/
virtual bool setKeyboardFocus();
-
+
signals:
/**
Modified: branches/tmp/coolo/qt4-port/src/YQLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQLabel.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQLabel.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQLabel.cc Mon Nov 26 11:13:17 2007
@@ -24,6 +24,9 @@
#include "YQUI.h"
#include "YQApplication.h"
#include "YQLabel.h"
+//Added by qt3to4:
+#include
+#include
YQLabel::YQLabel( YWidget * parent,
@@ -35,7 +38,7 @@
{
setWidgetRep( this );
- setTextFormat( QLabel::PlainText );
+ setTextFormat( Qt::PlainText );
QLabel::setText( fromUTF8( text ) );
setIndent(0);
@@ -51,7 +54,7 @@
}
setMargin( YQWidgetMargin );
- setAlignment( AlignLeft | AlignTop );
+ setAlignment( Qt::AlignLeft | Qt::AlignTop );
}
Modified: branches/tmp/coolo/qt4-port/src/YQLogView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQLogView.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQLogView.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQLogView.cc Mon Nov 26 11:13:17 2007
@@ -19,7 +19,8 @@
#include
#include
-#include
+#include
+#include <QVBoxLayout>
#define y2log_component "qt-ui"
#include
@@ -35,19 +36,23 @@
const string & label,
int visibleLines,
int maxLines )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YLogView( parent, label, visibleLines, maxLines )
{
setWidgetRep( this );
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
- setSpacing( YQWidgetSpacing );
- setMargin( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
- _qt_text = new QMultiLineEdit( this );
+ _qt_text = new Q3MultiLineEdit( this );
YUI_CHECK_NEW( _qt_text );
+ layout->addWidget( _qt_text );
_qt_text->setReadOnly( true );
_qt_text->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
@@ -99,7 +104,7 @@
YQLogView::preferredHeight()
{
int hintHeight = visibleLines() * _qt_text->fontMetrics().lineSpacing();
- hintHeight += _qt_text->style().scrollBarExtent().height();
+ hintHeight += _qt_text->style()->pixelMetric( QStyle::PM_ScrollBarExtent );
hintHeight += _qt_text->frameWidth() * 2;
if ( _caption->isShown() )
Modified: branches/tmp/coolo/qt4-port/src/YQLogView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQLogView.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQLogView.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQLogView.h Mon Nov 26 11:13:17 2007
@@ -20,20 +20,20 @@
#ifndef YQLogView_h
#define YQLogView_h
-#include
+#include <QFrame>
#include "YLogView.h"
class YQWidgetCaption;
-class QMultiLineEdit;
+class Q3MultiLineEdit;
-class YQLogView : public QVBox, public YLogView
+class YQLogView : public QFrame, public YLogView
{
Q_OBJECT
-
+
public:
-
+
/**
* Constructor
**/
@@ -73,7 +73,7 @@
* Reimplemented from YWidget.
**/
virtual void setEnabled( bool enabled );
-
+
/**
* Preferred width of the widget.
*
@@ -104,7 +104,7 @@
protected:
YQWidgetCaption * _caption;
- QMultiLineEdit * _qt_text;
+ Q3MultiLineEdit * _qt_text;
};
Modified: branches/tmp/coolo/qt4-port/src/YQMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMenuButton.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMenuButton.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMenuButton.cc Mon Nov 26 11:13:17 2007
@@ -18,8 +18,7 @@
#include
-#include
-#include
+#include
#include
#include
#define y2log_component "qt-ui"
@@ -76,7 +75,7 @@
// Create toplevel menu
//
- QPopupMenu * menu = new QPopupMenu( _qt_button );
+ Q3PopupMenu * menu = new Q3PopupMenu( _qt_button );
YUI_CHECK_NEW( menu );
_qt_button->setPopup( menu );
@@ -92,7 +91,7 @@
void
-YQMenuButton::rebuildMenuTree( QPopupMenu * parentMenu, YItemIterator begin, YItemIterator end )
+YQMenuButton::rebuildMenuTree( Q3PopupMenu * parentMenu, YItemIterator begin, YItemIterator end )
{
for ( YItemIterator it = begin; it != end; ++it )
{
@@ -112,7 +111,7 @@
if ( item->hasChildren() )
{
- QPopupMenu * subMenu = new QPopupMenu( parentMenu );
+ Q3PopupMenu * subMenu = new Q3PopupMenu( parentMenu );
YUI_CHECK_NEW( subMenu );
if ( icon.isNull() )
@@ -128,7 +127,7 @@
else // No children - leaf entry
{
// item->index() is guaranteed to be unique within this YMenuButton's items,
- // so it can easily be used as unique ID in all QPopupMenus that belong
+ // so it can easily be used as unique ID in all Q3PopupMenus that belong
// to this YQMenuButton.
if ( icon.isNull() )
Modified: branches/tmp/coolo/qt4-port/src/YQMenuButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMenuButton.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMenuButton.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQMenuButton.h Mon Nov 26 11:13:17 2007
@@ -25,7 +25,7 @@
class QPushButton;
-class QPopupMenu;
+class Q3PopupMenu;
class YQMenuButton : public QWidget, public YMenuButton
{
@@ -110,7 +110,7 @@
/**
* Recursively insert menu items into 'menu' from iterator 'begin' to iterator 'end'.
**/
- void rebuildMenuTree( QPopupMenu * menu, YItemIterator begin, YItemIterator end );
+ void rebuildMenuTree( Q3PopupMenu * menu, YItemIterator begin, YItemIterator end );
//
Modified: branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.cc Mon Nov 26 11:13:17 2007
@@ -17,7 +17,9 @@
/-*/
-#include
+#include
+#include <QVBoxLayout>
+#include <QTextEdit>
#include
#define y2log_component "qt-ui"
#include
@@ -33,22 +35,27 @@
YQMultiLineEdit::YQMultiLineEdit( YWidget * parent, const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YMultiLineEdit( parent, label )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
+ layout->addWidget( _caption );
+
_qt_textEdit = new QTextEdit( this );
YUI_CHECK_NEW( _qt_textEdit );
-
+ layout->addWidget( _qt_textEdit );
+
_qt_textEdit->setTextFormat( Qt::PlainText );
_qt_textEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
-
+
_caption->setBuddy( _qt_textEdit );
connect( _qt_textEdit, SIGNAL( textChanged( void ) ),
@@ -71,7 +78,7 @@
void YQMultiLineEdit::setValue( const string & text )
{
YQSignalBlocker sigBlocker( _qt_textEdit );
-
+
_qt_textEdit->setText( fromUTF8( text ) );
}
@@ -99,6 +106,7 @@
void YQMultiLineEdit::enforceMaxInputLength()
{
+#if FIXME
if ( inputMaxLength() >= 0 && _qt_textEdit->length() > inputMaxLength() )
{
int index;
@@ -111,7 +119,7 @@
int pos = 0; // current positon in text
int section =0; // section in text;
// iterate over the string
-
+
while ( pos != (int) text.length()+1 )
{
// we reached the paragraph where the user entered
@@ -143,6 +151,7 @@
// adjust to new cursor position before the removed character
_qt_textEdit->setCursorPosition( para, index-1 );
}
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiLineEdit.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQMultiLineEdit_h
#define YQMultiLineEdit_h
-#include
+#include <QFrame>
#include "YMultiLineEdit.h"
class YQWidgetCaption;
@@ -30,7 +30,7 @@
/**
* MultiLineEdit - an input area for multi-line text.
**/
-class YQMultiLineEdit : public QVBox, public YMultiLineEdit
+class YQMultiLineEdit : public QFrame, public YMultiLineEdit
{
Q_OBJECT
@@ -67,7 +67,7 @@
* Reimplemented from YMultiLineEdit.
**/
virtual void setLabel( const string & label );
-
+
/**
* Set the maximum input length, i.e., the maximum number of characters the
* user can enter. -1 means no limit.
@@ -75,7 +75,7 @@
* Reimplemented from YMultiLineEdit.
**/
virtual void setInputMaxLength( int numberOfChars );
-
+
/**
* Set enabled/disabled state.
*
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.cc Mon Nov 26 11:13:17 2007
@@ -21,6 +21,10 @@
#include
#include
+//Added by qt3to4:
+#include
+#include
+#include
#include "YQUI.h"
#include "YQMultiProgressMeter.h"
@@ -254,7 +258,7 @@
{
if ( fillStart < length )
{
- QPointArray points( 4 );
+ Q3PointArray points( 4 );
int p=0;
points.setPoint( p++, offset + fillStart, border + fillHeight );
@@ -263,7 +267,7 @@
points.setPoint( p++, offset + length, border + indent );
painter.setBrush( palette().active().highlight() );
- painter.setPen( NoPen );
+ painter.setPen( Qt::NoPen );
painter.drawConvexPolygon( points );
}
}
@@ -271,7 +275,7 @@
{
if ( fillStart > 0 )
{
- QPointArray points( 4 );
+ Q3PointArray points( 4 );
int p=0;
points.setPoint( p++, offset, border + thickness );
@@ -280,7 +284,7 @@
points.setPoint( p++, offset + fillStart, border + thickness - fillHeight );
painter.setBrush( palette().active().highlight() );
- painter.setPen( NoPen );
+ painter.setPen( Qt::NoPen );
painter.drawConvexPolygon( points );
}
}
@@ -296,7 +300,7 @@
// Draw arrow base (left)
painter.setPen( dark );
- painter.setPen( SolidLine );
+ painter.setPen( Qt::SolidLine );
painter.drawLine( offset, border,
offset, border + thickness );
@@ -329,7 +333,7 @@
const QColor & color = palette().active().foreground();
painter.setPen( color );
- painter.setPen( SolidLine );
+ painter.setPen( Qt::SolidLine );
painter.setBrush( color );
// painter.setBrush( NoBrush );
@@ -337,7 +341,7 @@
// Draw upper marker triangle
int tri = triThickness();
- QPointArray points( 3 );
+ Q3PointArray points( 3 );
int p=0;
points.setPoint( p++, offset - tri+1, margin() ); // top left (base)
Modified: branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiProgressMeter.h Mon Nov 26 11:13:17 2007
@@ -24,6 +24,9 @@
#include "YMultiProgressMeter.h"
#include
#include
+//Added by qt3to4:
+#include
+#include
class QPaintEvent;
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.cc Mon Nov 26 11:13:17 2007
@@ -20,7 +20,8 @@
#include
#include
#include
-#include
+#include <QVBoxLayout>
+#include
#define y2log_component "qt-ui"
#include
@@ -39,20 +40,25 @@
YQMultiSelectionBox::YQMultiSelectionBox( YWidget * parent,
const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YMultiSelectionBox( parent, label )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
- _qt_listView = new QListView( this );
+ layout->addWidget( _caption );
+
+ _qt_listView = new Q3ListView( 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 );
@@ -96,13 +102,13 @@
YUI_CHECK_NEW( msbItem );
// Take care of the item's check box
-
+
if ( yItem->selected() )
msbItem->setOn( true );
-
+
// Take care of the QListView's keyboard focus
-
+
if ( ! _qt_listView->selectedItem() )
_qt_listView->setSelected( msbItem, true );
}
@@ -123,8 +129,8 @@
{
YQSignalBlocker sigBlocker( _qt_listView );
YMultiSelectionBox::deselectAllItems();
-
- QListViewItemIterator it( _qt_listView );
+
+ Q3ListViewItemIterator it( _qt_listView );
while ( *it )
{
@@ -172,8 +178,8 @@
//
// For the purpose of this function, QListView::currentItem() is the
// minimum requirement.
-
- QListViewItem * currentQItem = _qt_listView->currentItem();
+
+ Q3ListViewItem * currentQItem = _qt_listView->currentItem();
if ( currentQItem )
{
@@ -195,7 +201,7 @@
//
// This function uses QListView::selectedItem() for better visibility.
// This implicitly also changes QListView::currentItem().
-
+
YQSignalBlocker sigBlocker( _qt_listView );
if ( ! yItem )
@@ -295,8 +301,8 @@
YQMultiSelectionBox::findItem( YItem * wantedItem )
{
// FIXME: Don't search through all items, use the YItem::data() pointer instead
-
- QListViewItemIterator it( _qt_listView );
+
+ Q3ListViewItemIterator it( _qt_listView );
while ( *it )
{
@@ -320,9 +326,9 @@
YQMultiSelectionBoxItem::YQMultiSelectionBoxItem( YQMultiSelectionBox * parent,
- QListView * listView,
+ Q3ListView * listView,
YItem * yItem )
- : QCheckListItem( listView, fromUTF8( yItem->label() ), QCheckListItem::CheckBox )
+ : Q3CheckListItem( listView, fromUTF8( yItem->label() ), Q3CheckListItem::CheckBox )
, _yItem( yItem )
, _multiSelectionBox( parent )
{
@@ -337,7 +343,7 @@
{
_yItem->setSelected( newState );
_multiSelectionBox->sendValueChanged();
- QCheckListItem::stateChange( newState );
+ 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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQMultiSelectionBox.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,8 @@
#ifndef YQMultiSelectionBox_h
#define YQMultiSelectionBox_h
-#include
+#include <QFrame>
+#include <Q3CheckListItem>
#include
#include "YMultiSelectionBox.h"
@@ -29,7 +30,7 @@
class YQMultiSelectionBoxItem;
-class YQMultiSelectionBox : public QVBox, public YMultiSelectionBox
+class YQMultiSelectionBox : public QFrame, public YMultiSelectionBox
{
Q_OBJECT
@@ -44,7 +45,7 @@
* Destructor.
**/
~YQMultiSelectionBox();
-
+
/**
* Change the label text.
*
@@ -53,7 +54,7 @@
virtual void setLabel( const string & label );
/**
- * Add an item.
+ * Add an item.
*
* Reimplemented from YSelectionWidget.
**/
@@ -79,7 +80,7 @@
* Reimplemented from YSelectionWidget.
**/
virtual void deleteAllItems();
-
+
/**
* Return the the item that currently has the keyboard focus
* or 0 if no item currently has the keyboard focus.
@@ -140,41 +141,41 @@
* Emitted upon when an item changes its state.
**/
void valueChanged();
-
+
protected slots:
/**
* Send SelectionChanged event if `opt(`notify) is set.
**/
void slotSelected();
-
+
/**
* Send ValueChanged event if `opt(`notify) is set.
**/
void slotValueChanged();
-
+
protected:
/**
* Find the counterpart of 'item'. Return 0 if there is none.
**/
YQMultiSelectionBoxItem * findItem( YItem * item );
-
+
YQWidgetCaption * _caption;
- QListView * _qt_listView;
+ Q3ListView * _qt_listView;
};
-class YQMultiSelectionBoxItem: public QCheckListItem
+class YQMultiSelectionBoxItem: public Q3CheckListItem
{
public:
/**
* Constructor.
**/
YQMultiSelectionBoxItem( YQMultiSelectionBox * parent,
- QListView * listView,
+ Q3ListView * listView,
YItem * yItem );
/**
@@ -187,7 +188,7 @@
**/
YItem * yItem() const { return _yItem; }
-
+
protected:
/**
@@ -202,8 +203,8 @@
* Returns the sort key for any column.
* In this case, maintain item creation order.
*
- * Reimplemented from QListViewItem.
- **/
+ * Reimplemented from Q3ListViewItem.
+ **/
virtual QString key ( int column,
bool ascending ) const;
@@ -214,7 +215,7 @@
YItem * _yItem;
int _serial;
YQMultiSelectionBox * _multiSelectionBox;
-
+
/**
* The next serial number to use
Modified: branches/tmp/coolo/qt4-port/src/YQProgressBar.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQProgressBar.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQProgressBar.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQProgressBar.cc Mon Nov 26 11:13:17 2007
@@ -18,6 +18,8 @@
#include
+#include <QVBoxLayout>
+
#include
#define y2log_component "qt-ui"
#include
@@ -33,20 +35,26 @@
YQProgressBar::YQProgressBar( YWidget * parent,
const string & label,
int maxValue )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YProgressBar( parent, label, maxValue )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
- _qt_progressbar = new QProgressBar( maxValue, this );
+ _qt_progressbar = new QProgressBar( this );
+ _qt_progressbar->setRange(0, maxValue);
YUI_CHECK_NEW( _qt_progressbar );
-
+ layout->addWidget( _qt_progressbar );
+
_caption->setBuddy( _qt_progressbar );
}
@@ -67,7 +75,7 @@
void YQProgressBar::setValue( int newValue )
{
YProgressBar::setValue( newValue );
- _qt_progressbar->setProgress( value() );
+ _qt_progressbar->setValue( value() );
}
@@ -83,7 +91,7 @@
int YQProgressBar::preferredWidth()
{
int hintWidth = _caption->isShown() ?
- _caption->sizeHint().width() + margin() : 0;
+ _caption->sizeHint().width() + layout()->margin() : 0;
return max( 200, hintWidth );
}
Modified: branches/tmp/coolo/qt4-port/src/YQProgressBar.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQProgressBar.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQProgressBar.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQProgressBar.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQProgressBar_h
#define YQProgressBar_h
-#include
+#include <QFrame>
#include "YProgressBar.h"
@@ -28,7 +28,7 @@
class YQWidgetCaption;
class QProgressBar;
-class YQProgressBar : public QVBox, public YProgressBar
+class YQProgressBar : public QFrame, public YProgressBar
{
Q_OBJECT
@@ -43,7 +43,7 @@
* Destructor.
**/
virtual ~YQProgressBar();
-
+
/**
* Set the label (the caption above the progress bar).
*
@@ -57,7 +57,7 @@
* Reimplemented from YProgressBar.
**/
virtual void setValue( int newValue );
-
+
/**
* Set enabled/disabled state.
*
@@ -91,7 +91,7 @@
**/
virtual bool setKeyboardFocus();
-
+
protected:
YQWidgetCaption * _caption;
Modified: branches/tmp/coolo/qt4-port/src/YQPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQPushButton.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQPushButton.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQPushButton.cc Mon Nov 26 11:13:17 2007
@@ -35,7 +35,7 @@
setWidgetRep( this );
QPushButton * button = new QPushButton( fromUTF8( label ), this );
- CHECK_PTR( button );
+ Q_CHECK_PTR( button );
setQPushButton( button );
Modified: branches/tmp/coolo/qt4-port/src/YQRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButton.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRadioButton.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQRadioButton.cc Mon Nov 26 11:13:17 2007
@@ -18,7 +18,8 @@
#include
-#include
+#include <QMouseEvent>
+#include
#define y2log_component "qt-ui"
#include
@@ -44,7 +45,7 @@
YQRadioButton::YQRadioButton( YWidget * parent,
const string & label,
bool checked )
- : QGroupBox( (QWidget *) (parent->widgetRep() ) )
+ : Q3GroupBox( (QWidget *) (parent->widgetRep() ) )
, YRadioButton( parent, label )
{
setWidgetRep( this );
Modified: branches/tmp/coolo/qt4-port/src/YQRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButton.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRadioButton.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQRadioButton.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQRadioButton_h
#define YQRadioButton_h
-#include
+#include
#include "YRadioButton.h"
@@ -29,7 +29,7 @@
using std::string;
-class YQRadioButton : public QGroupBox, public YRadioButton
+class YQRadioButton : public Q3GroupBox, public YRadioButton
{
Q_OBJECT
Modified: branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.cc Mon Nov 26 11:13:17 2007
@@ -18,7 +18,7 @@
#include
-#include
+#include
#define y2log_component "qt-ui"
#include
Modified: branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQRadioButtonGroup.h Mon Nov 26 11:13:17 2007
@@ -22,7 +22,7 @@
#include
#include "YRadioButtonGroup.h"
-class QButtonGroup;
+class Q3ButtonGroup;
class YQRadioButtonGroup : public QWidget, public YRadioButtonGroup
{
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRichText.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQRichText.cc Mon Nov 26 11:13:17 2007
@@ -20,7 +20,12 @@
#define y2log_component "qt-ui"
#include
-#include "qregexp.h"
+#include
+#include
+#include
+#include
+#include <QVBoxLayout>
+
#include "YEvent.h"
#include "utf8.h"
#include "YQUI.h"
@@ -29,23 +34,28 @@
YQRichText::YQRichText( YWidget * parent, const string & text, bool plainTextMode )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YRichText( parent, text, plainTextMode )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ layout->setSpacing( 0 );
+ setLayout( layout );
+
setWidgetRep( this );
- setMargin( YQWidgetMargin );
+ layout->setMargin( YQWidgetMargin );
_textBrowser = new YQTextBrowser( this );
YUI_CHECK_NEW( _textBrowser );
-
- _textBrowser->setMimeSourceFactory( 0 );
+ layout->addWidget( _textBrowser );
+
+ // FIXME _textBrowser->setMimeSourceFactory( 0 );
_textBrowser->installEventFilter( this );
if ( plainTextMode )
{
_textBrowser->setTextFormat( Qt::PlainText );
- _textBrowser->setWordWrap( QTextEdit::NoWrap );
+ _textBrowser->setWordWrapMode( QTextOption::NoWrap );
}
else
{
@@ -62,19 +72,22 @@
QPalette pal( _textBrowser->palette() );
QColorGroup normalColors( pal.normal() );
- normalColors.setColor( QColorGroup::Text, black );
+ normalColors.setColor( QColorGroup::Text, Qt::black );
pal.setNormal( normalColors );
_textBrowser->setPalette( pal );
+
+#ifdef FIXME
// Set the text background to a light grey
_textBrowser->setPaper( QColor( 234, 234, 234 ) );
+#endif
// Propagate clicks on hyperlinks
- connect( _textBrowser, SIGNAL( linkClicked( const QString & ) ),
- this, SLOT ( linkClicked( const QString & ) ) );
+ connect( _textBrowser, SIGNAL( anchorClicked( const QUrl & ) ),
+ this, SLOT ( linkClicked ( const QUrl & ) ) );
}
@@ -112,7 +125,7 @@
if ( plainTextMode() )
{
_textBrowser->setTextFormat( Qt::PlainText );
- _textBrowser->setWordWrap( QTextEdit::NoWrap );
+ _textBrowser->setWordWrapMode( QTextOption::NoWrap );
}
else
{
@@ -130,10 +143,10 @@
}
-void YQRichText::linkClicked( const QString & url )
+void YQRichText::linkClicked( const QUrl & url )
{
- // y2debug( "Selected hyperlink \"%s\"", (const char *) url );
- YQUI::ui()->sendEvent( new YMenuEvent( YCPString( (const char *) url ) ) );
+ // y2debug( "Selected hyperlink \"%s\"", (const char *) url.toString() );
+ YQUI::ui()->sendEvent( new YMenuEvent( YCPString( (const char *) url.toString() ) ) );
}
@@ -165,7 +178,7 @@
{
if ( plainTextMode() )
return false;
-
+
return ( _textBrowser->text().contains( QRegExp( " 0 );
}
Modified: branches/tmp/coolo/qt4-port/src/YQRichText.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQRichText.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQRichText.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQRichText.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQRichText_h
#define YQRichText_h
-#include
+#include <QFrame>
#include
#include "YRichText.h"
@@ -29,7 +29,7 @@
class YQTextBrowser;
-class YQRichText : public QVBox, public YRichText
+class YQRichText : public QFrame, public YRichText
{
Q_OBJECT
@@ -67,7 +67,7 @@
* Reimplemented from YRichText.
**/
virtual void setAutoScrollDown( bool on = true );
-
+
/**
* Preferred width of the widget.
*
@@ -122,7 +122,7 @@
/**
* Notification that a hyperlink is clicked.
**/
- void linkClicked( const QString & url );
+ void linkClicked( const QUrl & url );
protected:
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQSelectionBox.cc Mon Nov 26 11:13:17 2007
@@ -19,8 +19,14 @@
#include
#include
-#include
+#include
#include
+//Added by qt3to4:
+#include
+#include
+#include
+#include
+#include <QVBoxLayout>
#define y2log_component "qt-ui"
#include
@@ -42,19 +48,24 @@
YQSelectionBox::YQSelectionBox( YWidget * parent, const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YSelectionBox( parent, label )
{
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
- _qt_listBox = new QListBox( this );
+ _qt_listBox = new Q3ListBox( this );
YUI_CHECK_NEW( _qt_listBox );
+ layout->addWidget( _qt_listBox );
_qt_listBox->installEventFilter( this );
_qt_listBox->setVariableHeight( false );
@@ -66,8 +77,8 @@
connect( _qt_listBox, SIGNAL( highlighted ( int ) ),
this, SLOT ( slotSelected( int ) ) );
- connect( _qt_listBox, SIGNAL( doubleClicked( QListBoxItem * ) ),
- this, SLOT ( slotActivated( QListBoxItem * ) ) );
+ connect( _qt_listBox, SIGNAL( doubleClicked( Q3ListBoxItem * ) ),
+ this, SLOT ( slotActivated( Q3ListBoxItem * ) ) );
connect( &_timer, SIGNAL( timeout() ),
this, SLOT ( returnImmediately() ) );
@@ -280,7 +291,7 @@
}
-void YQSelectionBox::slotActivated( QListBoxItem * qItem )
+void YQSelectionBox::slotActivated( Q3ListBoxItem * qItem )
{
selectItem( _qt_listBox->index( qItem ) );
Modified: branches/tmp/coolo/qt4-port/src/YQSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQSelectionBox.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQSelectionBox.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQSelectionBox.h Mon Nov 26 11:13:17 2007
@@ -20,20 +20,20 @@
#ifndef YQSelectionBox_h
#define YQSelectionBox_h
-#include
+#include <QFrame>
#include
#include "YSelectionBox.h"
class YQWidgetCaption;
-class QListBox;
-class QListBoxItem;
+class Q3ListBox;
+class Q3ListBoxItem;
-class YQSelectionBox : public QVBox, public YSelectionBox
+class YQSelectionBox : public QFrame, public YSelectionBox
{
Q_OBJECT
-
+
public:
/**
@@ -54,7 +54,7 @@
virtual void setLabel( const string & label );
/**
- * Add an item.
+ * Add an item.
*
* Reimplemented from YSelectionWidget.
**/
@@ -80,7 +80,7 @@
* Reimplemented from YSelectionWidget.
**/
virtual void deleteAllItems();
-
+
/**
* Set enabled/disabled state.
*
@@ -123,7 +123,7 @@
**/
virtual bool eventFilter( QObject * obj, QEvent * ev );
-
+
protected slots:
/**
@@ -135,21 +135,21 @@
/**
* Notification that an item has been activated (double clicked).
**/
- void slotActivated( QListBoxItem * item );
+ void slotActivated( Q3ListBoxItem * item );
/**
* Return after some millseconds delay - collect multiple events.
* This is only relevant if `opt( `notify ) is set.
**/
void returnDelayed();
-
+
/**
* Return immediately.
* This is only relevant if `opt( `notify ) is set.
**/
void returnImmediately();
-
+
protected:
/**
@@ -157,13 +157,13 @@
**/
void selectItem( int index );
-
+
//
// Data members
//
YQWidgetCaption * _caption;
- QListBox * _qt_listBox;
+ Q3ListBox * _qt_listBox;
QTimer _timer;
};
Modified: branches/tmp/coolo/qt4-port/src/YQSlider.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQSlider.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQSlider.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQSlider.cc Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#include
#include
#include
-#include
+#include <QVBoxLayout>
#define y2log_component "qt-ui"
#include
@@ -40,27 +40,37 @@
int initialValue,
bool reverseLayout )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YSlider( parent, label, minValue, maxValue )
{
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
- _caption = new YQWidgetCaption( this, toUTF8( label ) );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
+
+ _caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
- _hbox = new QHBox( this );
+ _hbox = new QFrame( this );
YUI_CHECK_NEW( _hbox );
-
- _hbox->setSpacing( YQWidgetSpacing );
+ layout->addWidget( _hbox );
+
+ layout = new QVBoxLayout( _hbox );
+ _hbox->setLayout( layout );
+
+ layout->setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
if ( reverseLayout )
{
_qt_spinBox = new QSpinBox( minValue, maxValue,
1, // step
_hbox );
+ layout->addWidget( _qt_spinBox );
}
else
{
@@ -70,14 +80,16 @@
_qt_slider = new QSlider( minValue, maxValue,
1, // pageStep
initialValue,
- QSlider::Horizontal, _hbox );
+ Qt::Horizontal, _hbox );
YUI_CHECK_NEW( _qt_slider );
+ layout->addWidget( _qt_slider );
if ( ! reverseLayout )
{
_qt_spinBox = new QSpinBox( minValue, maxValue,
1, // step
_hbox );
+ layout->addWidget( _qt_spinBox );
}
YUI_CHECK_NEW( _qt_spinBox );
Modified: branches/tmp/coolo/qt4-port/src/YQSlider.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQSlider.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQSlider.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQSlider.h Mon Nov 26 11:13:17 2007
@@ -20,16 +20,15 @@
#ifndef YQSlider_h
#define YQSlider_h
-#include
+#include <QFrame>
#include "YSlider.h"
class YQWidgetCaption;
class QSlider;
class QSpinBox;
-class QHBox;
-class YQSlider : public QVBox, public YSlider
+class YQSlider : public QFrame, public YSlider
{
Q_OBJECT
@@ -72,7 +71,7 @@
virtual void setValueInternal( int val );
public:
-
+
/**
* Set the label (the caption above the input field).
*
@@ -86,7 +85,7 @@
* Reimplemented from YWidget.
**/
virtual void setEnabled( bool enabled );
-
+
/**
* Preferred width of the widget.
*
@@ -113,7 +112,7 @@
**/
virtual bool setKeyboardFocus();
-
+
public slots:
/**
* Slot for "value changed". This will send a ValueChanged event if
@@ -128,7 +127,7 @@
**/
void setValueSlot( int newValue );
-
+
signals:
/**
@@ -142,7 +141,7 @@
YQWidgetCaption * _caption;
QSlider * _qt_slider;
QSpinBox * _qt_spinBox;
- QHBox * _hbox;
+ QFrame * _hbox;
};
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTable.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQTable.cc Mon Nov 26 11:13:17 2007
@@ -16,7 +16,8 @@
/-*/
-#include
+#include
+#include <QVBoxLayout>
#define y2log_component "qt-ui"
#include
@@ -31,14 +32,19 @@
YQTable::YQTable( YWidget * parent, YTableHeader * tableHeader )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YTable( parent, tableHeader )
{
setWidgetRep( this );
- setMargin( YQWidgetMargin );
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ layout->setSpacing( 0 );
+ setLayout( layout );
+
+ layout->setMargin( YQWidgetMargin );
_qt_listView = new QY2ListView( this );
YUI_CHECK_NEW( _qt_listView );
+ layout->addWidget( _qt_listView );
_qt_listView->setAllColumnsShowFocus( true );
@@ -57,7 +63,7 @@
case YAlignBegin: qt_alignment = Qt::AlignLeft; break;
case YAlignCenter: qt_alignment = Qt::AlignCenter; break;
case YAlignEnd: qt_alignment = Qt::AlignRight; break;
-
+
case YAlignUnchanged: break;
}
@@ -70,14 +76,14 @@
// Connect signals and slots
//
- connect( _qt_listView, SIGNAL( doubleClicked ( QListViewItem * ) ),
- this, SLOT ( slotActivated ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( doubleClicked ( Q3ListViewItem * ) ),
+ this, SLOT ( slotActivated ( Q3ListViewItem * ) ) );
- connect( _qt_listView, SIGNAL( spacePressed ( QListViewItem * ) ),
- this, SLOT ( slotActivated ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( spacePressed ( Q3ListViewItem * ) ),
+ this, SLOT ( slotActivated ( Q3ListViewItem * ) ) );
- connect( _qt_listView, SIGNAL( selectionChanged ( QListViewItem * ) ),
- this, SLOT ( slotSelected ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( selectionChanged ( Q3ListViewItem * ) ),
+ this, SLOT ( slotSelected ( Q3ListViewItem * ) ) );
}
@@ -169,7 +175,7 @@
void
-YQTable::selectOrigItem( QListViewItem * listViewItem )
+YQTable::selectOrigItem( Q3ListViewItem * listViewItem )
{
if ( listViewItem )
{
@@ -182,7 +188,7 @@
void
-YQTable::slotSelected( QListViewItem * listViewItem )
+YQTable::slotSelected( Q3ListViewItem * listViewItem )
{
selectOrigItem( listViewItem );
@@ -199,7 +205,7 @@
void
-YQTable::slotActivated( QListViewItem * listViewItem )
+YQTable::slotActivated( Q3ListViewItem * listViewItem )
{
selectOrigItem( listViewItem );
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTable.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQTable.h Mon Nov 26 11:13:17 2007
@@ -19,17 +19,17 @@
#ifndef YQTable_h
#define YQTable_h
-#include
+#include <QFrame>
#include
#include "YTable.h"
class QY2ListView;
-class QListViewItem;
+class Q3ListViewItem;
class YQListViewItem;
-class YQTable : public QVBox, public YTable
+class YQTable : public QFrame, public YTable
{
Q_OBJECT
@@ -133,21 +133,21 @@
/**
* Notification that an item is selected (single click or keyboard).
**/
- void slotSelected( QListViewItem * );
+ void slotSelected( Q3ListViewItem * );
/**
* Notification that an item is activated (double click or keyboard).
**/
- void slotActivated( QListViewItem * );
+ void slotActivated( Q3ListViewItem * );
protected:
-
+
/**
* Select the original item (the YTableItem) that corresponds to the
- * specified listViewItem.
+ * specified listViewItem.
**/
- void selectOrigItem( QListViewItem * listViewItem );
+ void selectOrigItem( Q3ListViewItem * listViewItem );
//
// Data members
@@ -186,7 +186,7 @@
* Update this item's display with the content of 'cell'.
**/
void updateCell( const YTableCell * cell );
-
+
protected:
YQTable * _table;
Modified: branches/tmp/coolo/qt4-port/src/YQTimeField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTimeField.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTimeField.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQTimeField.cc Mon Nov 26 11:13:17 2007
@@ -26,24 +26,30 @@
#include "YQUI.h"
#include "YQTimeField.h"
#include "YQWidgetCaption.h"
-
+#include <QVBoxLayout>
YQTimeField::YQTimeField( YWidget * parent, const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YTimeField( parent, label )
{
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_caption = new YQWidgetCaption( this, fromUTF8( label ) );
YUI_CHECK_NEW( _caption );
+ layout->addWidget( _caption );
_qt_timeEdit = new QTimeEdit( this );
YUI_CHECK_NEW( _qt_timeEdit );
+ layout->addWidget( _qt_timeEdit );
- _qt_timeEdit->setAutoAdvance( true );
+#warning FIXME setAutoAdvance does?
+ //_qt_timeEdit->setAutoAdvance( true );
_caption->setBuddy( _qt_timeEdit );
}
@@ -75,7 +81,7 @@
void YQTimeField::setEnabled( bool enabled )
{
- QVBox::setEnabled( enabled );
+ QFrame::setEnabled( enabled );
YWidget::setEnabled( enabled );
}
Modified: branches/tmp/coolo/qt4-port/src/YQTimeField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTimeField.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTimeField.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQTimeField.h Mon Nov 26 11:13:17 2007
@@ -20,14 +20,14 @@
#ifndef YQTimeField_h
#define YQTimeField_h
-#include
+#include <QFrame>
#include "YTimeField.h"
class YQWidgetCaption;
class QTimeEdit;
-class YQTimeField : public QVBox, public YTimeField
+class YQTimeField : public QFrame, public YTimeField
{
Q_OBJECT
Modified: branches/tmp/coolo/qt4-port/src/YQTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTree.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTree.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQTree.cc Mon Nov 26 11:13:17 2007
@@ -17,11 +17,14 @@
/-*/
-#include
+#include
#include
-#include
-#include
+#include
+#include
+#include <QVBoxLayout>
#include
+//Added by qt3to4:
+#include
#define y2log_component "qt-ui"
#include
@@ -40,36 +43,41 @@
YQTree::YQTree( YWidget * parent, const string & label )
- : QVBox( (QWidget *) parent->widgetRep() )
+ : QFrame( (QWidget *) parent->widgetRep() )
, YTree( parent, label )
{
+ QVBoxLayout* layout = new QVBoxLayout( this );
+ setLayout( layout );
+
setWidgetRep( this );
- setSpacing( YQWidgetSpacing );
- setMargin ( YQWidgetMargin );
+ layout->setSpacing( YQWidgetSpacing );
+ layout->setMargin ( YQWidgetMargin );
_nextSerialNo = 0;
_caption = new YQWidgetCaption( this, label );
YUI_CHECK_NEW( _caption );
-
- _qt_listView = new QListView( this );
+ layout->addWidget( _caption );
+
+ _qt_listView = new Q3ListView( this );
YUI_CHECK_NEW( _qt_listView );
-
+ layout->addWidget( _qt_listView );
+
_qt_listView->addColumn( "" );
_qt_listView->header()->hide();
_qt_listView->setRootIsDecorated ( true );
_caption->setBuddy ( _qt_listView );
- connect( _qt_listView, SIGNAL( selectionChanged ( QListViewItem * ) ),
- this, SLOT ( slotSelected ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( selectionChanged ( Q3ListViewItem * ) ),
+ this, SLOT ( slotSelected ( Q3ListViewItem * ) ) );
- connect( _qt_listView, SIGNAL( spacePressed ( QListViewItem * ) ),
- this, SLOT ( slotActivated ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( spacePressed ( Q3ListViewItem * ) ),
+ this, SLOT ( slotActivated ( Q3ListViewItem * ) ) );
- connect( _qt_listView, SIGNAL( doubleClicked ( QListViewItem * ) ),
- this, SLOT ( slotActivated ( QListViewItem * ) ) );
+ connect( _qt_listView, SIGNAL( doubleClicked ( Q3ListViewItem * ) ),
+ this, SLOT ( slotActivated ( Q3ListViewItem * ) ) );
}
@@ -89,7 +97,7 @@
void YQTree::rebuildTree()
{
// y2debug( "Rebuilding tree" );
-
+
YQSignalBlocker sigBlocker( _qt_listView );
_qt_listView->clear();
@@ -151,13 +159,13 @@
_qt_listView->setSelected( item, true );
openBranch( item );
YTree::selectItem( item->origItem(), true );
-
+
y2debug( "selected item: \"%s\"", item->origItem()->label().c_str() );
}
}
-void YQTree::openBranch( QListViewItem * item )
+void YQTree::openBranch( Q3ListViewItem * item )
{
while ( item )
{
@@ -185,7 +193,7 @@
}
-void YQTree::slotSelected( QListViewItem * qItem )
+void YQTree::slotSelected( Q3ListViewItem * qItem )
{
selectItem( dynamic_cast (qItem) );
@@ -194,7 +202,7 @@
}
-void YQTree::slotActivated( QListViewItem * qItem )
+void YQTree::slotActivated( Q3ListViewItem * qItem )
{
selectItem( dynamic_cast (qItem) );
@@ -248,13 +256,13 @@
YQTreeItem::YQTreeItem( YQTree * tree,
- QListView * listView,
+ Q3ListView * listView,
YTreeItem * orig,
int serial )
- : QListViewItem( listView )
+ : Q3ListViewItem( listView )
{
init( tree, orig, serial );
-
+
#if VERBOSE_TREE_ITEMS
y2debug( "Creating toplevel tree item \"%s\"", orig->label().c_str() );
#endif
@@ -265,7 +273,7 @@
YQTreeItem * parentItem,
YTreeItem * orig,
int serial )
- : QListViewItem( parentItem )
+ : Q3ListViewItem( parentItem )
{
init( tree, orig, serial );
@@ -309,7 +317,7 @@
void
YQTreeItem::setOpen( bool open )
{
- QListViewItem::setOpen( open );
+ Q3ListViewItem::setOpen( open );
_origItem->setOpen( open );
}
Modified: branches/tmp/coolo/qt4-port/src/YQTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQTree.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQTree.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQTree.h Mon Nov 26 11:13:17 2007
@@ -20,7 +20,7 @@
#ifndef YQTree_h
#define YQTree_h
-#include
+#include <QFrame>
#include
#include "YTree.h"
@@ -30,7 +30,7 @@
class YQTreeItem;
-class YQTree : public QVBox, public YTree
+class YQTree : public QFrame, public YTree
{
Q_OBJECT
@@ -45,7 +45,7 @@
* Destructor.
**/
virtual ~YQTree();
-
+
/**
* Change the label text.
*
@@ -125,14 +125,14 @@
*
* This will trigger a 'SelectionChanged' event if 'notify' is set.
**/
- void slotSelected( QListViewItem * item );
+ void slotSelected( Q3ListViewItem * item );
/**
* Propagate a double click or pressing the space key on a tree item.
- *
+ *
* This will trigger an 'Activated' event if 'notify' is set.
**/
- void slotActivated( QListViewItem * item);
+ void slotActivated( Q3ListViewItem * item);
protected:
@@ -145,8 +145,8 @@
/**
* Open the branch of 'item' recursively to its toplevel item.
**/
- void openBranch( QListViewItem * item );
-
+ void openBranch( Q3ListViewItem * item );
+
/**
* Build a tree of items that will be displayed (YQTreeItems) from the
* original items between iterators 'begin' and 'end' as child items of
@@ -161,12 +161,12 @@
//
YQWidgetCaption * _caption;
- QListView * _qt_listView;
+ Q3ListView * _qt_listView;
int _nextSerialNo;
};
-class YQTreeItem: public QListViewItem
+class YQTreeItem: public Q3ListViewItem
{
public:
@@ -174,7 +174,7 @@
* Constructor for a top level item.
**/
YQTreeItem( YQTree * tree,
- QListView * parent,
+ Q3ListView * parent,
YTreeItem * origItem,
int serial );
@@ -194,7 +194,7 @@
/**
* Open this item.
*
- * Reimplemented from QListViewItem.
+ * Reimplemented from Q3ListViewItem.
**/
virtual void setOpen( bool open );
@@ -214,11 +214,11 @@
/**
* Sort key of this item.
*
- * Reimplemented from QListViewItem.
+ * Reimplemented from Q3ListViewItem.
**/
QString key( int column, bool ascending ) const;
-
+
//
// Data members
//
Modified: branches/tmp/coolo/qt4-port/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI.h Mon Nov 26 11:13:17 2007
@@ -20,8 +20,8 @@
#define YQUI_h
#include
-#include
-#include
+#include
+#include
#include <vector>
#include "YSimpleEventHandler.h"
@@ -32,8 +32,8 @@
#define YQButtonBorder 3
class QCursor;
-class QVBox;
-class QWidgetStack;
+class QFrame;
+class QStackedWidget;
class QY2Settings;
class YEvent;
class YQOptionalWidgetFactory;
@@ -105,7 +105,7 @@
* cannot be created.
**/
static YQApplication * yqApp();
-
+
/**
* Widget event handlers (slots) call this when an event occured that
* should be the answer to a UserInput() / PollInput() (etc.) call.
@@ -521,7 +521,6 @@
QMap screenShotNo;
QString screenShotNameTemplate;
-
protected slots:
/**
@@ -534,12 +533,6 @@
**/
void userInputTimeout();
- /**
- * Sets @ref #leave_idle_loop to true.
- **/
- void leaveIdleLoop( int );
-
-
protected:
/**
@@ -552,6 +545,7 @@
**/
void calcDefaultSize();
+ void init_ui();
//
// Data members
@@ -577,12 +571,12 @@
* argument, so this needs to be embedded into something else - and a QVBox
* at least handles all the sizeHint and resize stuff.
**/
- QVBox * _main_win;
+ QFrame * _main_win;
/**
* Stack for the Qt widgets inside the main window.
**/
- QWidgetStack * _widget_stack;
+ QStackedWidget * _widget_stack;
/**
* Stack to keep track of the stacking order of popup dialogs.
@@ -590,23 +584,11 @@
vector _popup_stack;
/**
- * Numeric ID for defaultsize dialogs for the widget stack
- **/
- int _main_dialog_id;
-
- /**
* Size for `opt(`defaultsize) dialogs.
**/
QSize _default_size;
/**
- * A flag used during the idle loop. If it is set to true,
- * the idle loop is left. This happens, if the ycp-ui-communication
- * pipe to the ui gets readable.
- **/
- bool _leave_idle_loop;
-
- /**
* This flag is set during @ref #userInput in order to tell
* @ref #returnNow to call exit_loop, which only may be called
* after enter_loop.
@@ -614,6 +596,12 @@
bool _do_exit_loop;
/**
+ * Event loop object. Required since a YaST2 UI needs to react to commands
+ * from the YCP command stream as well as to X11 / Qt events.
+ **/
+ QEventLoop * _eventLoop;
+
+ /**
* Window manager close events blocked?
**/
bool _wm_close_blocked;
@@ -642,7 +630,7 @@
/**
* Timer for delayed busy cursor
**/
- QTimer _busy_cursor_timer;
+ QTimer *_busy_cursor_timer;
/**
* The handler for the single pending event this UI keeps track of
@@ -668,7 +656,10 @@
* Flag: Was the user already asked if he wants to use a left-handed mouse?
**/
bool _askedForLeftHandedMouse;
-};
+ bool _ui_inited;
+ int _ui_argc;
+ char **_ui_argv;
+};
#endif // YQUI_h
Modified: branches/tmp/coolo/qt4-port/src/YQUIComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUIComponent.h?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUIComponent.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQUIComponent.h Mon Nov 26 11:13:17 2007
@@ -19,6 +19,9 @@
#ifndef YQUIComponent_h
#define YQUIComponent_h
+#define y2log_component "qt-ui"
+#include
+
#include
#include "YQUI.h"
Modified: branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_builtins.cc Mon Nov 26 11:13:17 2007
@@ -25,11 +25,11 @@
#include
#include
-#include
+#include
#include
#include
#include
-#include
+#include
#include
#define y2log_component "qt-ui"
@@ -204,12 +204,12 @@
if ( interactive )
{
- QMessageBox::warning( 0, // parent
- "Error", // caption
+ QMessageBox::warning( 0, // parent
+ "Error", // caption
QString( "Couldn't save screen shot\nto %1" ).arg( fileName ),
QMessageBox::Ok | QMessageBox::Default, // button0
- QMessageBox::NoButton, // button1
- QMessageBox::NoButton ); // button2
+ Qt::NoButton, // button1
+ Qt::NoButton ); // button2
}
}
@@ -317,7 +317,7 @@
normalCursor();
QString filename =
- QFileDialog::getSaveFileName( DEFAULT_MACRO_FILE_NAME, // startWith
+ Q3FileDialog::getSaveFileName( DEFAULT_MACRO_FILE_NAME, // startWith
"*.ycp", // filter
0, // parent
0, // (widget) name
@@ -336,7 +336,7 @@
normalCursor();
QString filename =
- QFileDialog::getOpenFileName( DEFAULT_MACRO_FILE_NAME, // startWith
+ Q3FileDialog::getOpenFileName( DEFAULT_MACRO_FILE_NAME, // startWith
"*.ycp", // filter
0, // parent
0, // (widget) name
@@ -368,7 +368,7 @@
normalCursor();
QString dir_name =
- QFileDialog::getExistingDirectory( fromUTF8( startDir->value() ),
+ Q3FileDialog::getExistingDirectory( fromUTF8( startDir->value() ),
_main_win, // parent
"dir_selector", // name
fromUTF8( headline->value() ) ); // caption
@@ -388,7 +388,7 @@
normalCursor();
QString file_name =
- QFileDialog::getOpenFileName( fromUTF8( startWith->value() ),
+ Q3FileDialog::getOpenFileName( fromUTF8( startWith->value() ),
fromUTF8( filter->value() ),
_main_win, // parent
"file_selector", // name
@@ -433,7 +433,7 @@
// Leave the mouse cursor alone - this function might be called from
// some other widget, not only from UI::AskForSaveFileName().
- file_name = QFileDialog::getSaveFileName( startWith,
+ file_name = Q3FileDialog::getSaveFileName( startWith,
filter,
_main_win, // parent
"file_selector", // name
Modified: branches/tmp/coolo/qt4-port/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_core.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_core.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_core.cc Mon Nov 26 11:13:17 2007
@@ -22,9 +22,10 @@
#include
#include
-#include
-#include
-#include
+#include
+#include <QStackedWidget>
+#include <QDesktopWidget>
+#include <QThread>
#include
#include
@@ -46,24 +47,20 @@
#define BUSY_CURSOR_TIMEOUT 200 // milliseconds
-#define KYAST_EMBEDDING 0
-
YQUI * YQUI::_ui = 0;
-
static void qMessageHandler( QtMsgType type, const char * msg );
YQUI::YQUI( int argc, char **argv, bool with_threads, const char * macro_file )
: QObject()
, YUI( with_threads )
, _main_win( NULL )
- , _main_dialog_id(0)
- , _do_exit_loop( false )
+ , _eventLoop( 0 )
, _wm_close_blocked( false )
, _auto_activate_dialogs( true )
{
- y2debug( "YQUI constructor start" );
+ y2milestone( "YQUI constructor start" );
_ui = this;
_fatal_error = false;
@@ -77,45 +74,75 @@
qInstallMsgHandler( qMessageHandler );
- y2debug( "Creating QApplication" );
- new QApplication( argc, argv );
+ // Copy command line arguments for QApplication
+
+ _ui_argv = (char **) malloc( (argc+1) * sizeof( const char * ) );
+ _ui_argc = argc + 1;
+
+ for ( int i=0; i < argc; i++ )
+ _ui_argv[i+1] = strdup( argv[i] );
+
+ _ui_argv[0] = strdup( "YaST2" );
+ _ui_inited = false;
+
+ topmostConstructorHasFinished();
+}
+
+void YQUI::init_ui()
+{
+ if (_ui_inited)
+ return;
+
+ /*
+ Qt thinks the first QObject defines the main thread, but
+ the main thread in this case is the ycp thread, not UI
+ */
+ //extern void qt_set_current_thread_to_main_thread();
+ //qt_set_current_thread_to_main_thread();
+
+ _ui_inited = true;
+
+ new QApplication( _ui_argc, _ui_argv);
+ _busy_cursor_timer = new QTimer( qApp );
_normalPalette = qApp->palette();
// Qt keeps track to a global QApplication in qApp.
- CHECK_PTR( qApp );
+ Q_CHECK_PTR( qApp );
qApp->installEventFilter( this );
- processCommandLineArgs( argc, argv );
+ processCommandLineArgs( _ui_argc, _ui_argv );
calcDefaultSize();
+ // Event loop object. Required since a YaST2 UI needs to react to commands
+ // from the YCP command stream as well as to X11 / Qt events.
+ _eventLoop = new QEventLoop( qApp );
+ _do_exit_loop = false;
// Create main window for `opt(`defaultsize) dialogs.
//
// We have to use something else than QWidgetStack since QWidgetStack
// doesn't accept a WFlags arg which we badly need here.
- WFlags wflags = WType_TopLevel;
+ Qt::WFlags wflags = Qt::Window;
if ( ! _decorate_toplevel_window )
{
y2debug( "Suppressing WM decorations for toplevel window" );
- wflags |= WStyle_Customize | WStyle_NoBorder;
+ wflags |= Qt::FramelessWindowHint;
}
- // if we have a window already, delete it
- if (_main_win)
- delete _main_win;
-
- _main_win = new QVBox( 0, 0, wflags ); // parent, name, wflags
-
+ _main_win = new Q3VBox( 0, 0, wflags ); // parent, name, wflags
+ _main_win->setFocusPolicy( Qt::StrongFocus );
// Create widget stack for `opt(`defaultsize) dialogs
- _widget_stack = new QWidgetStack( _main_win );
- _widget_stack->setFocusPolicy( QWidget::StrongFocus );
- qApp->setMainWidget( _main_win );
+ _widget_stack = new QStackedWidget( _main_win );
+ _widget_stack->setFocusPolicy( Qt::StrongFocus );
+#if 0
_main_win->installEventFilter( this );
+#endif
+
_main_win->resize( _default_size );
if ( _fullscreen || ! _have_wm )
@@ -170,12 +197,11 @@
// Workaround: Keep one more reference to libqt-mt open - dlopen() it here
// and make sure there is no corresponding dlclose().
- QString qt_lib_name = QString( QTLIBDIR "/libqt-mt.so.%1" ).arg( QT_VERSION >> 16 );;
- void * qt_lib = dlopen( (const char *) qt_lib_name, RTLD_GLOBAL );
- y2milestone( "Forcing %s open %s", (const char *) qt_lib_name,
+ QString qt_lib_name = QString( QTLIBDIR "/libQtGui.so.%1" ).arg( QT_VERSION >> 16 );;
+ void * qt_lib = dlopen( qt_lib_name.utf8().constData(), RTLD_GLOBAL );
+ y2milestone( "Forcing %s open %s", qt_lib_name.utf8().constData(),
qt_lib ? "successful" : "failed" );
-
// Init other stuff
qApp->setFont( yqApp()->currentFont() );
@@ -184,16 +210,15 @@
connect( & _user_input_timer, SIGNAL( timeout() ),
this, SLOT ( userInputTimeout() ) );
- connect( & _busy_cursor_timer, SIGNAL( timeout() ),
+ connect( _busy_cursor_timer, SIGNAL( timeout() ),
this, SLOT ( busyCursor() ) );
- if ( macro_file )
- playMacro( macro_file );
-
-
- topmostConstructorHasFinished();
+#warning macro_file
+ // if ( macro_file )
+ // playMacro( macro_file );
- y2debug( "YQUI constructor end" );
+ y2milestone( "YQUI constructor end %ld", QThread::currentThreadId () );
+ qApp->processEvents();
}
@@ -371,31 +396,27 @@
}
}
-
void YQUI::idleLoop( int fd_ycp )
{
- _leave_idle_loop = false;
+ init_ui();
- // process Qt events until fd_ycp is readable.
- QSocketNotifier * notifier = new QSocketNotifier( fd_ycp, QSocketNotifier::Read );
- QObject::connect( notifier, SIGNAL( activated ( int ) ),
- this, SLOT ( leaveIdleLoop( int ) ) );
+ // runs in main thread
+ _eventLoop->wakeUp();
- notifier->setEnabled( true );
+ fd_set rfds;
- while ( !_leave_idle_loop )
- qApp->processOneEvent();
+ FD_ZERO(&rfds);
+ FD_SET(fd_ycp, &rfds);
- delete notifier;
-}
-
-
-void YQUI::leaveIdleLoop( int )
-{
- _leave_idle_loop = true;
+ while (true)
+ {
+ int retval = select(fd_ycp+1, &rfds, NULL, NULL, NULL);
+ if (retval)
+ break;
+ }
+ _eventLoop->exit();
}
-
void YQUI::sendEvent( YEvent * event )
{
if ( event )
@@ -403,13 +424,17 @@
_event_handler.sendEvent( event );
if ( _do_exit_loop )
- qApp->exit_loop();
+ _eventLoop->exit( 1 );
}
}
YEvent * YQUI::userInput( unsigned long timeout_millisec )
{
+ init_ui();
+
+ //y2milestone( "userInput %ld", QThread::currentThreadId () );
+
YEvent * event = 0;
YQDialog * dialog = dynamic_cast ( YDialog::currentDialog( false ) );
@@ -429,19 +454,17 @@
normalCursor();
_do_exit_loop = true; // should exit_loop() be called in sendEvent()?
- while ( ! pendingEvent() )
- {
- qApp->enter_loop();
- }
+ _eventLoop->processEvents();
_do_exit_loop = false;
+
event = _event_handler.consumePendingEvent();
dialog->activate( false );
// Display a busy cursor, but only if there is no other activity within
// BUSY_CURSOR_TIMEOUT milliseconds (avoid cursor flicker)
- _busy_cursor_timer.start( BUSY_CURSOR_TIMEOUT, true ); // single shot
+ _busy_cursor_timer->start( BUSY_CURSOR_TIMEOUT, true ); // single shot
}
if ( _user_input_timer.isActive() )
@@ -465,7 +488,7 @@
if ( dialog )
{
dialog->activate( true );
- qApp->processEvents();
+ //qApp->processEvents();
event = _event_handler.consumePendingEvent();
dialog->activate( false );
}
@@ -487,23 +510,19 @@
YDialog * YQUI::createDialog( YWidgetOpt & opt )
{
- bool has_defaultsize = opt.hasDefaultSize.value();
- QWidget * qt_parent = _main_win;
+ init_ui();
- // Popup dialogs get the topmost other popup dialog as their parent since
- // some window managers (e.g., fvwm2 as used in the inst-sys) otherwise
- // tend to confuse the stacking order of popup dialogs.
- //
- // This _popup_stack handling would be better placed in showDialog(), but we
- // need the parent here for QWidget creation. libyui guarantees that each
- // createDialog() will be followed by showDialog() for the same dialog
- // without any chance for other dialogs to get in between.
+ y2milestone( "createDialog %ld", QThread::currentThreadId () );
+ bool has_defaultsize = opt.hasDefaultSize.value();
+ QWidget * qt_parent =
+ has_defaultsize ? _widget_stack : _main_win;
+ // FIXME: Probably obsolete
if ( ! has_defaultsize && ! _popup_stack.empty() )
qt_parent = _popup_stack.back();
YQDialog * dialog = new YQDialog( opt, qt_parent, has_defaultsize );
- CHECK_PTR( dialog );
+ Q_CHECK_PTR( dialog );
if ( ! has_defaultsize )
_popup_stack.push_back( (QWidget *) dialog->widgetRep() );
@@ -524,8 +543,8 @@
if ( dialog->hasDefaultSize() )
{
- _widget_stack->addWidget ( qw, ++_main_dialog_id );
- _widget_stack->raiseWidget( qw ); // maybe this is not necessary (?)
+ _widget_stack->addWidget ( qw );
+ _widget_stack->setCurrentWidget( qw );
if ( ! _main_win->isVisible() )
{
@@ -545,7 +564,8 @@
}
( (YQDialog *) dialog)->ensureOnlyOneDefaultButton();
- qApp->processEvents();
+
+ //qApp->processEvents();
}
@@ -562,18 +582,6 @@
if ( dialog->hasDefaultSize() )
{
_widget_stack->removeWidget( qw );
-
- if ( --_main_dialog_id < 1 ) // nothing left on the stack
- {
- // y2milestone( "Hiding main window" );
- _main_win->hide();
- _main_dialog_id = 0; // this should not be necessary - but better be safe than sorry
- }
- else
- {
- // FIXME: This is anti-social behaviour - do this only in the inst-sys
- _widget_stack->raiseWidget( _main_dialog_id );
- }
}
else // non-defaultsize dialog
{
@@ -634,10 +642,14 @@
switch (type)
{
case QtDebugMsg:
- y2debug ("qt-debug: %s\n", msg);
+ y2milestone ("qt-debug: %s\n", msg);
break;
case QtWarningMsg:
y2warning ("qt-warning: %s\n", msg);
+ //abort();
+ break;
+ case QtCriticalMsg:
+ y2warning ("qt-critical: %s\n", msg);
break;
case QtFatalMsg:
y2internal ("qt-fatal: %s\n", msg);
Modified: branches/tmp/coolo/qt4-port/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_widgets.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_widgets.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_widgets.cc Mon Nov 26 11:13:17 2007
@@ -18,6 +18,7 @@
#define y2log_component "qt-ui"
#include
+#include
#include "YQUI.h"
Modified: branches/tmp/coolo/qt4-port/src/YQUI_x11.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_x11.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_x11.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_x11.cc Mon Nov 26 11:13:17 2007
@@ -19,14 +19,16 @@
/-*/
+#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
#include
#include
#include
#include
+#include
#define y2log_component "qt-ui"
@@ -58,13 +60,13 @@
int YQUI::getDisplayDepth()
{
- return QColor::numBitPlanes();
+ return qApp->desktop()->depth();
}
long YQUI::getDisplayColors()
{
- return 1L << QColor::numBitPlanes();
+ return 1L << qApp->desktop()->depth();
}
@@ -104,15 +106,15 @@
void
YQUI::busyCursor( void )
{
- qApp->setOverrideCursor( Qt::busyCursor );
+ qApp->setOverrideCursor( Qt::BusyCursor );
}
void
YQUI::normalCursor( void )
{
- if ( _busy_cursor_timer.isActive() )
- _busy_cursor_timer.stop();
+ if ( _busy_cursor_timer->isActive() )
+ _busy_cursor_timer->stop();
while ( qApp->overrideCursor() )
qApp->restoreOverrideCursor();
@@ -222,23 +224,24 @@
{
if ( obj == _main_win )
{
- if ( _main_dialog_id > 0 )
+#ifdef FIXME_PROBABLY_OBSOLETE
+ if ( _widget_stack->count() > 0 )
{
// Work around QWidgetStack bug: The last raiseWidget() call
// (from closeDialog() ) might have failed if the widget was
// invisible at that time, e.g., because the user had switched to
// some other virtual desktop (bugzilla bug #11310)
- _widget_stack->raiseWidget( _main_dialog_id );
+ _widget_stack->setCurrentWidget( whatever );
}
+#endif
}
else
{
return showEventFilter( obj, ev );
}
}
-
- return false; // Don't stop event processing
+ return QObject::eventFilter( obj, ev );
}
Modified: branches/tmp/coolo/qt4-port/src/YQWidgetCaption.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWidgetCaption.cc?rev=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQWidgetCaption.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQWidgetCaption.cc Mon Nov 26 11:13:17 2007
@@ -24,11 +24,11 @@
#include "utf8.h"
-YQWidgetCaption::YQWidgetCaption( QWidget * parent,
+YQWidgetCaption::YQWidgetCaption( QWidget * parent,
const string & text )
: QLabel( fromUTF8( text ), parent )
{
- setTextFormat( QLabel::PlainText );
+ setTextFormat( Qt::PlainText );
handleVisibility( text );
}
@@ -36,7 +36,7 @@
YQWidgetCaption::YQWidgetCaption( QWidget * parent, const QString & text )
: QLabel( text, parent )
{
- setTextFormat( QLabel::PlainText );
+ setTextFormat( Qt::PlainText );
handleVisibility( text );
}
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=42380&r1=42379&r2=42380&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQWizard.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQWizard.cc Mon Nov 26 11:13:17 2007
@@ -41,24 +41,30 @@
#include
#include
-#include
-#include
+#include
+#include
#include
#include
#include
#include