From a4e98cf363a22cd4aa4c0cfd7eea7242ad6ffef4 Mon Sep 17 00:00:00 2001 From: scorpio810 Date: Thu, 7 Apr 2016 02:06:11 +0000 Subject: [PATCH] Improve AboutQET Widget git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4428 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/aboutqet.cpp | 23 ++++++----------------- sources/aboutqet.h | 2 +- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/sources/aboutqet.cpp b/sources/aboutqet.cpp index 95b451eb7..9a2aac843 100644 --- a/sources/aboutqet.cpp +++ b/sources/aboutqet.cpp @@ -33,8 +33,7 @@ AboutQET::AboutQET(QWidget *parent) : QDialog(parent) { // Titre, taille, comportement... setWindowTitle(tr("À propos de QElectrotech", "window title")); - setMinimumWidth(680); - setMinimumHeight(600); + setFixedSize (690, 610); setModal(true); // Trois onglets @@ -43,6 +42,7 @@ AboutQET::AboutQET(QWidget *parent) : QDialog(parent) { tabs -> addTab(authorsTab(), tr("A&uteurs", "tab title")); tabs -> addTab(translatorsTab(), tr("&Traducteurs", "tab title")); tabs -> addTab(contributorsTab(), tr("&Contributeurs", "tab title")); + tabs -> addTab(titleTab(), tr("&Version", "tab title")); tabs -> addTab(licenseTab(), tr("&Accord de licence", "tab title")); // Un bouton pour fermer la boite de dialogue @@ -52,9 +52,7 @@ AboutQET::AboutQET(QWidget *parent) : QDialog(parent) { // Le tout dans une disposition verticale QVBoxLayout *vlayout = new QVBoxLayout(); - vlayout -> addWidget(title()); vlayout -> addWidget(tabs); - vlayout -> addWidget(buttons); setLayout(vlayout); QScrollArea* scrollArea = new QScrollArea(this); @@ -74,11 +72,7 @@ AboutQET::~AboutQET() { /** @return The title QElectroTech with its icon */ -QWidget *AboutQET::title() const { - QWidget *icon_and_title = new QWidget(); - // icone - QLabel *icon = new QLabel(); - icon -> setPixmap(QET::Icons::QETOxygenLogo.pixmap(48, 48)); +QWidget *AboutQET::titleTab() const { // label "QElectroTech" QLabel *title = new QLabel("QElectroTech V " + QET::displayedVersion + ""); QString compilation_info = "
" + tr("Compilation : "); @@ -87,15 +81,10 @@ QWidget *AboutQET::title() const { compilation_info += " - built with Qt " + QString(QT_VERSION_STR); compilation_info += " - run with Qt "+ QString(qVersion()); #endif + title -> setAlignment(Qt::AlignCenter); title -> setText(title->text() + compilation_info); title -> setTextFormat(Qt::RichText); - - QHBoxLayout *hlayout = new QHBoxLayout(); - hlayout -> addWidget(icon); - hlayout -> addWidget(title); - hlayout -> addStretch(); - icon_and_title -> setLayout(hlayout); - return(icon_and_title); + return(title); } /** @@ -105,7 +94,7 @@ QWidget *AboutQET::aboutTab() const { QLabel *about = new QLabel( tr("QElectroTech, une application de réalisation de schémas électriques.", "about tab, description line") + "

" + - tr("2006-2015 Les développeurs de QElectroTech", "about tab, developers line") + + tr("2006-2016 Les développeurs de QElectroTech", "about tab, developers line") + "

" "http://qelectrotech.org/" "

" + diff --git a/sources/aboutqet.h b/sources/aboutqet.h index b13de9934..54b71b5f2 100644 --- a/sources/aboutqet.h +++ b/sources/aboutqet.h @@ -35,7 +35,7 @@ class AboutQET : public QDialog { // methods private: - QWidget *title() const; + QWidget *titleTab() const; QWidget *aboutTab() const; QWidget *authorsTab() const; QWidget *translatorsTab() const;