Initial fixes qucsfilter to Qt4

Trying to get rid of Qt3Support.
This commit is contained in:
Guilherme Brondani Torri 2013-05-28 00:48:23 +02:00
parent 20d8cf1f1e
commit 9de480ae96
3 changed files with 28 additions and 26 deletions

View File

@ -21,16 +21,15 @@
#include "helpdialog.h"
#include <qlayout.h>
#include <q3hbox.h>
#include <qpushbutton.h>
#include <q3textedit.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <QPushButton>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QTextEdit>
HelpDialog::HelpDialog(QWidget *parent)
: QDialog(parent, 0, false, Qt::WDestructiveClose)
: QDialog(parent) //, 0, false, Qt::WDestructiveClose)
{
setCaption("Qucs Filter Help");
@ -51,25 +50,28 @@ HelpDialog::HelpDialog(QWidget *parent)
// -------- create dialog widgets ------------
resize(250, 230);
vLayout = new Q3VBoxLayout(this);
vLayout = new QVBoxLayout();
Text = new Q3TextEdit(s, QString::null, this);
Text->setTextFormat(Qt::PlainText);
Text = new QTextEdit(s, this);
//Text->setTextFormat(Qt::PlainText);
Text->setReadOnly(true);
//Text->setWordWrap(QTextEdit::NoWrap);
Text->setMinimumSize(200,200);
vLayout->addWidget(Text);
Q3HBox *h = new Q3HBox(this);
vLayout->addWidget(h);
QHBoxLayout *h = new QHBoxLayout();
h->addLayout(vLayout);
h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
h->addStretch(5);
QPushButton *ButtonClose = new QPushButton(tr("Close"), h);
QPushButton *ButtonClose = new QPushButton(tr("Close"));
h->addWidget(ButtonClose);
connect(ButtonClose, SIGNAL(clicked()), SLOT(slotClose()));
ButtonClose->setFocus();
h->setStretchFactor(new QWidget(h),5); // stretchable placeholder
h->addStretch(5);
setLayout(h);
}
HelpDialog::~HelpDialog()

View File

@ -18,12 +18,12 @@
#ifndef HELPDIALOG_H
#define HELPDIALOG_H
#include <qdialog.h>
//Added by qt3to4:
#include <Q3VBoxLayout>
#include <QDialog>
#include <QVBoxLayout>
#include <QTextEdit>
class Q3TextEdit;
class Q3VBoxLayout;
class QTextEdit;
class QVBoxLayout;
/**
*@author Michael Margraf
@ -39,8 +39,8 @@ private slots:
void slotClose();
private:
Q3VBoxLayout *vLayout;
Q3TextEdit *Text;
QVBoxLayout *vLayout;
QTextEdit *Text;
};
#endif

View File

@ -24,7 +24,7 @@
#include <string>
#include <qmenubar.h>
#include <q3popupmenu.h>
#include <QMenu>
#include <qmessagebox.h>
#include <qlayout.h>
#include <qlabel.h>
@ -54,10 +54,10 @@ QucsFilter::QucsFilter()
// -------- create menubar -------------------
Q3PopupMenu *fileMenu = new Q3PopupMenu();
QMenu *fileMenu = new QMenu();
fileMenu->insertItem(tr("E&xit"), this, SLOT(slotQuit()), Qt::CTRL+Qt::Key_Q);
Q3PopupMenu *helpMenu = new Q3PopupMenu();
QMenu *helpMenu = new QMenu();
helpMenu->insertItem(tr("Help..."), this, SLOT(slotHelpIntro()), Qt::Key_F1);
helpMenu->insertSeparator();
helpMenu->insertItem(