Commit efabb3bc authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Remove unstable viewer.

	* GScribo/BUGS,
	* GScribo/GScribo.pro,
	* GScribo/GScribo.pro.user,
	* GScribo/GScribo.pro.user.1.3,
	* GScribo/PagesWidget/pagesdelegate.cpp,
	* GScribo/PagesWidget/pagesdelegate.h,
	* GScribo/PagesWidget/pagesmodel.cpp,
	* GScribo/PagesWidget/pagesmodel.h,
	* GScribo/PagesWidget/pageswidget.cpp,
	* GScribo/PagesWidget/pageswidget.h,
	* GScribo/Preferences/generaloptions.cpp,
	* GScribo/Preferences/generaloptions.h,
	* GScribo/Preferences/generaloptions.ui,
	* GScribo/Preferences/ocroptions.cpp,
	* GScribo/Preferences/ocroptions.h,
	* GScribo/Preferences/ocroptions.ui,
	* GScribo/Preferences/optionwidget.h,
	* GScribo/Preferences/preferencesdialog.cpp,
	* GScribo/Preferences/preferencesdialog.h,
	* GScribo/Preferences/preferencesdialog.ui,
	* GScribo/Preferences/preprocessingoptions.cpp,
	* GScribo/Preferences/preprocessingoptions.h,
	* GScribo/Preferences/preprocessingoptions.ui,
	* GScribo/Preferences/segmentationoptions.cpp,
	* GScribo/Preferences/segmentationoptions.h,
	* GScribo/Preferences/segmentationoptions.ui,
	* GScribo/Processing/preprocess.cpp,
	* GScribo/Processing/preprocess.h,
	* GScribo/Processing/process.cpp,
	* GScribo/Processing/process.h,
	* GScribo/Processing/progressdialog.cpp,
	* GScribo/Processing/progressdialog.h,
	* GScribo/Processing/runner.cpp,
	* GScribo/Processing/runner.h,
	* GScribo/Rendering/abstractregionitem.h,
	* GScribo/Rendering/backgroundtexture.h,
	* GScribo/Rendering/graphicsview.cpp,
	* GScribo/Rendering/graphicsview.h,
	* GScribo/Rendering/regionitem.cpp,
	* GScribo/Rendering/regionitem.h,
	* GScribo/Rendering/rootgraphicsitem.h,
	* GScribo/Rendering/scene.cpp,
	* GScribo/Rendering/scene.h,
	* GScribo/Rendering/selection.cpp,
	* GScribo/Rendering/selection.h,
	* GScribo/TODO,
	* GScribo/XmlWidget/attributesmodel.cpp,
	* GScribo/XmlWidget/attributesmodel.h,
	* GScribo/XmlWidget/selectionproxy.h,
	* GScribo/XmlWidget/xmlattributes.cpp,
	* GScribo/XmlWidget/xmlattributes.h,
	* GScribo/XmlWidget/xmldelegate.h,
	* GScribo/XmlWidget/xmlitem.cpp,
	* GScribo/XmlWidget/xmlitem.h,
	* GScribo/XmlWidget/xmlmodel.cpp,
	* GScribo/XmlWidget/xmlmodel.h,
	* GScribo/XmlWidget/xmlview.cpp,
	* GScribo/XmlWidget/xmlview.h,
	* GScribo/XmlWidget/xmlwidget.cpp,
	* GScribo/XmlWidget/xmlwidget.h,
	* GScribo/aboutdialog.h,
	* GScribo/aboutdialog.ui,
	* GScribo/configs.h,
	* GScribo/dir.h,
	* GScribo/dockwidget.h,
	* GScribo/main.cpp,
	* GScribo/mainwindow.cpp,
	* GScribo/mainwindow.h,
	* GScribo/mainwindow.ui,
	* GScribo/region.h,
	* GScribo/regionwidget.cpp,
	* GScribo/regionwidget.h,
	* GScribo/variantpointer.h,
	* GScribo/xml.cpp,
	* GScribo/xml.h: Remove.
