octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #58144] "Cdata" icon for UIcontrol is incorrec


From: Rik
Subject: [Octave-bug-tracker] [bug #58144] "Cdata" icon for UIcontrol is incorrectly sized
Date: Thu, 16 Apr 2020 14:05:13 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #4, bug #58144 (project octave):

The issue is in libgui/graphics/PushButtonControl.cc at line 61.  The function
is


PushButtonControl::PushButtonControl (octave::base_qobject& oct_qobj,
                                      octave::interpreter& interp,
                                      const graphics_object& go,
                                      QPushButton *btn)
  : ButtonControl (oct_qobj, interp, go, btn)
{
  uicontrol::properties& up = properties<uicontrol> ();

  btn->setAutoFillBackground (true);
  octave_value cdat = up.get_cdata ();
  QImage img = Utils::makeImageFromCData (cdat,
                                          cdat.rows (), cdat.columns ());
  btn->setIcon (QIcon (QPixmap::fromImage (img)));
}


I modified the code to print out the width and height of the QImage which is
correct.  I then checked the size of the QPixmap, and it too is correct.  The
issues seems to be with QIcon.  The window manager uses the style that you
have selected for buttons, and applies it to the QIcon when the setIcon()
function is called.  For normal systems, this means the size is something
small like 16x16 or 22x22 pixels.

I'm not a Qt programmer, but the resolution to the problem will be found by
changing something related to the QIcon class in Qt.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?58144>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]