QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
src
gui
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
18
#include "
qgsbusyindicatordialog.h
"
19
20
#include <QDialog>
21
#include <QLayout>
22
#include <QLabel>
23
#include <QProgressBar>
24
25
QgsBusyIndicatorDialog::QgsBusyIndicatorDialog
(
const
QString
& message,
QWidget
* parent,
const
Qt::WindowFlags
& fl )
26
:
QDialog
( parent, fl )
27
, mMessage(
QString
( message ) )
28
, mMsgLabel( nullptr )
29
{
30
setWindowTitle
(
tr
(
"QGIS"
) );
31
setLayout
(
new
QVBoxLayout
() );
32
setWindowModality
( Qt::WindowModal );
33
setMinimumWidth
( 250 );
34
mMsgLabel =
new
QLabel
( mMessage );
35
layout
()->
addWidget
( mMsgLabel );
36
37
QProgressBar
* pb =
new
QProgressBar
();
38
pb->
setMaximum
( 0 );
// show as busy indicator
39
layout
()->
addWidget
( pb );
40
41
if
( mMessage.
isEmpty
() )
42
{
43
mMsgLabel->
hide
();
44
}
45
}
46
47
QgsBusyIndicatorDialog::~QgsBusyIndicatorDialog
()
48
{
49
}
50
51
void
QgsBusyIndicatorDialog::setMessage
(
const
QString
&
message
)
52
{
53
if
( !message.
isEmpty
() )
54
{
55
mMessage =
QString
( message );
56
mMsgLabel->
setText
( mMessage );
57
mMsgLabel->
show
();
58
}
59
}
QWidget::layout
QLayout * layout() const
QProgressBar
QWidget
QProgressBar::setMaximum
void setMaximum(int maximum)
QWidget::setWindowModality
void setWindowModality(Qt::WindowModality windowModality)
QWidget::setMinimumWidth
void setMinimumWidth(int minw)
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QgsBusyIndicatorDialog::message
QString message() const
Definition:
qgsbusyindicatordialog.h:44
QWidget::setLayout
void setLayout(QLayout *layout)
QString::isEmpty
bool isEmpty() const
QgsBusyIndicatorDialog::~QgsBusyIndicatorDialog
~QgsBusyIndicatorDialog()
Definition:
qgsbusyindicatordialog.cpp:47
QVBoxLayout
QLabel::setText
void setText(const QString &)
QString
QWidget::hide
void hide()
QLayout::addWidget
void addWidget(QWidget *w)
QgsBusyIndicatorDialog::setMessage
void setMessage(const QString &message)
Definition:
qgsbusyindicatordialog.cpp:51
QWidget::setWindowTitle
void setWindowTitle(const QString &)
QgsBusyIndicatorDialog::QgsBusyIndicatorDialog
QgsBusyIndicatorDialog(const QString &message="", QWidget *parent=nullptr, const Qt::WindowFlags &fl=QgisGui::ModalDialogFlags)
Constructor Modal busy indicator dialog with no buttons.
Definition:
qgsbusyindicatordialog.cpp:25
QDialog
Qt::WindowFlags
typedef WindowFlags
QWidget::show
void show()
qgsbusyindicatordialog.h
QLabel
Generated on Sun Jun 24 2018 11:42:48 for QGIS API Documentation by
1.8.13