[Kst] branches/work/kst/portto4/kst
Barth Netterfield
netterfield at astro.utoronto.ca
Thu Jul 23 02:29:57 CEST 2009
SVN commit 1001361 by netterfield:
Update bug lists.
Fixes for printing (seems pretty good now)
M +8 -26 devel-docs/Kst2Specs/Bugs
M +27 -0 devel-docs/Kst2Specs/FixedBugs
M +26 -7 devel-docs/Kst2Specs/Wishlist
M +30 -17 src/libkstapp/mainwindow.cpp
M +0 -8 src/libkstapp/plotaxis.cpp
M +0 -3 src/libkstapp/plotaxis.h
M +12 -8 src/libkstapp/plotitem.cpp
M +2 -2 src/libkstapp/plotitem.h
M +1 -11 src/libkstapp/viewitem.cpp
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Bugs #1001360:1001361
@@ -1,4 +1,3 @@
-------------
Plot sizes are not properly recovered on re-load
Create a plot in kst. Cleanup Layout->automatic
-the plot now ~fills the window.
@@ -9,39 +8,22 @@
** it is now much better than it used to be. The shift is now only a few pixels **
** low priority **
-------------
-Only absolute file names seem to work.
- -data source text box doesn't recognise initial ~ as a euphemism for
- the user's home directory.
-Note: Resolve symlinks is turned on, but ~ is not processed by QDirModel completer.
- -[cbn: under linux, relative file names don't seem to work at all.]
+--------------------
-------------------------------
+Drawing a circle places it behind plots. It should be in front!
-USAGE() does not exit cleanly, so there are issues under windows:
- For the « kst --help » I first get the message
-“Runtime Error! Program: c:\Program\klst\bin\kst.exe This application has requested the runtim to terminate it in an unusual way. Please contact the application’s support team for more information.”
-
-Then kst closes and and I get the help in the console (cygwin) in the windows cmd.exe I don’t get any help…
-
--------------------
-Showstopper printing problems: - 2.0 needs these fixed. otherwise, another beta :-(
+Problem resizing plots:
+resizing a plot from the top or left grip points blanks out part of the plot.
+Using the bottom right grip does not.
-Labels in Print to file are not vector quality... they should be.
-This appears to be related to caching of labels...
-
-Increasing the printer resolution to "high resolution" solves this, at the expense of huge pdf files, and very
-slow print rendering. Printed files should be all vector, not cached pixmaps.
-
--------------------
-Line widths on the screen don't mean the same thing (visually) as they do on the printer. We need to come
-up with a reasonable definition. (currently, we mean 'pixels').
+Update ineffciency:
+One plot gets re-drawn twice in an update in PlotItem::updatePlotPixmap. (?)
-Line widths need a reasonable (sticky?) default.
-
--------------------
-Drawing a circle places it behind plots. It should be in front!
+Save as default should not default to checked in ascii configure dialog.
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/FixedBugs #1001360:1001361
@@ -1042,3 +1042,30 @@
is not shown, but it should be. If you leave data mode, then it is.
(behavior should be the same as 1.x).
+--------------------
+
+Showstopper printing problems: - 2.0 needs these fixed. otherwise, another beta :-(
+
+Labels in Print to file are not vector quality... they should be.
+This appears to be related to caching of labels...
+
+Increasing the printer resolution to "high resolution" solves this, at the expense of huge pdf files, and very
+slow print rendering. Printed files should be all vector, not cached pixmaps.
+
+------------------------------
+
+USAGE() does not exit cleanly, so there are issues under windows:
+ For the « kst --help » I first get the message
+“Runtime Error! Program: c:\Program\klst\bin\kst.exe This application has requested the runtim to terminate it in an unusual way. Please contact the application’s support team for more information.”
+
+Then kst closes and and I get the help in the console (cygwin) in the windows cmd.exe I don’t get any help…
+
+---------------------
+
+
+When a new plot is added to an tab which already has plots in it (eg, from the Placement widget),
+then the label font sizes should be based on the label font sizes of the plots already in the tab.
+(either 'vote' or use the first one).
+All font properties replicated. Use the first one.
+
+--------
--- branches/work/kst/portto4/kst/devel-docs/Kst2Specs/Wishlist #1001360:1001361
@@ -1,10 +1,3 @@
-
-When a new plot is added to an tab which already has plots in it (eg, from the Placement widget),
-then the label font sizes should be based on the label font sizes of the plots already in the tab.
-(either 'vote' or use the first one).
-All font properties replicated. Use the first one.
-
---------
Easier way to specify reversed axis when loading sky images:
-can desire to reverse be gleaned from the fits image?
-command line option?
@@ -45,3 +38,29 @@
--------
+Multi-page printing:
+The code is in place and commented out, because it gets the size wrong for pages other than the current tab.
+This bug is also hit in the export widget.
+
+--------
+
+Export eps to vector format.
+
+--------
+
+Reasonable/sticky defaults for the export dialog.
+
+--------
+
+Reasonable/sticky defaults for line widths, and the ability to set grid line linewidths.
+
+------------
+
+ -data source text box doesn't recognise initial ~ as a euphemism for
+ the user's home directory (QDirModel doesn't handle this...)
+
+------------
+
+1.x kst file read compatibility...
+
+
--- branches/work/kst/portto4/kst/src/libkstapp/mainwindow.cpp #1001360:1001361
@@ -289,11 +289,14 @@
void MainWindow::print() {
+ // line widths in pixels make sense when using ScreenResolution
+ // FIXME: come up with a better definition of line width!
QPrinter printer(QPrinter::ScreenResolution);
+ //QPrinter printer(QPrinter::HighResolution);
QPrintDialog pd(&printer, this);
- pd.addEnabledOption(QPrintDialog::PrintToFile);
- pd.addEnabledOption(QPrintDialog::PrintPageRange);
+ pd.setOption(QPrintDialog::PrintToFile);
+ pd.setOption(QPrintDialog::PrintPageRange, false);
if (pd.exec() == QDialog::Accepted) {
@@ -301,29 +304,39 @@
QPainter painter(&printer);
QList<View*> pages;
- switch (printer.printRange()) {
- case QPrinter::PageRange:
- break;
- case QPrinter::AllPages:
- foreach (View *view, _tabWidget->views()) {
- pages.append(view);
- }
- break;
- case QPrinter::Selection:
- default:
- pages.append(_tabWidget->currentView());
- break;
- }
+ // FIXME: multi-page printing doesn't work. Fix it, then re-enable...
+// switch (printer.printRange()) {
+// case QPrinter::PageRange:
+// if (printer.fromPage()>0) {
+// for (int i_page = printer.fromPage(); i_page<=printer.toPage(); i_page++) {
+// pages.append(_tabWidget->views().at(i_page-1));
+// }
+// }
+// break;
+// case QPrinter::AllPages:
+// foreach (View *view, _tabWidget->views()) {
+// pages.append(view);
+// }
+// break;
+// case QPrinter::Selection:
+// default:
+// pages.append(_tabWidget->currentView());
+// break;
+// }
+ pages.append(_tabWidget->currentView()); // FIXME: remove once above is fixed.
+
+ QSize printerPageSize = printer.pageRect().size();
for (int i = 0; i < printer.numCopies(); ++i) {
for (int i_page = 0; i_page<pages.count(); i_page++) {
View *view = pages.at(i_page);
QSize currentSize(view->size());
- view->resize(printer.pageRect().size());
+ view->resize(printerPageSize);
view->setPrinting(true);
view->render(&painter);
view->setPrinting(false);
view->resize(currentSize);
- if (i_page<pages.count()-1) printer.newPage();
+ if (i_page<pages.count()-1)
+ printer.newPage();
}
}
--- branches/work/kst/portto4/kst/src/libkstapp/plotaxis.cpp #1001360:1001361
@@ -912,8 +912,6 @@
num = QString::number(offset, 'g', 5);
}
- ConvertScientificNotation(num);
-
label = label + num + "]";
_axisLabels.insert(i.key(), label);
}
@@ -1134,12 +1132,6 @@
return validTag;
}
-void ConvertScientificNotation(QString &num) {
- //num.replace(QRegExp(".0?[eE][+]0?([1-9]?\\d?)$"), "x10^{\\1}");
- //num.replace(QRegExp(".0?[eE][-]0?([1-9]?\\d?)$"), "x10^{-\\1}");
}
-
-}
-
// vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkstapp/plotaxis.h #1001360:1001361
@@ -19,9 +19,6 @@
namespace Kst {
-
-void ConvertScientificNotation(QString &num); // FIXME: should be somewhere else (?)
-
class PlotAxis : public QObject
{
Q_OBJECT
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.cpp #1001360:1001361
@@ -669,16 +669,20 @@
QTime bench_time;
bench_time.start();
#endif
- if (_plotPixmapDirty && rect().isValid()) {
- updatePlotPixmap();
- }
+ if (parentView()->isPrinting()) {
+ paintPixmap(painter);
+ } else {
+ if (_plotPixmapDirty && rect().isValid()) {
+ updatePlotPixmap();
+ }
- painter->save();
- painter->setPen(Qt::NoPen);
- painter->drawRect(rect());
- painter->restore();
+ painter->save();
+ painter->setPen(Qt::NoPen);
+ painter->drawRect(rect());
+ painter->restore();
- painter->drawPixmap(QPointF(0, 0), _plotPixmap);
+ painter->drawPixmap(QPointF(0, 0), _plotPixmap);
+ }
#if BENCHMARK
int i = bench_time.elapsed();
qDebug() << "Total Time to paint " << (void *)this << ": " << i << "ms" << endl;
--- branches/work/kst/portto4/kst/src/libkstapp/plotitem.h #1001360:1001361
@@ -309,8 +309,8 @@
void setBottomLabelDirty() { _bottomLabel.dirty = true; setPlotPixmapDirty(); }
void setLabelsDirty() { _leftLabel.dirty = true; _rightLabel.dirty = true; _topLabel.dirty = true; _bottomLabel.dirty = true; setPlotPixmapDirty(); }
- void setPlotPixmapDirty() { _plotPixmapDirty = true; }
- void setAxisLabelsDirty() { _axisLabelsDirty = true; }
+ void setPlotPixmapDirty(bool dirty = true) { _plotPixmapDirty = dirty; }
+ void setAxisLabelsDirty(bool dirty = true) { _axisLabelsDirty = dirty; }
private:
void createActions();
--- branches/work/kst/portto4/kst/src/libkstapp/viewitem.cpp #1001360:1001361
@@ -450,7 +450,6 @@
if (viewItem->hasStaticGeometry())
continue;
-
viewItem->setSkipNextParentCheck(true);
viewItem->updateChildGeometry(oldViewRect, viewRect);
}
@@ -1098,7 +1097,6 @@
void ViewItem::setTopLeft(const QPointF &point) {
-// qDebug() << "setTopLeft" << point << endl;
QPointF p = point;
QPointF anchor = selectTransform().map(rect().bottomRight());
@@ -1114,7 +1112,6 @@
void ViewItem::setTopRight(const QPointF &point) {
-// qDebug() << "setTopRight" << point << endl;
QPointF p = point;
QPointF anchor = selectTransform().map(rect().bottomLeft());
@@ -1130,7 +1127,6 @@
void ViewItem::setBottomLeft(const QPointF &point) {
-// qDebug() << "setBottomLeft" << point << endl;
QPointF p = point;
QPointF anchor = selectTransform().map(rect().topRight());
@@ -1146,7 +1142,6 @@
void ViewItem::setBottomRight(const QPointF &point) {
-// qDebug() << "setBottomRight" << point << endl;
QPointF p = point;
QPointF anchor = selectTransform().map(rect().topLeft());
@@ -1177,7 +1172,6 @@
void ViewItem::setBottom(qreal y) {
-// qDebug() << "setBottom" << x << endl;
QPointF anchor = selectTransform().map(rect().topLeft());
@@ -1192,7 +1186,6 @@
void ViewItem::setLeft(qreal x) {
-// qDebug() << "setLeft" << x << endl;
QPointF anchor = selectTransform().map(rect().topRight());
@@ -1207,7 +1200,6 @@
void ViewItem::setRight(qreal x) {
-// qDebug() << "setRight" << x << endl;
QPointF anchor = selectTransform().map(rect().topLeft());
@@ -1250,8 +1242,6 @@
return false;
}
-// qDebug() << "Mapping from " << from << "to" << to << endl;
-
QPolygonF from_(from);
from_.pop_back(); //get rid of last closed point
QPolygonF to_(to);
@@ -1508,7 +1498,7 @@
_parentRelativeWidth = 0;
_parentRelativeCenter = QPointF(0, 0);
_parentRelativePosition = QPointF(0, 0);
- }
+ }
}
More information about the Kst
mailing list