|
From: Mojca M. <moj...@gm...> - 2012-01-08 16:45:14
|
(I'm renaming the thread from "[ gnuplot-Bugs-3468950 ] Qt, moc and
uic not found on Mac OS X" since I have made it so long and the
discussion has departed from moc/uic long time ago already.)
Dear Jérôme,
I would like to sincerely thank you for the patches you sent me. It
seems that the terminal finally works normally now.
2012/1/8 Jérôme Lodewyck wrote:
> Hi,
>
> what about this new patch ? (I'm not even sure it compiles, because it
> makes use of the cocoa API which I cannot test here)
I had to replace Cocoa/Cocoa.h with Carbon/Carbon.h. Import of Cocoa
doesn't work and I have no idea why (maybe because it is in Objective
C and some compiler flags bail?). I also have no idea how safe it is
to use Carbon, but apparently it worked this time.
Now there are still two windows popping up, but the first one gets
closed soon afterwards and the second one gets a gnuplot icon. So it
only remains a matter of neglegible cosmetic issue (it would be better
not to display the first window at all, but it is perfectly fine the
way it is working now). If it works fine on other operating systems,
this might be the solution to go for and if it ever turns out in
future that forking is not needed or that there is a better proposal
for communication with Qt, it can be changed at any later time.
Here is what gets written out when I start plotting:
> plot sin(x)
qt_init() ""
execGnuplotQt()
Remove the application icon fom the MAC OS X dock
qt_connectToServer "qtgnuplot42894" false
I can now also quit the Qt window which prints out:
> Quit application 42894 false
Qt terminal communication error: select() error 9 Bad file descriptor
gnuplot> plot cos(x)
qt_connectToServer "qtgnuplot42894" false
Could not connect gnuplot_qt "" . Staring a new one
execGnuplotQt()
qt_connectToServer "qtgnuplot42895" false
gnuplot>
My only remaining question that is pretty relevant for the user
experience: How can I convince the cursor to stay in terminal (text
mode) after entering some plotting command (and optionally still make
the plotting window pop in front of the screen)?
If I load "all.dem", I have to keep switching back to terminal to be
able to hit enter to continue after a pause. In X11 that is not
necessary (but I don't know how gnuplot with X11 works on Linux).
Other, less important issues:
- Trivial change: I would like to request renaming "gnuplot_qt" window
into something more descriptive and more like human-readable
application name. Even if that is just "Gnuplot" or maybe some mention
of Qt.
- Printing doesn't work, but I would not bother about that now; it
might be pretty complex to make it work; it might also be trivial, but
it is of much lower priority now.
- Plot size for qt is 640x480, for x11 it is 640x463, for wxt it is
640x402, but default font size in Qt is some 20-30 % smaller than in
x11, and x11 also contains coordinates in lower left corner;
consequently plot size in qt is 593x456, while for x11 it is 584x415
(didn't measure for wxt); bottomline: in Qt the window looks somewhat
too high. Would it be possible to make it smaller in y direction?
(Optimally the same size as wxt, but it doesn't have to be that
strict.)
- I would prefer slightly bigger default font size, but that is just
me. On my screen numbers in Qt terminal are 7 pixels high and on 800
pixels/177 mm that makes each number 1.55 mm. (In my editor I use 11
pixels.) I don't know what others think of that since it highly
depends on monitor resolution and operating system and one may always
argue that it is configurable. It seems that font size is declared to
be 9pt (at least I get the same result if I try "set term qt font
',9'"), but it is 7 pixels high. Just to make it clear: it *is*
readable, it is extremely well hinted (it's not antialiased), but it
is a tiny bit too small. My favourite size would be 12 (which would
make numbers 9 pixels high). I don't know which font is being used by
default though.
- I'm able to set arbitrary background color and it is remembered.
However I cannot change plot size, font size somewhere in settings and
ask gnuplot/qt to remember that. That would be much more useful for me
than background color. (Yes, I know that I can always use "set term qt
<whatever> to do that, but that's not the point.")
- I would expect the files (see list on the bottom***) to end up under
src/qtterminal or some under src/qtterminal/trans and not under src,
but that is just cosmetics. That way it is also easier to list them in
.cvsignore (I don't use cvs and I don't know any tool to translate
.cvsignore into .gitignore automatically, so that doesn't affect me
directly).
- Feature request (not sure about it): I really like menu-based
commands in windows. So even newbies are able to figure out some
commands without having to read help. Do others think that this would
make sense in Qt terminal?
- Feature request: I would like to have zoom in & left/right sliding
using mouse gestures, but this is something that I need to investigate
myself based on Qt tutorials. In contrast to wxWidgets, Qt has native
support for them. This means that gnuplot should not only listen to
scrolling wheel, but also to other more advanced events.
- Bug report: clipping part of plot with mouse in backwards direction
(starting at some point and then moving up and/or left) is buggy. It
works (clips properly), but displays in a weird way and leaves some
weird traces. I can create a screenshot if others are unable to
reproduce it. Clipping into the fourth quadrant (from upper left to
lower right corner) works and displays as expected.
- Request: This is the same with all interactive terminals though: I
would like to see current terminal options listed somewhere. For
example:
> set term png
Terminal type set to 'png'
Could not find/open font when opening font "arial", using internal
non-scalable font
Options are 'nocrop medium size 640,480 '
> set term pdfcairo
Terminal type set to 'pdfcairo'
Options are ' transparent fontscale 0.5 size 5.00in, 3.00in '
but
> set term x11
Terminal type set to 'x11'
Options are ' nopersist'
> set term wxt
Terminal type set to 'wxt'
Options are '0'
> set term qt
Terminal type set to 'qt'
Options are '0'
I find the listed options very helpful to help me decide which options
are available and which ones are the default. (Now, if I want to
figure out current window size, I need to create a screenshot, exact
crop and ask for number of pixels.)
>> (I don't particularly like the fact that I now
>> have to install gnuplot before running it, but if that is what it
>> takes, so let it be.
>
> You don't have to install it. You can define the environment variable
> export GNUPLOT_DRIVER_DIR=./src/
> to point to the directory where the gnuplot_qt executable is.
Thank you for the information.
>
>> (Where should the image
>> from setWindowIcon(QIcon(":/images/gnuplot")); come from?)
>
> the image is in the src/qtterminal/images/ directory, and is included in the
> executable by qrc using the configuration file QtGnuplotResource.qrc
Oh, thank you. Now I understand how it works. I will also start a new
thread about the icon. On Mac OS X the icon size 32x32 is way too
small (see attachments on
https://sourceforge.net/tracker/?func=detail&aid=3469808&group_id=2055&atid=352055;
on Mac it is suggested to provide icons of size up to 512x512). I
would like to suggest creating an official vector icon. (I have one
gnuplot-generated proposal in PDF; manually generated SVG clone is
attached on the link above; another option would be creating a 3D
model with PovRay and I'm willing to help with that, but I would need
to know what you think of that.)
Mojca
*** files in src:
# src/QtGnuplotApplication.o
# src/QtGnuplotEvent.o
# src/QtGnuplotItems.o
# src/QtGnuplotScene.o
# src/QtGnuplotWidget.o
# src/QtGnuplotWindow.o
# src/moc_QtGnuplotApplication.cpp
# src/moc_QtGnuplotApplication.o
# src/moc_QtGnuplotEvent.cpp
# src/moc_QtGnuplotEvent.o
# src/moc_QtGnuplotScene.cpp
# src/moc_QtGnuplotScene.o
# src/moc_QtGnuplotWidget.cpp
# src/moc_QtGnuplotWidget.o
# src/moc_QtGnuplotWindow.cpp
# src/moc_QtGnuplotWindow.o
# src/qrc_QtGnuplotResource.cpp
# src/qrc_QtGnuplotResource.o
# src/qt_term.o
# src/qtgnuplot_fr.qm
# src/qtgnuplot_ja.qm
|