Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. [QWT] Edit legend icons size
Forum Updated to NodeBB v4.3 + New Features

[QWT] Edit legend icons size

Scheduled Pinned Locked Moved Unsolved 3rd Party Software
5 Posts 2 Posters 891 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Creatorczyk
    wrote on last edited by Creatorczyk
    #1

    Hi,

    I would like to change size of icon in my QwtLegend. So I wrote something like this:

    QwtPlotCurve* curve = new QwtPlotCurve();
    
    ...
    
    curve->attach(this);
    
    QwtPlotLegendItem *lgdItem =  dynamic_cast<QwtPlotLegendItem*>(legend->find(curve));
    lgdItem->setLegendIconSize(QSize(15,15));
    

    But I got error:

    error: cannot initialize a parameter of type 'WId' (aka 'unsigned int') with an lvalue of type 'QwtPlotCurve *'
    

    I saw in others examples this solution. I use this version of qwt: https://sourceforge.net/p/qwt/code/HEAD/tree/branches/qwt-6.1-multiaxes/

    How could I change icons size?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Which line of your code triggers this ?
      Can you show the full code where it happens ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • C Offline
        C Offline
        Creatorczyk
        wrote on last edited by
        #3

        @SGaist unfortunately I can't show all the code. The problem is in function:

        legend->find(curve)
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Creatorczyk said in [QWT] Edit legend icons size:

          legend

          What is it ?
          Where do you create it ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          C 1 Reply Last reply
          0
          • SGaistS SGaist

            @Creatorczyk said in [QWT] Edit legend icons size:

            legend

            What is it ?
            Where do you create it ?

            C Offline
            C Offline
            Creatorczyk
            wrote on last edited by
            #5

            @SGaist It's object of QwtLegend, defined in constructor of my own Plot

            Chart::Chart(QWidget* parent) :
              QwtPlot(parent)
            {
                QwtLegend *legend = new QwtLegend(this);
                legend->setFont(QFont("Helvetica", 12));
                insertLegend(legend, QwtPlot::BottomLegend);
            }
            
            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved