Skip to content

Commit

Permalink
Delete QT3_US_SUPPORT from all CMakesLists.txt
Browse files Browse the repository at this point in the history
SET( QT_USE_QT3SUPPORT TRUE ) is delete from all CmakeLists.txt and adapting the souces, but "FIND_PACKAGE( Qt4 4.6.3 REQUIRED QtCore QtGui Qt3Support QtSvg QtXml QtScript)" in the root-CMakeLists.txt is unchanged. So Q3*-Header like Q3PtrList will not produce an error.
  • Loading branch information
global667 authored and guitorri committed Nov 27, 2014
1 parent 98be5ff commit 03090ed
Show file tree
Hide file tree
Showing 63 changed files with 360 additions and 315 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -204,3 +204,5 @@ Debug
#Others
CMakeScripts
*.cxx_parameters
shadow

2 changes: 1 addition & 1 deletion qucs/CMakeLists.txt
Expand Up @@ -48,7 +48,7 @@ SET( QT_USE_QT TRUE )
#SET( QT_USE_QTSVG TRUE )
SET( QT_USE_QTCORE TRUE )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QT3SUPPORT TRUE )

SET( QT_USE_QTSCRIPT TRUE )

SET( QT_DEBUG TRUE)
Expand Down
1 change: 0 additions & 1 deletion qucs/qucs-attenuator/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
#SET( QT_USE_QT3SUPPORT TRUE )

INCLUDE( ${QT_USE_FILE} )

Expand Down
1 change: 0 additions & 1 deletion qucs/qucs-edit/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
#SET( QT_USE_QT3SUPPORT TRUE )

INCLUDE( ${QT_USE_FILE} )

Expand Down
1 change: 0 additions & 1 deletion qucs/qucs-filter/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QT3SUPPORT TRUE )

INCLUDE( ${QT_USE_FILE} )

Expand Down
2 changes: 1 addition & 1 deletion qucs/qucs-help/CMakeLists.txt
Expand Up @@ -35,7 +35,7 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QT3SUPPORT TRUE )


INCLUDE( ${QT_USE_FILE} )

Expand Down
19 changes: 10 additions & 9 deletions qucs/qucs-help/htmldatafetcher.cpp
Expand Up @@ -21,6 +21,7 @@
#include <QMimeData>
#include <QTextStream>
#include <QDebug>
#include <QTextCodec>

