[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kphotoalbum] Exif: Ported Exif::InfoDialog to QDialog.
From: Tobias Leupold <tobias.leupold () web ! de>
Date: 2016-08-17 16:58:55
Message-ID: E1ba4B5-0005Wt-1F () code ! kde ! org
[Download RAW message or body]
Git commit 21ae791e73f2179582a033c34d025a33fae13089 by Tobias Leupold.
Committed on 17/08/2016 at 16:58.
Pushed by tleupold into branch 'master'.
Ported Exif::InfoDialog to QDialog.
M +15 -11 Exif/InfoDialog.cpp
M +6 -6 Exif/InfoDialog.h
http://commits.kde.org/kphotoalbum/21ae791e73f2179582a033c34d025a33fae13089
diff --git a/Exif/InfoDialog.cpp b/Exif/InfoDialog.cpp
index e8badd0..2567405 100644
--- a/Exif/InfoDialog.cpp
+++ b/Exif/InfoDialog.cpp
@@ -16,9 +16,8 @@
Boston, MA 02110-1301, USA.
*/
#include "Exif/InfoDialog.h"
-#include <KComboBox>
-#include <klineedit.h>
-#include <klocale.h>
+#include <QComboBox>
+#include <KLocalizedString>
#include "Exif/Info.h"
#include <qlayout.h>
#include <qlabel.h>
@@ -29,19 +28,22 @@
#include "DB/ImageDB.h"
#include "Settings/SettingsData.h"
#include "Grid.h"
+#include <QDialogButtonBox>
using Utilities::StringSet;
-Exif::InfoDialog::InfoDialog( const DB::FileName& fileName, QWidget* parent )
- :KDialog( parent )
+Exif::InfoDialog::InfoDialog(const DB::FileName& fileName, QWidget* parent) : \
QDialog(parent) {
setWindowTitle( i18n("EXIF Information") );
- setButtons( Close );
- setAttribute( Qt::WA_DeleteOnClose );
- QWidget* top = new QWidget;
- setMainWidget( top );
+ setAttribute(Qt::WA_DeleteOnClose);
+ QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
+ connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
+
+ QWidget* top = new QWidget(this);
QVBoxLayout* vlay = new QVBoxLayout( top );
+ setLayout(vlay);
+ vlay->addWidget(top);
// -------------------------------------------------- File name and pixmap
QHBoxLayout* hlay = new QHBoxLayout;
@@ -67,12 +69,12 @@ Exif::InfoDialog::InfoDialog( const DB::FileName& fileName, \
QWidget* parent )
QLabel* searchLabel = new QLabel( i18n( "EXIF Label Search: "), top );
hlay->addWidget( searchLabel );
- m_searchBox = new KLineEdit( top );
+ m_searchBox = new QLineEdit( top );
hlay->addWidget( m_searchBox );
hlay->addStretch( 1 );
QLabel* iptcLabel = new QLabel( i18n("IPTC character set:"), top );
- m_iptcCharset = new KComboBox( top );
+ m_iptcCharset = new QComboBox( top );
QStringList charsets;
QList<QByteArray> charsetsBA = QTextCodec::availableCodecs();
for (QList<QByteArray>::const_iterator it = charsetsBA.constBegin(); it != \
charsetsBA.constEnd(); ++it ) @@ -85,6 +87,8 @@ Exif::InfoDialog::InfoDialog( const \
DB::FileName& fileName, QWidget* parent )
connect( m_searchBox, SIGNAL(textChanged(QString)), m_grid, \
SLOT(updateSearchString(QString)) );
connect( m_iptcCharset, SIGNAL(activated(QString)), m_grid, \
SLOT(setupUI(QString)) ); setImage(fileName);
+
+ vlay->addWidget(buttonBox);
}
QSize Exif::InfoDialog::sizeHint() const
diff --git a/Exif/InfoDialog.h b/Exif/InfoDialog.h
index 45ca059..a028c96 100644
--- a/Exif/InfoDialog.h
+++ b/Exif/InfoDialog.h
@@ -17,12 +17,12 @@
*/
#ifndef INFODIALOG_H
#define INFODIALOG_H
-#include <KDialog>
+#include <QDialog>
#include "Utilities/Set.h"
#include "ImageManager/ImageClientInterface.h"
#include <DB/FileName.h>
-class KComboBox;
-class KLineEdit;
+class QComboBox;
+class QLineEdit;
class QLabel;
class QKeyEvent;
class QResizeEvent;
@@ -33,7 +33,7 @@ namespace Exif
{
class Grid;
-class InfoDialog : public KDialog, public ImageManager::ImageClientInterface {
+class InfoDialog : public QDialog, public ImageManager::ImageClientInterface {
Q_OBJECT
public:
@@ -47,9 +47,9 @@ public:
void pixmapLoaded(ImageManager::ImageRequest* request, const QImage& image) \
override;
private:
- KLineEdit* m_searchBox;
+ QLineEdit* m_searchBox;
QLabel* m_pix;
- KComboBox* m_iptcCharset;
+ QComboBox* m_iptcCharset;
Grid* m_grid;
QLabel* m_fileNameLabel;
};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic