Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3664362
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T01:38:15+00:00 2026-05-19T01:38:15+00:00

I’m trying to make a Qt program using Qt Creator and Qwt for plotting.

  • 0

I’m trying to make a Qt program using Qt Creator and Qwt for plotting. I’ve never used Qt Creator before. I’ve created a MainWindow and added a Qwtplot widget there (object name: qwtPlot). The widget shows up in the program when I compile and run it. But theres no mention of the qwtPlot object anywhere in the (autogenerated) code so I assume it is being added at compile time from the .ui xml file (or something).

My question is that… how do I modify/change the qwtPlot object? Or where should I place the code?

I’m having a hard time articulating my question but the question basically is “How do I do anything with the qwtPlot widget which is created (graphically) with Qtcreator?”. I’ve checked some tutorials but in the tutorials they add the widgets manually in the code, but I’d like to use Qt Creator (because my UI will be fairly complicated). This whole Qt Creator is pretty confusing…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T01:38:16+00:00Added an answer on May 19, 2026 at 1:38 am

    A typical solution is to use multiple inheritance or contain the UI component as a private member. Qt explains the process on their web site:

    Using a Designer UI File in Your Application

    For a main window, most of this is auto-generated for you (on my version, at least … 2.0.1)

    You should have (or create) a mainwindow.h file that contains a member of type Ui::MainWindow.

    class MainWindow : public QMainWindow
    {
      Q_OBJECT
    
    public:
      explicit MainWindow(QWidget *parent = 0);
      ~MainWindow();
    
    private:
      Ui::MainWindow *ui;
    };
    

    Your mainwindow.cpp should initialize it properly, and then you can get to the auto-generated members through the private ui member.

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow) {
        ui->setupUi(this);
        ui->myControl->setProperty(...);
    }
    
    MainWindow::~MainWindow() {
        delete ui;
    }
    

    If you use the multiple-inheritance method, you can access the members directly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.