QGIS API Documentation
2.10.1-Pisa
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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,
Qt::WindowFlags
fl )
26
:
QDialog
( parent, fl ), mMessage(
QString
( message ) ), mMsgLabel( 0 )
27
{
28
setWindowTitle
(
tr
(
"QGIS"
) );
29
setLayout
(
new
QVBoxLayout
() );
30
setWindowModality
( Qt::WindowModal );
31
setMinimumWidth
( 250 );
32
mMsgLabel =
new
QLabel
( mMessage );
33
layout
()->
addWidget
( mMsgLabel );
34
35
QProgressBar
* pb =
new
QProgressBar
();
36
pb->
setMaximum
( 0 );
// show as busy indicator
37
layout
()->
addWidget
( pb );
38
39
if
( mMessage.
isEmpty
() )
40
{
41
mMsgLabel->
hide
();
42
}
43
}
44
45
QgsBusyIndicatorDialog::~QgsBusyIndicatorDialog
()
46
{
47
}
48
49
void
QgsBusyIndicatorDialog::setMessage
(
const
QString
& message )
50
{
51
if
( !message.
isEmpty
() )
52
{
53
mMessage =
QString
( message );
54
mMsgLabel->
setText
( mMessage );
55
mMsgLabel->
show
();
56
}
57
}
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)
QgsBusyIndicatorDialog::QgsBusyIndicatorDialog
QgsBusyIndicatorDialog(const QString &message="", QWidget *parent=0, Qt::WindowFlags fl=QgisGui::ModalDialogFlags)
Constructor Modal busy indicator dialog with no buttons.
Definition:
qgsbusyindicatordialog.cpp:25
QObject::tr
QString tr(const char *sourceText, const char *disambiguation, int n)
QWidget::setLayout
void setLayout(QLayout *layout)
QString::isEmpty
bool isEmpty() const
QgsBusyIndicatorDialog::~QgsBusyIndicatorDialog
~QgsBusyIndicatorDialog()
Definition:
qgsbusyindicatordialog.cpp:45
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:49
QWidget::setWindowTitle
void setWindowTitle(const QString &)
QDialog
Qt::WindowFlags
typedef WindowFlags
QWidget::show
void show()
qgsbusyindicatordialog.h
QLabel
Generated on Sat Aug 22 2015 02:53:41 for QGIS API Documentation by
1.8.6