summaryrefslogtreecommitdiffstats
path: root/kgeography/src/mypopup.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitce599e4f9f94b4eb00c1b5edb85bce5431ab3df2 (patch)
treed3bb9f5d25a2dc09ca81adecf39621d871534297 /kgeography/src/mypopup.cpp
downloadtdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.tar.gz
tdeedu-ce599e4f9f94b4eb00c1b5edb85bce5431ab3df2.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeedu@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kgeography/src/mypopup.cpp')
-rw-r--r--kgeography/src/mypopup.cpp66
1 files changed, 66 insertions, 0 deletions
diff --git a/kgeography/src/mypopup.cpp b/kgeography/src/mypopup.cpp
new file mode 100644
index 00000000..c7dede67
--- /dev/null
+++ b/kgeography/src/mypopup.cpp
@@ -0,0 +1,66 @@
+/***************************************************************************
+ * Copyright (C) 2004-2005 by Albert Astals Cid *
+ * tsdgeos@terra.es *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+
+#include <qlabel.h>
+#include <qlayout.h>
+#include <qimage.h>
+#include <qpixmap.h>
+
+#include "mypopup.h"
+
+
+myPopup::myPopup(QWidget *parent, const QString &text, const QString &text2, const QString &flagFile) : QFrame(parent)
+{
+ QHBoxLayout *lay = new QHBoxLayout(this);
+ lay -> setMargin(4);
+ lay -> setSpacing(4);
+
+ QWidget *vbox = new QWidget(this);
+ lay -> addWidget(vbox);
+ QVBoxLayout *vboxLayout = new QVBoxLayout(vbox);
+ vboxLayout -> setMargin(0);
+ vboxLayout -> setSpacing(0);
+ QLabel *l = new QLabel(text, vbox);
+ vboxLayout -> addWidget(l);
+
+ if (!text2.isNull())
+ {
+ QLabel *l2 = new QLabel(text2, vbox);
+ l2 -> setAlignment(Qt::AlignCenter);
+ vboxLayout -> addWidget(l2);
+ }
+
+ if (!flagFile.isNull())
+ {
+ QLabel *flag = new QLabel(this);
+ lay -> addWidget(flag);
+ QImage flagImg(flagFile);
+ flag -> setPixmap(flagImg.smoothScale(flagImg.width() / 5, flagImg. height() / 5));
+ flag -> setAlignment(Qt::AlignCenter);
+ }
+
+ l -> setAlignment(Qt::AlignCenter);
+ QFont f = l -> font();
+ f.setBold(true);
+ l -> setFont(f);
+
+
+ setFrameStyle(QFrame::Box | QFrame::Plain);
+ setLineWidth(2);
+
+ setFixedSize(sizeHint());
+}
+
+void myPopup::mousePressEvent(QMouseEvent *)
+{
+ emit deleteMe();
+}
+
+#include "mypopup.moc"