summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Chowdhury <rahulc93@gmail.com>2015-09-12 00:53:49 (GMT)
committerRahul Chowdhury <rahulc93@gmail.com>2015-09-12 01:16:59 (GMT)
commitf7e144b101d58eb6e04ce03d0f66bef68ac0bc68 (patch)
tree2eb986d38bf0e2d4c272d4ed87700586dbf33f2c
parenta2558fac17e48e291aebefa7f483bf0e0b7e1995 (diff)
Port KStatusBar -> QStatusBar
REVIEW: 125181
-rw-r--r--src/kalzium.cpp22
-rw-r--r--src/kalzium.h2
2 files changed, 12 insertions, 12 deletions
diff --git a/src/kalzium.cpp b/src/kalzium.cpp
index 9f57c90..66de0b1 100644
--- a/src/kalzium.cpp
+++ b/src/kalzium.cpp
@@ -51,7 +51,7 @@
#include <QToolBox>
#include <QKeyEvent>
#include <QRegExp>
-#include <KStatusBar>
+#include <QStatusBar>
#include <QMessageBox>
#include <kconfigdialog.h>
@@ -558,13 +558,12 @@ void Kalzium::slotShowExportDialog()
void Kalzium::setupStatusBar()
{
- KStatusBar *statusBar = new KStatusBar(this);
+ QStatusBar *statusBar = new QStatusBar(this);
setStatusBar(statusBar);
- statusBar->insertItem("", 0, 0);
- statusBar->setItemAlignment(0, Qt::AlignRight);
- statusBar->insertItem("", IDS_ELEMENTINFO, 1);
- statusBar->setItemAlignment(IDS_ELEMENTINFO, Qt::AlignRight);
+ m_elementInfo = new QLabel("");
+ m_elementInfo->setAlignment(Qt::AlignRight);
+ statusBar->addWidget(m_elementInfo, 1);
statusBar->show();
}
@@ -572,12 +571,11 @@ void Kalzium::elementHover(int num)
{
// extractIconicInformationAboutElement(num);
Element *e = KalziumDataObject::instance()->element(num);
- KStatusBar *statusBar = new KStatusBar(this);
- setStatusBar(statusBar);
- statusBar->changeItem(i18nc("For example: \"Carbon (6), Mass: 12.0107 u\"", "%1 (%2), Mass: %3 u",
- e->dataAsString(ChemicalDataObject::name),
- e->dataAsString(ChemicalDataObject::atomicNumber),
- e->dataAsString(ChemicalDataObject::mass)), IDS_ELEMENTINFO);
+ m_elementInfo->setText(i18nc("For example: \"Carbon (6), Mass: 12.0107 u\"", "%1 (%2), Mass: %3 u",
+ e->dataAsString(ChemicalDataObject::name),
+ e->dataAsString(ChemicalDataObject::atomicNumber),
+ e->dataAsString(ChemicalDataObject::mass)));
+ qDebug() << "change item in status bar";
m_detailWidget->setElement(num);
}
diff --git a/src/kalzium.h b/src/kalzium.h
index b53bb37..034b17f 100644
--- a/src/kalzium.h
+++ b/src/kalzium.h
@@ -139,6 +139,8 @@ private:
UnitSettingsDialog *m_unitsDialog;
+ QLabel *m_elementInfo;
+
Q_SIGNALS:
void numerationChanged(int);