changeset 26610:60137713f001

test qt instead of fltk graphics (bug #55546) * graphics.cc, uimenu.m, allchild.m, findall.m, graphics_toolkit.m: Use qt toolkit instead of fltk in graphics tests.
author John W. Eaton <jwe@octave.org>
date Wed, 23 Jan 2019 19:08:01 +0000
parents eaebee6d4f56
children 1d03bc0d53f3
files libinterp/corefcn/graphics.cc scripts/gui/uimenu.m scripts/plot/util/allchild.m scripts/plot/util/findall.m scripts/plot/util/graphics_toolkit.m
diffstat 5 files changed, 24 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/graphics.cc	Wed Jan 23 09:06:13 2019 -0800
+++ b/libinterp/corefcn/graphics.cc	Wed Jan 23 19:08:01 2019 +0000
@@ -5082,9 +5082,9 @@
 }
 
 /*
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
 %! hf = figure ("visible", "off");
-%! graphics_toolkit (hf, "fltk");
+%! graphics_toolkit (hf, "qt");
 %! unwind_protect
 %!   subplot(2,1,1); plot(rand(10,1)); subplot(2,1,2); plot(rand(10,1));
 %!   hax = findall (gcf (), "type", "axes");
@@ -5102,9 +5102,9 @@
 %!   close (hf);
 %! end_unwind_protect
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
 %! hf = figure ("visible", "off");
-%! graphics_toolkit (hf, "fltk");
+%! graphics_toolkit (hf, "qt");
 %! fpos = get (hf, "position");
 %! unwind_protect
 %!   plot (rand (3));
@@ -5122,9 +5122,9 @@
 %!   close (hf);
 %! end_unwind_protect
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
 %! hf = figure ("visible", "off");
-%! graphics_toolkit (hf, "fltk");
+%! graphics_toolkit (hf, "qt");
 %! fpos = get (hf, "position");
 %! set (gca, "activepositionproperty", "position");
 %! unwind_protect
@@ -11832,8 +11832,9 @@
 %! setappdata (gcbf (), "cb_exec", [getappdata(gcbf (), "cb_exec") h]);
 %!endfunction
 %!
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
 %! hf = figure ("visible", "off", "resizefcn", @cb);
+%! graphics_toolkit (hf, "qt");
 %! unwind_protect
 %!   ## Default
 %!   hui1 = uicontrol ("parent", hf, "interruptible", "on", "callback", @cb);
--- a/scripts/gui/uimenu.m	Wed Jan 23 09:06:13 2019 -0800
+++ b/scripts/gui/uimenu.m	Wed Jan 23 19:08:01 2019 +0000
@@ -106,8 +106,8 @@
 %! uimenu (f, 'label', 'Close', 'accelerator', 'q', 'callback', 'close (gcf)');
 %! uimenu (e, 'label', 'Toggle &Grid', 'accelerator', 'g', 'callback', 'grid (gca)');
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("fltk");
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
+%! toolkit = graphics_toolkit ("qt");
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   ui = uimenu ("label", "mylabel");
@@ -116,15 +116,15 @@
 %!   assert (get (ui, "checked"), "off");
 %!   assert (get (ui, "separator"), "off");
 %!   assert (get (ui, "enable"), "on");
-%!   assert (get (ui, "position"), 0);
+%!   assert (get (ui, "position"), 4);
 %! unwind_protect_cleanup
 %!   close (hf);
 %!   graphics_toolkit (toolkit);
 %! end_unwind_protect
 
 ## check for top level menus file and edit
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("fltk");
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
+%! toolkit = graphics_toolkit ("qt");
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   uif = findall (hf, "label", "&file");
@@ -136,8 +136,8 @@
 %!   graphics_toolkit (toolkit);
 %! end_unwind_protect
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("fltk");
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
+%! toolkit = graphics_toolkit ("qt");
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   uie = findall (hf, "label", "&edit");
--- a/scripts/plot/util/allchild.m	Wed Jan 23 09:06:13 2019 -0800
+++ b/scripts/plot/util/allchild.m	Wed Jan 23 19:08:01 2019 +0000
@@ -48,8 +48,8 @@
 endfunction
 
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("fltk");
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
+%! toolkit = graphics_toolkit ("qt");
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   l = line;
--- a/scripts/plot/util/findall.m	Wed Jan 23 09:06:13 2019 -0800
+++ b/scripts/plot/util/findall.m	Wed Jan 23 19:08:01 2019 +0000
@@ -50,8 +50,8 @@
 endfunction
 
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
-%! toolkit = graphics_toolkit ("fltk");
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
+%! toolkit = graphics_toolkit ("qt");
 %! hf = figure ("visible", "off");
 %! unwind_protect
 %!   h = findall (hf);
--- a/scripts/plot/util/graphics_toolkit.m	Wed Jan 23 09:06:13 2019 -0800
+++ b/scripts/plot/util/graphics_toolkit.m	Wed Jan 23 19:08:01 2019 +0000
@@ -102,23 +102,22 @@
 
 endfunction
 
-
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("qt", available_graphics_toolkits ()))
 %! unwind_protect
 %!   hf = figure ("visible", "off");
 %!   toolkit = graphics_toolkit ();
 %!   assert (get (0, "defaultfigure__graphics_toolkit__"), toolkit);
-%!   graphics_toolkit (hf, "fltk");
-%!   assert (graphics_toolkit (hf), "fltk");
+%!   graphics_toolkit (hf, "qt");
+%!   assert (graphics_toolkit (hf), "qt");
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
 
-%!testif HAVE_OPENGL, HAVE_FLTK; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) && any (strcmp ("fltk", available_graphics_toolkits ()))
+%!testif HAVE_OPENGL, HAVE_QT; have_window_system () && any (strcmp ("gnuplot", available_graphics_toolkits ())) && any (strcmp ("qt", available_graphics_toolkits ()))
 %! old_toolkit = graphics_toolkit ();
 %! switch (old_toolkit)
 %!   case {"gnuplot"}
-%!     new_toolkit = "fltk";
+%!     new_toolkit = "qt";
 %!   otherwise
 %!     new_toolkit = "gnuplot";
 %! endswitch