Use QWT Library in Qt to Display Seismic Waveforms Part II: UI Design

Reference: Use QWT Library in Qt to Display Seismic Waveforms Part I: Install QWT

Here is the detailed steps showing how to program in Qt Creator (Version 5.7.0) in order to plot 2D seismic waveforms. A downhole microseismic data in SEG-Y format will be used in this tutorial. Detailed workflow is as follows:

Step 1: Create a new project in Qt CreatorWatch Full Movie Online Streaming Online and Download

  1. Open Qt Creator and click [New Project] in welcome interface ;
  2. Choose [Application]  template and [Qt Widgets Application](Figure 1);
  3. Name the project and choose the project directory. Here the project is named as [WaveformDisplay] and is stored in [D:](Figure 2);
  4. Choose [Desktop Qt 5.7.0 MinGW 32bit] as the compiling kit, which is default in Windows platform for Qt 5.7.0(Figure 3);
  5. Creat a class with the default name[MainWindow] and [mainwindow.h] , [mainwindow.cpp] and [mainwindow.ui]will be automatically added into the project(Figure 4);
  6. When all 5 steps above are finished, an initialization interface on which we will work on will be showed (Figure 5).

Fig.1 Choose application template in Qt Creator

Fig.1 Choose application template in Qt Creator

Fig.2 Project name and directory
Fig.2 Project name and directory
Fig3. Use MinGW kit in Windows OS
Fig3. Use MinGW kit in Windows OS
Fig.4 Create a new class with UI
Fig.4 Create a new class with UI
Fig.5 Project creation completed
Fig.5 Project creation completed

Step 2: Design UI for waveform display

  1. Right click the mainwindow.ui and choose Qt Designer to open it(Figure 6). Please note that if you just double click the mainwindow.ui and show it in default Qt Creator, you won’t be able to see Qwt Widgets;
  2. Drag one Label,Line Edit, Push Button and QwtPlot into the mainwindow UI;
  3. Define these widgets with names lbSEGY, edtPath, btnBrowse and qwtPlot, and double click the btnBrowse Push Button to change the caption text into Browse…(Figure 7);
  4. Modify the layout to show a better UI.
Fig.6 Open in Qt Designer
Fig.6 Open in Qt Designer

 

Fig.7 UI design in Qt Designer
Fig.7 UI design in Qt Designer