#ifndef Mainwindow_h #define Mainwindow_h<QMainWindow><QProgressBar>class Public qmainwindow{ q_objectpublic: 0); ~MainWindow (); Qprogressbar* progress[];}; #endif // Mainwindow_h
#include"mainwindow.h"Mainwindow::mainwindow (Qwidget*parent): Qmainwindow (parent) { This->resize ( -, -); progress[0] =NewQprogressbar ( This); progress[0]->setminimum (0); progress[0]->setmaximum ( -); progress[0]->setvalue ( -); progress[0]->setorientation (qt::horizontal); progress[0]->setgeometry (Ten, -, -, -); progress[1] =NewQprogressbar ( This); progress[1]->setrange (0, -); progress[1]->setvalue ( -); progress[1]->setorientation (qt::horizontal); progress[1]->setgeometry (Ten, -, -, -); progress[1]->setinvertedappearance (true);//set to True is the opposite of the default direction}mainwindow::~MainWindow () {}
#include mainwindow.h " #include <qapplication>int Main (int argc, char *argv[]) {qapplication A (argc, argv); MainWindow W; W.show (); return A.exec ();}
" mainwindow.h " <QApplication>int main (intChar *argv[]) { qapplication a (argc, ARGV); MainWindow W; W.show (); return a.exec ();}
qt5-Control-qprogressbar-progress Bar-To do download progress, file read progress is good