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. Chart display in tabWidget
Forum Updated to NodeBB v4.3 + New Features

Chart display in tabWidget

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 551 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.
  • F Offline
    F Offline
    fender
    wrote on last edited by
    #1

    How to display a chart in tabwidget?

        QLineSeries *series = new QLineSeries();
        for(int i=0;i<size; ++i)
        series->append(p_overpressure[i], alpha[i]);
        QChart *chart = new QChart();
        chart->legend()->hide();
        chart->addSeries(series);
        chart->createDefaultAxes();
        chart->setTitle("График изменения объемной доли газа в зависимости от давления в точке измерения");
        QChartView *chartView = new QChartView(chart);
        chartView->setRenderHint(QPainter::Antialiasing);
    

    In Example so

        QMainWindow window;
        window.setCentralWidget(chartView); // display in the window
        window.resize(400, 300);
        window.show();
    
    1 Reply Last reply
    0
    • M Offline
      M Offline
      MrShawn
      wrote on last edited by
      #2

      Try adding a layout to your tab widget, and attach the chart to that layout.

      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