Mercurial > hg > forks > UniversalIndentGUI
changeset 406:cd5b54430964
Added some preparations for animated about dialog using QGraphicsView. But this needs Qt 4.4 so the code needs to be tested whether it runs on qt 4.3.x
git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@635 59b1889a-e5ac-428c-b0c7-476e01d41282
author | thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282> |
---|---|
date | Sat, 15 Mar 2008 16:56:20 +0000 |
parents | a96a42e16ced |
children | 9a9ceceaa548 |
files | src/AboutDialogGraphicsView.cpp src/AboutDialogGraphicsView.h src/UniversalIndentGUI.vcproj src/mainwindow.cpp src/mainwindow.h |
diffstat | 5 files changed, 76 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/AboutDialogGraphicsView.h Sat Mar 15 16:56:20 2008 +0000 @@ -0,0 +1,63 @@ +/*************************************************************************** +* Copyright (C) 2006-2008 by Thomas Schweitzer * +* thomas-schweitzer(at)arcor.de * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License version 2.0 as * +* published by the Free Software Foundation. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License for more details. * +* * +* You should have received a copy of the GNU General Public License * +* along with this program in the file LICENSE.GPL; if not, write to the * +* Free Software Foundation, Inc., * +* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * +***************************************************************************/ +#ifndef ABOUTDIALOGGRAPHICSVIEW_H +#define ABOUTDIALOGGRAPHICSVIEW_H + +#include <QGraphicsView> +#include <QGraphicsProxyWidget> +#include <QDesktopWidget> +#include <QDate> +#include <QTimeLine> + +//Can't use this test, because MOC doesn't understand that code line +//#if QT_VERSION >= 0x040400 + +#include "aboutdialog.h" + +class AboutDialogGraphicsView : public QGraphicsView +{ + Q_OBJECT +public: + AboutDialogGraphicsView(AboutDialog *aboutDialog, QWidget *parent = 0); + ~AboutDialogGraphicsView(void); + +public slots: + void show(); + void hide(); + +private: + AboutDialog *aboutDialog; + QGraphicsProxyWidget *graphicsProxyWidget; + QGraphicsScene *scene; + QWidget *parent; + QTimeLine *timeLine; + QLabel *aboutDialogAsLabel; + int windowBorderWidth; + int windowTitleBarWidth; + bool firstRunOfAnimation; + +private slots: + void updateStep(int step); + void showAboutDialog(); + void hideReally(); +}; + +#endif // ABOUTDIALOGGRAPHICSVIEW_H + +//#endif // #if QT_VERSION >= 0x040400 \ No newline at end of file
--- a/src/UniversalIndentGUI.vcproj Wed Mar 12 21:51:06 2008 +0000 +++ b/src/UniversalIndentGUI.vcproj Sat Mar 15 16:56:20 2008 +0000 @@ -216,7 +216,6 @@ > <FileConfiguration Name="Debug|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -224,7 +223,6 @@ </FileConfiguration> <FileConfiguration Name="Release|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -278,7 +276,6 @@ > <FileConfiguration Name="Debug|Win32" - ExcludedFromBuild="true" > <Tool Name="MOC" @@ -286,7 +283,6 @@ </FileConfiguration> <FileConfiguration Name="Release|Win32" - ExcludedFromBuild="true" > <Tool Name="MOC" @@ -372,7 +368,6 @@ > <FileConfiguration Name="Debug|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool" @@ -380,7 +375,6 @@ </FileConfiguration> <FileConfiguration Name="Release|Win32" - ExcludedFromBuild="true" > <Tool Name="VCCLCompilerTool"
--- a/src/mainwindow.cpp Wed Mar 12 21:51:06 2008 +0000 +++ b/src/mainwindow.cpp Sat Mar 15 16:56:20 2008 +0000 @@ -127,12 +127,16 @@ // generate about dialog box +#if QT_VERSION >= 0x040400 + aboutDialog = new AboutDialog(this, Qt::SplashScreen, version, revision, buildDateStr); + aboutDialogGraphicsView = new AboutDialogGraphicsView(aboutDialog, this); + connect( toolBarWidget->pbAbout, SIGNAL(clicked()), aboutDialogGraphicsView, SLOT(show()) ); + connect( actionAbout_UniversalIndentGUI, SIGNAL(activated()), aboutDialogGraphicsView, SLOT(show()) ); +#else aboutDialog = new AboutDialog(this, Qt::Dialog, version, revision, buildDateStr); - //aboutDialogGraphicsView = new AboutDialogGraphicsView(aboutDialog, this); - //connect( toolBarWidget->pbAbout, SIGNAL(clicked()), aboutDialogGraphicsView, SLOT(show()) ); - //connect( actionAbout_UniversalIndentGUI, SIGNAL(activated()), aboutDialogGraphicsView, SLOT(show()) ); connect( actionAbout_UniversalIndentGUI, SIGNAL(activated()), aboutDialog, SLOT(exec()) ); connect( toolBarWidget->pbAbout, SIGNAL(clicked()), aboutDialog, SLOT(exec()) ); +#endif // generate settings dialog box settingsDialog = new UiGuiSettingsDialog(this, settings);
--- a/src/mainwindow.h Wed Mar 12 21:51:06 2008 +0000 +++ b/src/mainwindow.h Sat Mar 15 16:56:20 2008 +0000 @@ -25,7 +25,9 @@ #include "ui_indentgui.h" #include "ui_toolBarWidget.h" #include "aboutdialog.h" -//#include "AboutDialogGraphicsView.h" +#if QT_VERSION >= 0x040400 +#include "AboutDialogGraphicsView.h" +#endif #include "uiguisettings.h" #include "uiguisettingsdialog.h" #include "highlighter.h" @@ -95,7 +97,9 @@ Highlighter *highlighter; QScrollBar *textEditVScrollBar; AboutDialog *aboutDialog; -// AboutDialogGraphicsView *aboutDialogGraphicsView; +#if QT_VERSION >= 0x040400 + AboutDialogGraphicsView *aboutDialogGraphicsView; +#endif UiGuiSettingsDialog *settingsDialog; int textEditLastScrollPos; int currentIndenterID;