HtmlDataFetcher::HtmlDataFetcher()
{
Expand Down Expand Up @@ -317,7 +318,7 @@ QStringList HtmlDataFetcher::fetchChapterTexts(const QString &indexFile)
QFile file(indexFile);
if(!file.open(QIODevice::ReadOnly))
{
qWarning("HtmlDataFetcher::fetchChapterTexts() : Can't open file %s",indexFile.latin1());
qWarning("HtmlDataFetcher::fetchChapterTexts() : Can't open file %s",indexFile.toLatin1().data());
return retVal;
}

Expand All @@ -335,18 +336,18 @@ QStringList HtmlDataFetcher::fetchChapterTexts(const QString &indexFile)
if(inText == false)
{
txt = "";
int index = line.find("href=\"");
int index = line.indexOf("href=\"");
if(index == -1 || line.contains("http") || line.contains("mailto"))
continue;
index += 6;
index = line.find('>',index);
index = line.indexOf('>',index);
if(index == -1)
{
qWarning("HtmlDataFetcher::fetchChapterTexts() : Parse error");
return retVal;
}
++index;
int end = line.find("</a>",index);
int end = line.indexOf("</a>",index);
if(end != -1)
{
txt = line.mid(index,end-index);
Expand All @@ -362,7 +363,7 @@ QStringList HtmlDataFetcher::fetchChapterTexts(const QString &indexFile)
}
else
{
int end = line.find("</a>");
int end = line.indexOf("</a>");
if(end == -1)
txt += line + ' ';
else
Expand Down Expand Up @@ -397,11 +398,11 @@ QStringList HtmlDataFetcher::fetchLinksToFiles(const QString &indexFile)
line = str.readLine();
if(line.contains("http") || line.contains("mailto"))
continue;
index = line.find("href=\"");//find link to other file
index = line.indexOf("href=\"");//find link to other file
if(index != -1)
{
index += 6;
end = line.find('"',index);
end = line.indexOf('"',index);
if(end == -1)
{
qWarning("HtmlDataFetcher::fetchLinksToFiles() : Can't find end quote. May be HTML error");
Expand All @@ -422,10 +423,10 @@ void HtmlDataFetcher::formatAndReplace(QString &txt)

while(1)
{
st = txt.find('&');
st = txt.indexOf('&');
if(st == -1)
return;
end = txt.find(';',st);
end = txt.indexOf(';',st);
if(end == -1)
{
qWarning("HtmlDataFetcher::formatAndReplace() : Can't find ';'");
Expand Down
14 changes: 7 additions & 7 deletions qucs/qucs-help/main.cpp
Expand Up @@ -48,7 +48,7 @@ bool loadSettings()
{
bool result = true;

QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/helprc"));
QFile file(QDir::homePath()+QDir::convertSeparators ("/.qucs/helprc"));
if(!file.open(QIODevice::ReadOnly))
result = false; // settings file doesn't exist
else {
Expand All @@ -68,7 +68,7 @@ bool loadSettings()
file.close();
}

file.setName(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/qucsrc"));
file.setFileName(QDir::homePath()+QDir::convertSeparators ("/.qucs/qucsrc"));
if(!file.open(QIODevice::ReadOnly))
result = true; // qucs settings not necessary
else {
Expand All @@ -77,7 +77,7 @@ bool loadSettings()
while(!stream.atEnd()) {
Line = stream.readLine();
Setting = Line.section('=',0,0);
Line = Line.section('=',1,1).stripWhiteSpace();
Line = Line.section('=',1,1).trimmed();
if(Setting == "Font")
QucsSettings.font.fromString(Line);
else if(Setting == "Language")
Expand All @@ -99,7 +99,7 @@ bool saveApplSettings(QucsHelp *qucs)
return true; // nothing has changed


QFile file(QDir::homeDirPath()+QDir::convertSeparators ("/.qucs/helprc"));
QFile file(QDir::homePath()+QDir::convertSeparators ("/.qucs/helprc"));
if(!file.open(QIODevice::WriteOnly)) {
QMessageBox::warning(0, QObject::tr("Warning"),
QObject::tr("Cannot save settings !"));
Expand Down Expand Up @@ -188,14 +188,14 @@ int main(int argc, char *argv[])
QTranslator tor( 0 );
QString locale = QucsSettings.Language;
if(locale.isEmpty())
locale = QTextCodec::locale();
locale = QString(QLocale::system().name());

tor.load( QString("qucs_") + locale, QucsSettings.LangDir);
a.installTranslator( &tor );

QucsHelpDir = QucsSettings.DocDir + locale;
if (!QucsHelpDir.exists () || !QucsHelpDir.isReadable ()) {
int p = locale.find ('_');
int p = locale.indexOf ('_');
if (p != -1) {
QucsHelpDir = QucsSettings.DocDir + locale.left (p);
if (!QucsHelpDir.exists () || !QucsHelpDir.isReadable ()) {
Expand All @@ -211,7 +211,7 @@ int main(int argc, char *argv[])
qInstallMsgHandler(qucsMessageOutput);

QucsHelp *qucs = new QucsHelp(Page);
a.setMainWidget(qucs);
//a.setMainWidget(qucs);
qucs->resize(QucsSettings.dx, QucsSettings.dy); // size and position ...
qucs->move(QucsSettings.x, QucsSettings.y); // ... before "show" !!!
qucs->show();
Expand Down
99 changes: 66 additions & 33 deletions qucs/qucs-help/qucshelp.cpp
Expand Up @@ -47,7 +47,7 @@ QucsHelp::QucsHelp(const QString& page)
#ifndef __APPLE__
setWindowIcon (QPixmap(":/bitmaps/big.qucs.xpm"));
#endif
setCaption(tr("Qucs Help System"));
setWindowTitle(tr("Qucs Help System"));

textBrowser = new TextBrowser(this);
textBrowser->setMinimumSize(400,200);
Expand All @@ -67,7 +67,7 @@ QucsHelp::~QucsHelp()

void QucsHelp::setupActions()
{
QToolBar *toolbar = new QToolBar(this,"main_toolbar");
QToolBar *toolbar = new QToolBar("main_toolbar",this);

this->addToolBar(toolbar);

Expand All @@ -76,20 +76,34 @@ void QucsHelp::setupActions()
const QKeySequence ks = QKeySequence();

QAction *quitAction = new QAction(QIcon((":/bitmaps/quit.png")),
tr("&Quit"), (const QKeySequence&)Qt::CTRL+Qt::Key_Q, this,"");
tr("&Quit"), this);
quitAction->setShortcut((const QKeySequence&)Qt::CTRL+Qt::Key_Q);

QAction *backAction = new QAction(QIcon((":/bitmaps/back.png")),
tr("&Back"), Qt::ALT+Qt::Key_Left, this,"");
tr("&Back"), this);
backAction->setShortcut( Qt::ALT+Qt::Key_Left);


QAction *forwardAction = new QAction(QIcon((":/bitmaps/forward.png")),
tr("&Forward"), Qt::ALT+Qt::Key_Right, this,"");
tr("&Forward"), this);
forwardAction->setShortcut(Qt::ALT+Qt::Key_Right);

QAction *homeAction = new QAction(QIcon((":/bitmaps/home.png")),
tr("&Home"),Qt::CTRL+Qt::Key_H,this,"");
tr("&Home"),this);
homeAction->setShortcut(Qt::CTRL+Qt::Key_H);

previousAction = new QAction(QIcon((":/bitmaps/previous.png")),tr("&Previous"),
ks, this,"");
this);
previousAction->setShortcut( ks);

nextAction = new QAction(QIcon((":/bitmaps/next.png")),
tr("&Next"), ks, this,"");
viewBrowseDock = new QAction(tr("&Table of Contents"), 0, this,"");
viewBrowseDock->setToggleAction(true);
viewBrowseDock->setOn(true);
tr("&Next"), this);
nextAction->setShortcut( ks);

viewBrowseDock = new QAction(tr("&Table of Contents"), this);

viewBrowseDock->setCheckable(true);
viewBrowseDock->setChecked(true);
viewBrowseDock->setStatusTip(tr("Enables/disables the table of contents"));
viewBrowseDock->setWhatsThis(tr("Table of Contents\n\nEnables/disables the table of contents"));

Expand All @@ -109,34 +123,53 @@ void QucsHelp::setupActions()
connect(nextAction,SIGNAL(activated()),this,SLOT(nextLink()));
connect(viewBrowseDock, SIGNAL(toggled(bool)), SLOT(slotToggleSidebar(bool)));

backAction->addTo(toolbar);
forwardAction->addTo(toolbar);
//backAction->addTo(toolbar);
toolbar->addAction(backAction);
//forwardAction->addTo(toolbar);
toolbar->addAction(forwardAction);
toolbar->addSeparator();
homeAction->addTo(toolbar);
previousAction->addTo(toolbar);
nextAction->addTo(toolbar);
//homeAction->addTo(toolbar);
toolbar->addAction(homeAction);
//previousAction->addTo(toolbar);
toolbar->addAction(previousAction);
//nextAction->addTo(toolbar);
toolbar->addAction(nextAction);
toolbar->addSeparator();
quitAction->addTo(toolbar);
//quitAction->addTo(toolbar);
toolbar->addAction(quitAction);

QMenu *fileMenu = new QMenu(this);
quitAction->addTo(fileMenu);
//quitAction->addTo(fileMenu);
fileMenu->addAction(quitAction);

QMenu *viewMenu = new QMenu(this);
backAction->addTo(viewMenu);
forwardAction->addTo(viewMenu);
homeAction->addTo(viewMenu);
previousAction->addTo(viewMenu);
nextAction->addTo(viewMenu);
viewMenu->insertSeparator();
viewBrowseDock->addTo(viewMenu);
//backAction->addTo(viewMenu);
viewMenu->addAction(backAction);
//forwardAction->addTo(viewMenu);
viewMenu->addAction(forwardAction);

//homeAction->addTo(viewMenu);
viewMenu->addAction(homeAction);

//previousAction->addTo(viewMenu);
viewMenu->addAction(previousAction);

//nextAction->addTo(viewMenu);
viewMenu->addAction(nextAction);

//viewMenu->insertSeparator();
viewMenu->addSeparator();

//viewBrowseDock->addTo(viewMenu);


QMenu *helpMenu = new QMenu(this);
helpMenu->insertItem(tr("&About Qt"),qApp,SLOT(aboutQt()));
helpMenu->addAction(tr("&About Qt"),qApp,SLOT(aboutQt()));

bar->insertItem(tr("&File"), fileMenu );
bar->insertItem(tr("&View"),viewMenu);
bar->insertSeparator();
bar->insertItem(tr("&Help"),helpMenu);
bar->addMenu(new QMenu(tr("&File"), fileMenu));
bar->addMenu(new QMenu(tr("&View"),viewMenu));
bar->addSeparator();
bar->addMenu(new QMenu(tr("&Help"),helpMenu));
}

void QucsHelp::createSidebar()
Expand Down Expand Up @@ -183,7 +216,7 @@ void QucsHelp::slotSourceChanged(const QUrl & _str)
{
QString str = _str.toString();
// Remove '#*' chars in link since we don't check '#top,etc' while tracking previous actions
int hashPos = str.findRev('#');
int hashPos = str.lastIndexOf('#');
if(hashPos != -1)
str = str.left(hashPos);
// Don't do anything if accessing same page
Expand Down Expand Up @@ -219,7 +252,7 @@ void QucsHelp::slotSourceChanged(const QUrl & _str)
{
textBrowser->setSource(QucsHelpDir.filePath(links[0]));
currentSource = QucsHelpDir.filePath(links[0]);
qDebug("QucsHelp::slotSourceChanged(): Link mismatch \n Link: %s",str.ascii());
qDebug("QucsHelp::slotSourceChanged(): Link mismatch \n Link: %s",str.toAscii().data());
}
else
currentSource = str;
Expand Down Expand Up @@ -249,6 +282,6 @@ void QucsHelp::slotToggleSidebar(bool b)
void QucsHelp::slotToggleSidebarAction(bool b)
{
viewBrowseDock->blockSignals(true);
viewBrowseDock->setOn(b);
viewBrowseDock->setChecked(b);
viewBrowseDock->blockSignals(false);
}
1 change: 0 additions & 1 deletion qucs/qucs-lib/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
#SET( QT_USE_QT3SUPPORT TRUE )

INCLUDE( ${QT_USE_FILE} )

Expand Down
1 change: 0 additions & 1 deletion qucs/qucs-rescodes/CMakeLists.txt
Expand Up @@ -35,7 +35,6 @@ INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")

FIND_PACKAGE( Qt4 REQUIRED )
SET( QT_USE_QTGUI TRUE )
SET( QT_USE_QT3SUPPORT TRUE )

INCLUDE( ${QT_USE_FILE} )

Expand Down
10 changes: 7 additions & 3 deletions qucs/qucs-rescodes/helpdialog.cpp
Expand Up @@ -26,9 +26,9 @@ email : sudhakar.m.kumar@gmail.com


HelpDialog::HelpDialog(QWidget *parent)
: QDialog(parent, 0, false, Qt::WDestructiveClose)
: QDialog(parent/*, 0, false, Qt::WDestructiveClose*/)
{
setCaption("Resistance color codes help");
setWindowTitle("Resistance color codes help");


// -------- set help text into dialog ------------
Expand All @@ -51,7 +51,11 @@ HelpDialog::HelpDialog(QWidget *parent)
vLayout = new QVBoxLayout(this);

Text = new QTextEdit(s, this);
Text->setTextFormat(Qt::PlainText);

#pragma message "Do this way?"
Text->setAcceptRichText(false);
//Text->setTextFormat(Qt::PlainText);

Text->setReadOnly(true);
Text->setMinimumSize(200,200);
vLayout->addWidget(Text);
Expand Down

0 comments on commit 03090ed

Please sign in to comment.