Author: dmacvicar
Date: Fri Dec 7 14:36:14 2007
New Revision: 42804
URL: http://svn.opensuse.org/viewcvs/yast?rev=42804&view=rev
Log:
YQPkgTextDialog
Modified:
trunk/qt4/src/pkg/YQPkgTextDialog.cc
trunk/qt4/src/pkg/YQPkgTextDialog.h
Modified: trunk/qt4/src/pkg/YQPkgTextDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/pkg/YQPkgTextDialog.cc?rev=42804&r1=42803&r2=42804&view=diff
==============================================================================
--- trunk/qt4/src/pkg/YQPkgTextDialog.cc (original)
+++ trunk/qt4/src/pkg/YQPkgTextDialog.cc Fri Dec 7 14:36:14 2007
@@ -18,21 +18,18 @@
/-*/
-#define QT3_SUPPORT 1
-
#define y2log_component "qt-pkg"
#include
-#include
-#include
-#include
-#include
-#include
-//Added by qt3to4:
-#include
-#include
-#include
+#include <QTextBrowser>
+#include <QPushButton>
+#include <QRegExp>
+#include <QLayout>
+#include <QHBoxLayout>
+#include <QKeyEvent>
+#include <QBoxLayout>
+#include <QEvent>
#include "YQPkgTextDialog.h"
@@ -46,7 +43,6 @@
using std::string;
-
YQPkgTextDialog::YQPkgTextDialog( const QString & text, QWidget * parent )
: QDialog( parent )
{
@@ -79,58 +75,61 @@
setSizeGripEnabled( true );
// Dialog title
- setCaption( _( "YaST2" ) );
+ setWindowTitle( _( "YaST2" ) );
// Layout for the dialog ( can't simply insert a QVBox )
- Q3VBoxLayout * layout = new Q3VBoxLayout( this, MARGIN, SPACING );
+ QVBoxLayout * layout = new QVBoxLayout( this );
+ layout->setMargin(MARGIN);
+ layout->setSpacing(SPACING);
Q_CHECK_PTR( layout );
// Text browser
- _textBrowser = new Q3TextBrowser( this );
+ _textBrowser = new QTextBrowser( this );
Q_CHECK_PTR( _textBrowser );
layout->addWidget( _textBrowser );
layout->addSpacing(8);
- _textBrowser->setText( text );
- _textBrowser->setTextFormat( Qt::RichText );
+ _textBrowser->document()->setHtml( text );
_textBrowser->installEventFilter( this );
// Button box
- Q3HBox * buttonBox = new Q3HBox( this );
+ QHBoxLayout * buttonBox = new QHBoxLayout( this );
Q_CHECK_PTR( buttonBox );
buttonBox->setSpacing( SPACING );
buttonBox->setMargin ( MARGIN );
- layout->addWidget( buttonBox );
+ layout->addLayout( buttonBox );
- addHStretch( buttonBox );
+ //addHStretch( buttonBox );
// Accept (OK) button
- _acceptButton = new QPushButton( acceptButtonLabel, buttonBox );
+ _acceptButton = new QPushButton( acceptButtonLabel, this );
+ buttonBox->addWidget(_acceptButton);
Q_CHECK_PTR( _acceptButton );
_acceptButton->setDefault( true );
connect( _acceptButton, SIGNAL( clicked() ),
this, SLOT ( accept() ) );
- addHStretch( buttonBox );
+ //addHStretch( buttonBox );
if ( ! rejectButtonLabel.isEmpty() )
{
// Reject (Cancel) button
- _rejectButton = new QPushButton( rejectButtonLabel, buttonBox );
+ _rejectButton = new QPushButton( rejectButtonLabel, this );
+ buttonBox->addWidget(_rejectButton);
Q_CHECK_PTR( _rejectButton );
_rejectButton->setDefault( true );
connect( _rejectButton, SIGNAL( clicked() ),
this, SLOT ( reject() ) );
- addHStretch( buttonBox );
+// addHStretch( buttonBox );
}
else
{
@@ -180,7 +179,7 @@
void YQPkgTextDialog::setText( const QString & text )
{
- _textBrowser->setText( text );
+ _textBrowser->document()->setHtml( text );
}
Modified: trunk/qt4/src/pkg/YQPkgTextDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt4/src/pkg/YQPkgTextDialog.h?rev=42804&r1=42803&r2=42804&view=diff
==============================================================================
--- trunk/qt4/src/pkg/YQPkgTextDialog.h (original)
+++ trunk/qt4/src/pkg/YQPkgTextDialog.h Fri Dec 7 14:36:14 2007
@@ -21,13 +21,12 @@
#define YQPkgTextDialog_h
#include "YQZypp.h"
-#include
-//Added by qt3to4:
-#include
+#include <QDialog>
+#include <QEvent>
#include
class QPushButton;
-class Q3TextBrowser;
+class QTextBrowser;
using std::string;
@@ -175,7 +174,7 @@
QPushButton * _acceptButton;
QPushButton * _rejectButton;
- Q3TextBrowser * _textBrowser;
+ QTextBrowser * _textBrowser;
};
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org