Removed even more QT3 stuff. Drag & Drop not 100% functional at the moment
authorinsilmaril
Thu Nov 23 16:18:26 2006 +0000 (2006-11-23)
changeset 4075db8dfd30ea2
parent 406 1c8ff1928b97
child 408 c2a05fa925a1
Removed even more QT3 stuff. Drag & Drop not 100% functional at the moment
mainwindow.cpp
mapeditor.cpp
mapeditor.h
xml.cpp
xml.h
     1.1 --- a/mainwindow.cpp	Thu Nov 23 13:53:08 2006 +0000
     1.2 +++ b/mainwindow.cpp	Thu Nov 23 16:18:26 2006 +0000
     1.3 @@ -940,7 +940,7 @@
     1.4      a = new QAction(QPixmap(iconPath+"history.png"),  tr( "Show history window","View action" ),this );
     1.5  	a->setStatusTip ( tr( "Show history window" ));
     1.6  	a->setShortcut ( Qt::CTRL + Qt::Key_H  );
     1.7 -	a->setToggleAction(false);
     1.8 +	a->setToggleAction(true);
     1.9      a->addTo( tb );
    1.10  	viewMenu->addAction (a);
    1.11      connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleHistory() ) );
    1.12 @@ -1614,7 +1614,7 @@
    1.13  	currentMapEditor()->reselect();
    1.14  
    1.15  	// Update actions to in menus and toolbars according to editor
    1.16 -	currentMapEditor()->updateActions();
    1.17 +	updateActions();
    1.18  }
    1.19  
    1.20  void Main::fileNew()
    1.21 @@ -3158,6 +3158,8 @@
    1.22  	MapEditor *me=currentMapEditor();
    1.23  	if (!me) return;
    1.24  
    1.25 +	historyWindow->setCaption (tr("History for %1").arg(currentMapEditor()->getFileName()));
    1.26 +
    1.27  	// updateActions is also called when NoteEditor is closed
    1.28  	actionViewToggleNoteEditor->setOn (textEditor->showWithMain());
    1.29  
     2.1 --- a/mapeditor.cpp	Thu Nov 23 13:53:08 2006 +0000
     2.2 +++ b/mapeditor.cpp	Thu Nov 23 16:18:26 2006 +0000
     2.3 @@ -1,7 +1,5 @@
     2.4  #include "mapeditor.h"
     2.5  
     2.6 -//#include <q3urloperator.h>
     2.7 -#include <q3paintdevicemetrics.h>
     2.8  #include <q3filedialog.h>
     2.9  
    2.10  #include <iostream>
    2.11 @@ -498,8 +496,8 @@
    2.12  	if (saveSel) cout << "    saveSel="<<saveSel->getSelectString().ascii()<<endl;
    2.13  	cout << "    ---------------------------"<<endl;
    2.14  
    2.15 +	setChanged();
    2.16  	mainWindow->updateHistory (undoSet);
    2.17 -	setChanged();
    2.18  	updateActions();
    2.19  }
    2.20  
    2.21 @@ -1208,9 +1206,7 @@
    2.22  		// e.g. (0,50,700,700) is upper part on A4
    2.23  		// see also /usr/lib/qt3/doc/html/coordsys.html
    2.24  
    2.25 -		Q3PaintDeviceMetrics metrics (printer);
    2.26 -
    2.27 -		double paperAspect = (double)metrics.width()   / (double)metrics.height();
    2.28 +		double paperAspect = (double)printer->width()   / (double)printer->height();
    2.29  		double   mapAspect = (double)totalBBox.width() / (double)totalBBox.height();
    2.30  
    2.31  		QRect mapRect=totalBBox;
    2.32 @@ -1266,11 +1262,11 @@
    2.33  		if (mapAspect>=paperAspect)
    2.34  		{
    2.35  			// Fit horizontally to paper width
    2.36 -			pp.setViewport(0,0, metrics.width(),(int)(metrics.width()/mapAspect) );	
    2.37 +			pp.setViewport(0,0, printer->width(),(int)(printer->width()/mapAspect) );	
    2.38  		}	else
    2.39  		{
    2.40  			// Fit vertically to paper height
    2.41 -			pp.setViewport(0,0,(int)(metrics.height()*mapAspect),metrics.height());	
    2.42 +			pp.setViewport(0,0,(int)(printer->height()*mapAspect),printer->height());	
    2.43  		}	
    2.44  
    2.45  		mapCanvas->drawArea(mapRect, &pp);	// draw Canvas to printer
    2.46 @@ -1509,8 +1505,8 @@
    2.47  	undoSet.setEntry ("/history/curStep",QString::number(curStep));
    2.48  	undoSet.writeSettings(histPath);
    2.49  
    2.50 +	updateActions();
    2.51  	mainWindow->updateHistory (undoSet);
    2.52 -	updateActions();
    2.53  
    2.54  	/* TODO remove testing
    2.55  	cout << "ME::redo() end\n";
    2.56 @@ -4081,7 +4077,7 @@
    2.57  			// Contains url to the img src in unicode16
    2.58  			QByteArray d = event->encodedData("application/x-moz-file-promise-url");
    2.59  			QString url = QString((const QChar*)d.data(),d.size()/2);
    2.60 -			fetchImage(url);
    2.61 +			//FIXME fetchImage(url);
    2.62              event->acceptProposedAction();
    2.63  			update=true;
    2.64  		} else if (event->mimeData()->hasUrls())
    2.65 @@ -4195,7 +4191,8 @@
    2.66  }
    2.67  
    2.68  
    2.69 -void MapEditor::imageDataFetched(const QByteArray &a, Q3NetworkOperation */*nop*/) 
    2.70 +//void MapEditor::imageDataFetched(const QByteArray &a, Q3NetworkOperation */*nop*/) 
    2.71 +/* FIXME not needed in QT4
    2.72  {
    2.73    if (!imageBuffer) imageBuffer = new QBuffer();
    2.74    if (!imageBuffer->isOpen()) {
    2.75 @@ -4238,3 +4235,5 @@
    2.76  	  this, SLOT(imageDataFetched(const QByteArray &, Q3NetworkOperation *)));
    2.77    urlOperator->get();
    2.78  }
    2.79 +
    2.80 +*/
     3.1 --- a/mapeditor.h	Thu Nov 23 13:53:08 2006 +0000
     3.2 +++ b/mapeditor.h	Thu Nov 23 16:18:26 2006 +0000
     3.3 @@ -10,8 +10,6 @@
     3.4  #include "selection.h"
     3.5  #include "settings.h"
     3.6  
     3.7 -class Q3NetworkOperation;
     3.8 -class Q3UrlOperator;
     3.9  
    3.10  class MapEditor : public Q3CanvasView , public xmlObj {
    3.11      Q_OBJECT
    3.12 @@ -39,9 +37,9 @@
    3.13      void addFloatImageInt(const QPixmap &img);
    3.14  
    3.15    private slots:
    3.16 -    void fetchImage(const QString &img);
    3.17 -    void imageDataFetched(const QByteArray &, Q3NetworkOperation *);
    3.18 -    void imageDataFinished(Q3NetworkOperation *);
    3.19 +//FIXME not needed QT4    void fetchImage(const QString &img);
    3.20 +//FIXME not needed QT4    void imageDataFetched(const QByteArray &, Q3NetworkOperation *);
    3.21 +//FIXME not needed QT4    void imageDataFinished(Q3NetworkOperation *);
    3.22  
    3.23  public:
    3.24  	void toggleHistoryWindow();
     4.1 --- a/xml.cpp	Thu Nov 23 13:53:08 2006 +0000
     4.2 +++ b/xml.cpp	Thu Nov 23 16:18:26 2006 +0000
     4.3 @@ -1,8 +1,8 @@
     4.4  #include "xml.h"
     4.5  
     4.6 -#include <qmessagebox.h>
     4.7 -#include <qcolor.h>
     4.8 -#include <q3stylesheet.h>
     4.9 +#include <QMessageBox>
    4.10 +#include <QColor>
    4.11 +// #include <q3stylesheet.h>
    4.12  #include <QTextStream>
    4.13  #include <iostream>
    4.14  
    4.15 @@ -527,6 +527,8 @@
    4.16  			lines += stream.readLine()+"\n"; 
    4.17  		}
    4.18  		file.close();
    4.19 +
    4.20 +		/* TODO very likely not needed any longer
    4.21  		// Convert to richtext
    4.22  		if ( !Q3StyleSheet::mightBeRichText( lines ) )
    4.23  		{
    4.24 @@ -535,9 +537,11 @@
    4.25  			// for the parser, but just <p> and <br> without closing tags.
    4.26  			// So we have to add those by ourselves
    4.27  			//lines=quotemeta (lines);
    4.28 +			qWarning ("xml.cpp: Still using Q3StyleSheet::mightBeRichText");
    4.29  			lines = Q3StyleSheet::convertFromPlainText( lines, Q3StyleSheetItem::WhiteSpaceNormal );
    4.30  			lines.replace ("<br>","<br />");
    4.31  		}	
    4.32 +		*/
    4.33  
    4.34  		lines ="<html><head><meta name=\"qrichtext\" content=\"1\" /></head><body>"+lines + "</p></body></html>";
    4.35  		no.setNote (lines);
     5.1 --- a/xml.h	Thu Nov 23 13:53:08 2006 +0000
     5.2 +++ b/xml.h	Thu Nov 23 16:18:26 2006 +0000
     5.3 @@ -1,9 +1,9 @@
     5.4 -#ifndef XLM_H
     5.5 -#define XLM_H
     5.6 +#ifndef XML_H
     5.7 +#define XML_H
     5.8  
     5.9  
    5.10 -#include <qstring.h>
    5.11 -#include <qxml.h>
    5.12 +#include <QString>
    5.13 +#include <QXmlAttributes>
    5.14  
    5.15  #include "file.h"
    5.16  #include "mapcenterobj.h"