From the course: Code Clinic: C++

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Build a webpage

Build a webpage - C++ Tutorial

From the course: Code Clinic: C++

Start my 1-month free trial

Build a webpage

- [Instructor] To build a webpage using Wt, I create various widgets that represent each component on the page. So, on this page, each text box, colored box, button, and bar is a separate widget. If you've ever tried to build an image in PowerPoint using the shapes, or if you've used QT, you're familiar with how this is broken down into individual parts. My dashboard class inherits from Wt's W application and here in my dashboard header file, I've declared each of the widgets I have on my webpage. Everything is a text widget except for the engine status on line 28 which I use a progress bar widget to display the engine efficiency as a percentage. Over in my dashboard.cpp file, on line 11 I define the constructor for this class which is also where I configure the widgets needed to build the webpage. When as user access the dashboard, a new session is created with a new instance of this class. The object…

Contents