QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
qgsbusyindicatordialog.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsbusyindicatordialog.cpp
3 --------------------------
4 begin : Mar 27, 2013
5 copyright : (C) 2013 by Larry Shaffer
6 email : larrys at dakcarto dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
19
20#include <QDialog>
21#include <QLabel>
22#include <QLayout>
23#include <QProgressBar>
24
25#include "moc_qgsbusyindicatordialog.cpp"
26
27QgsBusyIndicatorDialog::QgsBusyIndicatorDialog( const QString &message, QWidget *parent, Qt::WindowFlags fl )
28 : QDialog( parent, fl )
29 , mMessage( QString( message ) )
30
31{
32 setWindowTitle( tr( "QGIS" ) );
33 setLayout( new QVBoxLayout() );
34 setWindowModality( Qt::WindowModal );
35 setMinimumWidth( 250 );
36 mMsgLabel = new QLabel( mMessage );
37 layout()->addWidget( mMsgLabel );
38
39 QProgressBar *pb = new QProgressBar();
40 pb->setMaximum( 0 ); // show as busy indicator
41 layout()->addWidget( pb );
42
43 if ( mMessage.isEmpty() )
44 {
45 mMsgLabel->hide();
46 }
47}
48
50{
51 if ( !message.isEmpty() )
52 {
53 mMessage = QString( message );
54 mMsgLabel->setText( mMessage );
55 mMsgLabel->show();
56 }
57}
void setMessage(const QString &message)
QgsBusyIndicatorDialog(const QString &message=QString(), QWidget *parent=nullptr, Qt::WindowFlags fl=QgsGuiUtils::ModalDialogFlags)
Constructor Modal busy indicator dialog with no buttons.