parent 276ad3db
2013-04-18 Guillaume Lazzara <z@lrde.epita.fr>
Remove unstable viewer.
* GScribo/BUGS,
* GScribo/GScribo.pro,
* GScribo/GScribo.pro.user,
* GScribo/GScribo.pro.user.1.3,
* GScribo/PagesWidget/pagesdelegate.cpp,
* GScribo/PagesWidget/pagesdelegate.h,
* GScribo/PagesWidget/pagesmodel.cpp,
* GScribo/PagesWidget/pagesmodel.h,
* GScribo/PagesWidget/pageswidget.cpp,
* GScribo/PagesWidget/pageswidget.h,
* GScribo/Preferences/generaloptions.cpp,
* GScribo/Preferences/generaloptions.h,
* GScribo/Preferences/generaloptions.ui,
* GScribo/Preferences/ocroptions.cpp,
* GScribo/Preferences/ocroptions.h,
* GScribo/Preferences/ocroptions.ui,
* GScribo/Preferences/optionwidget.h,
* GScribo/Preferences/preferencesdialog.cpp,
* GScribo/Preferences/preferencesdialog.h,
* GScribo/Preferences/preferencesdialog.ui,
* GScribo/Preferences/preprocessingoptions.cpp,
* GScribo/Preferences/preprocessingoptions.h,
* GScribo/Preferences/preprocessingoptions.ui,
* GScribo/Preferences/segmentationoptions.cpp,
* GScribo/Preferences/segmentationoptions.h,
* GScribo/Preferences/segmentationoptions.ui,
* GScribo/Processing/preprocess.cpp,
* GScribo/Processing/preprocess.h,
* GScribo/Processing/process.cpp,
* GScribo/Processing/process.h,
* GScribo/Processing/progressdialog.cpp,
* GScribo/Processing/progressdialog.h,
* GScribo/Processing/runner.cpp,
* GScribo/Processing/runner.h,
* GScribo/Rendering/abstractregionitem.h,
* GScribo/Rendering/backgroundtexture.h,
* GScribo/Rendering/graphicsview.cpp,
* GScribo/Rendering/graphicsview.h,
* GScribo/Rendering/regionitem.cpp,
* GScribo/Rendering/regionitem.h,
* GScribo/Rendering/rootgraphicsitem.h,
* GScribo/Rendering/scene.cpp,
* GScribo/Rendering/scene.h,
* GScribo/Rendering/selection.cpp,
* GScribo/Rendering/selection.h,
* GScribo/TODO,
* GScribo/XmlWidget/attributesmodel.cpp,
* GScribo/XmlWidget/attributesmodel.h,
* GScribo/XmlWidget/selectionproxy.h,
* GScribo/XmlWidget/xmlattributes.cpp,
* GScribo/XmlWidget/xmlattributes.h,
* GScribo/XmlWidget/xmldelegate.h,
* GScribo/XmlWidget/xmlitem.cpp,
* GScribo/XmlWidget/xmlitem.h,
* GScribo/XmlWidget/xmlmodel.cpp,
* GScribo/XmlWidget/xmlmodel.h,
* GScribo/XmlWidget/xmlview.cpp,
* GScribo/XmlWidget/xmlview.h,
* GScribo/XmlWidget/xmlwidget.cpp,
* GScribo/XmlWidget/xmlwidget.h,
* GScribo/aboutdialog.h,
* GScribo/aboutdialog.ui,
* GScribo/configs.h,
* GScribo/dir.h,
* GScribo/dockwidget.h,
* GScribo/main.cpp,
* GScribo/mainwindow.cpp,
* GScribo/mainwindow.h,
* GScribo/mainwindow.ui,
* GScribo/region.h,
* GScribo/regionwidget.cpp,
* GScribo/regionwidget.h,
* GScribo/variantpointer.h,
* GScribo/xml.cpp,
* GScribo/xml.h: Remove.
2013-04-17 Guillaume Lazzara <z@lrde.epita.fr>
* doc/Makefile.am: Fix a link in documentations generated with
......
- In release compilation, when the first text region is selected in the xml widget, the program crashs.
# -------------------------------------------------
# Project created by QtCreator 2013-01-21T09:20:54
# -------------------------------------------------
QT += xml
INCLUDEPATH += /lrde/home/stage/froger_a/olena/scribo/ \
/lrde/home/stage/froger_a/olena/milena/ \
/lrde/home/stage/froger_a/olena/_build/scribo/demo/
QMAKE_CXXFLAGS += -DNDEBUG \
-DMLN_WO_GLOBAL_VARS
LIBS += -I/usr/include/graphicsImage \
-lGraphicsMagick++ \
-ltesseract_full \
-ltiff
TARGET = GScribo
TEMPLATE = app
SOURCES += regionwidget.cpp \
mainwindow.cpp \
main.cpp \
xml.cpp \
Rendering/scene.cpp \
Rendering/selection.cpp \
Rendering/regionitem.cpp \
Rendering/graphicsview.cpp \
PagesWidget/pageswidget.cpp \
PagesWidget/pagesmodel.cpp \
PagesWidget/pagesdelegate.cpp \
Preferences/segmentationoptions.cpp \
Preferences/preprocessingoptions.cpp \
Preferences/ocroptions.cpp \
Preferences/generaloptions.cpp \
Preferences/preferencesdialog.cpp \
Processing/progressdialog.cpp \
Processing/preprocess.cpp \
Processing/process.cpp \
Processing/runner.cpp \
XmlWidget/xmlwidget.cpp \
XmlWidget/xmlmodel.cpp \
XmlWidget/xmlitem.cpp \
XmlWidget/xmlattributes.cpp \
XmlWidget/attributesmodel.cpp \
XmlWidget/xmlview.cpp
HEADERS += mainwindow.h \
variantpointer.h \
regionwidget.h \
aboutdialog.h \
configs.h \
region.h \
dir.h \
xml.h \
Rendering/scene.h \
Rendering/selection.h \
Rendering/regionitem.h \
Rendering/graphicsview.h \
PagesWidget/pageswidget.h \
PagesWidget/pagesmodel.h \
Processing/preprocess.h \
Processing/process.h \
Processing/runner.h \
Processing/progressdialog.h \
Preferences/segmentationoptions.h \
Preferences/preprocessingoptions.h \
Preferences/ocroptions.h \
Preferences/generaloptions.h \
Preferences/optionwidget.h \
Preferences/preferencesdialog.h \
XmlWidget/xmlwidget.h \
XmlWidget/xmlmodel.h \
XmlWidget/xmlitem.h \
XmlWidget/xmlattributes.h \
XmlWidget/selectionproxy.h \
XmlWidget/xmldelegate.h \
XmlWidget/attributesmodel.h \
PagesWidget/pagesdelegate.h \
Rendering/rootgraphicsitem.h \
XmlWidget/xmlview.h \
dockwidget.h
FORMS += mainwindow.ui \
aboutdialog.ui \
Preferences/preferencesdialog.ui \
Preferences/ocroptions.ui \
Preferences/segmentationoptions.ui \
Preferences/generaloptions.ui \
Preferences/preprocessingoptions.ui
This diff is collapsed.
<!DOCTYPE QtCreatorProject>
<qtcreator>
<data>
<variable>RunConfiguration0-BaseEnvironmentBase</variable>
<value type="int">2</value>
</data>
<data>
<variable>RunConfiguration0-CommandLineArguments</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-ProFile</variable>
<value type="QString">GScribo.pro</value>
</data>
<data>
<variable>RunConfiguration0-RunConfiguration.name</variable>
<value type="QString">GScribo</value>
</data>
<data>
<variable>RunConfiguration0-UseDyldImageSuffix</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UseTerminal</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserEnvironmentChanges</variable>
<valuelist type="QVariantList"/>
</data>
<data>
<variable>RunConfiguration0-UserSetName</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserSetWorkingDirectory</variable>
<value type="bool">false</value>
</data>
<data>
<variable>RunConfiguration0-UserWorkingDirectory</variable>
<value type="QString"></value>
</data>
<data>
<variable>RunConfiguration0-type</variable>
<value type="QString">Qt4ProjectManager.Qt4RunConfiguration</value>
</data>
<data>
<variable>activeRunConfiguration</variable>
<value type="int">0</value>
</data>
<data>
<variable>activebuildconfiguration</variable>
<value type="QString">Debug</value>
</data>
<data>
<variable>buildConfiguration-Debug</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<value key="QtVersionId" type="int">0</value>
<value key="ToolChain" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">2</value>
</valuemap>
</data>
<data>
<variable>buildConfiguration-Release</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
<value key="QtVersionId" type="int">0</value>
<value key="addQDumper" type=""></value>
<value key="buildConfiguration" type="int">0</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
<value type="QString">DESKTOP_SESSION=fluxbox</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=fluxbox</value>
<value type="QString">GDM_LANG=fr_FR.UTF-8</value>
<value type="QString">GDM_XSERVER_LOCATION=local</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/lrde/home/stage/froger_a</value>
<value type="QString">LANG=fr_FR.UTF-8</value>
<value type="QString">LANGUAGE=</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
<value type="QString">LOGNAME=froger_a</value>
<value type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
<value type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=2</value>
<value type="QString">SSH_AGENT_PID=8827</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
<value type="QString">TERM=xterm</value>
<value type="QString">USER=froger_a</value>
<value type="QString">USERNAME=froger_a</value>
<value type="QString">WINDOWID=10485784</value>
<value type="QString">WINDOWPATH=7:8:8</value>
<value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
<value type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
<value type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
<value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
<value type="QString">XTERM_SHELL=/bin/bash</value>
<value type="QString">XTERM_VERSION=XTerm(261)</value>
</valuelist>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo/GScribo.pro</value>
<value type="QString">-spec</value>
<value type="QString">linux-g++</value>
<value type="QString">-r</value>
<value type="QString">CONFIG+=debug</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/qmake-qt4</value>
<value key="abstractProcess.enabled" type="bool">false</value>
<value key="abstractProcess.workingDirectory" type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
<value type="QString">DESKTOP_SESSION=fluxbox</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=fluxbox</value>
<value type="QString">GDM_LANG=fr_FR.UTF-8</value>
<value type="QString">GDM_XSERVER_LOCATION=local</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/lrde/home/stage/froger_a</value>
<value type="QString">LANG=fr_FR.UTF-8</value>
<value type="QString">LANGUAGE=</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
<value type="QString">LOGNAME=froger_a</value>
<value type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
<value type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=2</value>
<value type="QString">SSH_AGENT_PID=8827</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
<value type="QString">TERM=xterm</value>
<value type="QString">USER=froger_a</value>
<value type="QString">USERNAME=froger_a</value>
<value type="QString">WINDOWID=10485784</value>
<value type="QString">WINDOWPATH=7:8:8</value>
<value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
<value type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
<value type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
<value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
<value type="QString">XTERM_SHELL=/bin/bash</value>
<value type="QString">XTERM_VERSION=XTerm(261)</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Debug-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
<valuelist key="abstractProcess.Environment" type="QVariantList">
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-e8Ai0asIF8,guid=40cd8e30a2205708b63bff1e00011544</value>
<value type="QString">DESKTOP_SESSION=fluxbox</value>
<value type="QString">DISPLAY=:0.0</value>
<value type="QString">GDMSESSION=fluxbox</value>
<value type="QString">GDM_LANG=fr_FR.UTF-8</value>
<value type="QString">GDM_XSERVER_LOCATION=local</value>
<value type="QString">GTK_MODULES=canberra-gtk-module</value>
<value type="QString">HOME=/lrde/home/stage/froger_a</value>
<value type="QString">LANG=fr_FR.UTF-8</value>
<value type="QString">LANGUAGE=</value>
<value type="QString">LD_LIBRARY_PATH=/usr/lib/qtcreator</value>
<value type="QString">LOGNAME=froger_a</value>
<value type="QString">PATH=/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/games</value>
<value type="QString">PWD=/lrde/home/stage/froger_a/qt/GScribo</value>
<value type="QString">QTDIR=/usr/share/qt4</value>
<value type="QString">SHELL=/bin/bash</value>
<value type="QString">SHLVL=2</value>
<value type="QString">SSH_AGENT_PID=8827</value>
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-zNmFSg8766/agent.8766</value>
<value type="QString">TERM=xterm</value>
<value type="QString">USER=froger_a</value>
<value type="QString">USERNAME=froger_a</value>
<value type="QString">WINDOWID=10485784</value>
<value type="QString">WINDOWPATH=7:8:8</value>
<value type="QString">XAUTHORITY=/tmp/.gdm1MPCSW</value>
<value type="QString">XDG_DATA_DIRS=/usr/local/share/:/usr/share/:/usr/share/gdm/</value>
<value type="QString">XDG_SESSION_COOKIE=9a5c41ad78622411b8e25b00459a554f-1360845394.397476-591106291</value>
<value type="QString">XTERM_LOCALE=fr_FR.UTF-8</value>
<value type="QString">XTERM_SHELL=/bin/bash</value>
<value type="QString">XTERM_VERSION=XTerm(261)</value>
</valuelist>
<value key="abstractProcess.IgnoreReturnValue" type="bool">true</value>
<valuelist key="abstractProcess.arguments" type="QVariantList">
<value type="QString">clean</value>
<value type="QString">-w</value>
</valuelist>
<value key="abstractProcess.command" type="QString">/usr/bin/make</value>
<value key="abstractProcess.enabled" type="bool">true</value>
<value key="abstractProcess.workingDirectory" type="QString">/amd/nfs/volume1/home/stage/froger_a/qt/GScribo</value>
<value key="cleanConfig" type="bool">true</value>
<valuelist key="makeargs" type="QVariantList">
<value type="QString">clean</value>
</valuelist>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfiguration-Release-cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Release</value>
</valuemap>
</data>
<data>
<variable>buildconfigurations</variable>
<valuelist type="QVariantList">
<value type="QString">Debug</value>
<value type="QString">Release</value>
</valuelist>
</data>
<data>
<variable>buildstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="mkspec" type="QString"></value>
</valuemap>
</data>
<data>
<variable>buildstep1</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
</valuemap>
</data>
<data>
<variable>buildsteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.qmake</value>
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>cleanstep0</variable>
<valuemap type="QVariantMap">
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString"></value>
<value key="clean" type="bool">true</value>
</valuemap>
</data>
<data>
<variable>cleansteps</variable>
<valuelist type="QVariantList">
<value type="QString">trolltech.qt4projectmanager.make</value>
</valuelist>
</data>
<data>
<variable>defaultFileEncoding</variable>
<value type="QByteArray">System</value>
</data>
<data>
<variable>project</variable>
<valuemap type="QVariantMap"/>
</data>
</qtcreator>
#include "pagesdelegate.h"
PagesDelegate::PagesDelegate(QObject *parent) :
QStyledItemDelegate(parent)
{
pen_.setColor(QColor::fromRgb(255, 69, 0, 255));
pen_.setWidth(2);
}
void PagesDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
QStyledItemDelegate::paint(painter, option, index);
if(index.row() == index.data(Qt::UserRole+1).toInt())
{
painter->setPen(pen_);
painter->drawRect(option.rect);
painter->fillRect(option.rect, QColor::fromRgb(255, 69, 0, 60));
}
}
#ifndef PAGESDELEGATE_H
#define PAGESDELEGATE_H
#include <QStyledItemDelegate>
#include <QPainter>
class PagesDelegate :
public QStyledItemDelegate
{
public:
explicit PagesDelegate(QObject *parent = 0);
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
private:
QPen pen_;
};
#endif // PAGESDELEGATE_H
#include "pagesmodel.h"
PagesModel::PagesModel(QObject *parent):
QAbstractListModel(parent)
{
currentRow_ = 0;
}
QVariant PagesModel::data(const QModelIndex& index, int role) const
{
if(!index.isValid())
return QVariant();
if(role == Qt::DecorationRole)
return pixmaps_[index.row()];
if(role == Qt::UserRole)
return filenames_[index.row()];
if(role == Qt::UserRole+1)
return currentRow_;
return QVariant();
}
void PagesModel::addPicture(const QString& filename, const QPixmap& pixmap)
{
beginInsertRows(QModelIndex(), 0, 0);
pixmaps_.prepend(pixmap.scaled(QSize(200, 200), Qt::KeepAspectRatio, Qt::SmoothTransformation));
filenames_.prepend(filename);
endInsertRows();
}
void PagesModel::removePixmap(const QModelIndex &parent)
{
int row = parent.row();
beginRemoveRows(parent, row, row);
pixmaps_.removeAt(row);
filenames_.removeAt(row);
endRemoveRows();
}
void PagesModel::setCurrentRow(int currentRow)
{
beginResetModel();
currentRow_ = currentRow;
endResetModel();
}
#ifndef PAGESMODEL_H
#define PAGESMODEL_H
#include <QAbstractListModel>
#include <QIcon>
#include <QList>
class PagesModel:
public QAbstractListModel
{
Q_OBJECT
public:
explicit PagesModel(QObject *parent = 0);
inline QStringList filenames() const;
inline int rowCount(const QModelIndex& parent = QModelIndex()) const;
inline int currentRow() const;
void setCurrentRow(int currentRow);
QVariant data(const QModelIndex& index, int role = Qt::DecorationRole) const;
void addPicture(const QString& filename, const QPixmap& pixmap);
private:
QStringList filenames_;
QList<QPixmap> pixmaps_;
int currentRow_;
public slots:
void removePixmap(const QModelIndex& parent);
};
inline QStringList PagesModel::filenames() const
{ return filenames_; }
inline int PagesModel::rowCount(const QModelIndex&) const
{ return filenames_.count(); }
inline int PagesModel::currentRow() const
{ return currentRow_; }
#endif // PAGESMODEL_H
#include "pageswidget.h"
PagesWidget::PagesWidget(QWidget *parent):
QListView(parent)
{
setUniformItemSizes(true);
setSelectionMode(QAbstractItemView::ExtendedSelection);
setViewMode(QListView::IconMode);