Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Combining QCustomPlot's QCPBars with Qt's QScrollArea
Forum Update on Monday, May 27th 2025

Combining QCustomPlot's QCPBars with Qt's QScrollArea

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 350 Views
  • 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.
  • T Offline
    T Offline
    tamirmichael
    wrote on last edited by tamirmichael
    #1

    Hi all,

    I followed some advise given to me here and I am now using the designer instead of doing the grinding UI design myself.
    I have a QScrollArea that is promoted to a QCustomPlot, and everything is as expected. Trouble is that my previous code to actually build a bar chart does not build anymore because "ui.qcustomplot_ptr" is now of type CScrollArea*, and it does not have members of type QCPAxis:

    QCPBars *thread_bar_ptr = new QCPBars(ui.qcustomplot_ptr->xAxis, ui.qcustomplot_ptr->yAxis) ; // build error
    

    Any advise would be much appreciated.

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

      Hi
      just use the name from the UI for that widget you set to be promoted to QCustomPlot.

      1 Reply Last reply
      0
      • T Offline
        T Offline
        tamirmichael
        wrote on last edited by
        #3

        I think I understand my mistake - thank you. I promoted the scroll area - but that is clearly wrong. Should have promoted a widget and set that as the widget of the scroll area. (I realized this myself earlier btw :-) ).
        Thank you.

        1 Reply Last reply
        2

        • Login

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