# HG changeset patch # User John W. Eaton # Date 1548270481 0 # Node ID 60137713f0013fb614130579aa61c54a743f8d74 # Parent eaebee6d4f56a10207b152109fa0dbe2ffc00884 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. diff -r eaebee6d4f56 -r 60137713f001 libinterp/corefcn/graphics.cc --- 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); diff -r eaebee6d4f56 -r 60137713f001 scripts/gui/uimenu.m --- 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"); diff -r eaebee6d4f56 -r 60137713f001 scripts/plot/util/allchild.m --- 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; diff -r eaebee6d4f56 -r 60137713f001 scripts/plot/util/findall.m --- 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); diff -r eaebee6d4f56 -r 60137713f001 scripts/plot/util/graphics_toolkit.m --- 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