/*
* Tiled Map Editor (Qt)
* Copyright 2008 Tiled (Qt) developers (see AUTHORS file)
*
* This file is part of Tiled (Qt).
*
* 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.
*
* 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; if not, write to the Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA 02111-1307, USA.
*/
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "aboutdialog.h"
#include "changeselection.h"
#include "clipboardmanager.h"
#include "eraser.h"
#include "erasetiles.h"
#include "bucketfilltool.h"
#include "filltiles.h"
#include "languagemanager.h"
#include "layer.h"
#include "layerdock.h"
#include "layermodel.h"
#include "map.h"
#include "mapdocument.h"
#include "mapscene.h"
#include "newmapdialog.h"
#include "newtilesetdialog.h"
#include "propertiesdialog.h"
#include "resizedialog.h"
#include "offsetmapdialog.h"
#include "preferences.h"
#include "preferencesdialog.h"
#include "saveasimagedialog.h"
#include "selectiontool.h"
#include "stampbrush.h"
#include "tilelayer.h"
#include "tileset.h"
#include "tilesetdock.h"
#include "tilesetmanager.h"
#include "toolmanager.h"
#include "tmxmapreader.h"
#include "tmxmapwriter.h"
#include "undodock.h"
#include "utils.h"
#include "zoomable.h"
#include <QCloseEvent>
#include <QFileDialog>
#include <QInputDialog>
#include <QMessageBox>
#include <QScrollBar>
#include <QSessionManager>
#include <QTextStream>
#include <QUndoGroup>
#include <QUndoStack>
#include <QUndoView>
using namespace Tiled;
using namespace Tiled::Internal;
using namespace Tiled::Utils;
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
, mUi(new Ui::MainWindow)
, mMapDocument(0)
, mLayerDock(new LayerDock(this))
, mTilesetDock(new TilesetDock(this))
, mZoomLabel(new QLabel)
, mStatusInfoLabel(new QLabel)
, mClipboardManager(new ClipboardManager(this))
{
mUi->setupUi(this);
QIcon redoIcon(QLatin1String(":images/16x16/edit-redo.png"));
QIcon undoIcon(QLatin1String(":images/16x16/edit-undo.png"));
QIcon tiledIcon(QLatin1String(":images/tiled-icon-16.png"));
tiledIcon.addFile(QLatin1String(":images/tiled-icon-32.png"));
setWindowIcon(tiledIcon);
// Add larger icon versions for actions used in the tool bar
QIcon newIcon = mUi->actionNew->icon();
QIcon openIcon = mUi->actionOpen->icon();
QIcon saveIcon = mUi->actionSave->icon();
newIcon.addFile(QLatin1String(":images/24x24/document-new.png"));
openIcon.addFile(QLatin1String(":images/24x24/document-open.png"));
saveIcon.addFile(QLatin1String(":images/24x24/document-save.png"));
redoIcon.addFile(QLatin1String(":images/24x24/edit-redo.png"));
undoIcon.addFile(QLatin1String(":images/24x24/edit-undo.png"));
mUi->actionNew->setIcon(newIcon);
mUi->actionOpen->setIcon(openIcon);
mUi->actionSave->setIcon(saveIcon);
mUndoGroup = new QUndoGroup(this);
QAction *undoAction = mUndoGroup->createUndoAction(this, tr("Undo"));
QAction *redoAction = mUndoGroup->createRedoAction(this, tr("Redo"));
redoAction->setIcon(redoIcon);
undoAction->setIcon(undoIcon);
connect(mUndoGroup, SIGNAL(cleanChanged(bool)), SLOT(updateModified()));
UndoDock *undoDock = new UndoDock(mUndoGroup, this);
addDockWidget(Qt::RightDockWidgetArea, mLayerDock);
addDockWidget(Qt::RightDockWidgetArea, undoDock);
tabifyDockWidget(undoDock, mLayerDock);
addDockWidget(Qt::RightDockWidgetArea, mTilesetDock);
updateZoomLabel(mUi->mapView->zoomable()->scale());
connect(mUi->mapView->zoomable(), SIGNAL(scaleChanged(qreal)),
this, SLOT(updateZoomLabel(qreal)));
statusBar()->addPermanentWidget(mZoomLabel);
mUi->actionNew->setShortcut(QKeySequence::New);
mUi->actionOpen->setShortcut(QKeySequence::Open);
mUi->actionSave->setShortcut(QKeySequence::Save);
mUi->actionSaveAs->setShortcut(QKeySequence::SaveAs);
mUi->actionClose->setShortcut(QKeySequence::Close);
#if QT_VERSION >= 0x040600
mUi->actionQuit->setShortcut(QKeySequence::Quit);
#endif
mUi->actionCut->setShortcut(QKeySequence::Cut);
mUi->actionCopy->setShortcut(QKeySequence::Copy);
mUi->actionPaste->setShortcut(QKeySequence::Paste);
mUi->actionSelectAll->setShortcut(QKeySequence::SelectAll);
undoAction->setShortcut(QKeySequence::Undo);
redoAction->setShortcut(QKeySequence::Redo);
mUi->actionZoomIn->setShortcut(QKeySequence::ZoomIn);
mUi->actionZoomOut->setShortcut(QKeySequence::ZoomOut);
mUi->menuEdit->insertAction(mUi->actionCut, undoAction);
mUi->menuEdit->insertAction(mUi->actionCut, redoAction);
mUi->menuEdit->insertSeparator(mUi->actionCut);
mUi->mainToolBar->addAction(undoAction);
mUi->mainToolBar->addAction(redoAction);
connect(mUi->actionNew, SIGNAL(triggered()), SLOT(newMap()));
connect(mUi->actionOpen, SIGNAL(triggered()), SLOT(openFile()));
connect(mUi->actionClearRecentFiles, SIGNAL(triggered()),
SLOT(clearRecentFiles()));
connect(mUi->actionSave, SIGNAL(triggered()), SLOT(saveFile()));
connect(mUi->actionSaveAs, SIGNAL(triggered()), SLOT(saveFileAs()));
connect(mUi->actionSaveAsImage, SIGNAL(triggered()), SLOT(saveAsImage()));
connect(mUi->actionClose, SIGNAL(triggered()), SLOT(closeFile()));
connect(mUi->actionQuit, SIGNAL(triggered()), SLOT(close()));
connect(mUi->actionCut, SIGNAL(triggered()), SLOT(cut()));
connect(mUi->actionCopy, SIGNAL(triggered()), SLOT(copy()));
connect(mUi->actionPaste, SIGNAL(triggered()), SLOT(paste()));
connect(mUi->actionSelectAll, SIGNAL(triggered()), SLOT(selectAll()));
connect(mUi->actionSelectNone, SIGNAL(triggered()), SLOT(selectNone()));
connect(mUi->actionPreferences, SIGNAL(triggered()),
SLOT(openPreferences()));
connect(mUi->actionZoomIn, SIGNAL(triggered()),
mUi->mapView->zoomable(), SLOT(zoomIn()));
connect(mUi->actionZoomOut, SIGNAL(triggered()),
mUi->mapView->zoomable(), SLOT(zoomOut()));
connect(mUi->actionZoomNormal, SIGNAL(triggered()),
mUi->mapView->zoomable(), SLOT(resetZoom()));
connect(mUi->actionNewTileset, SIGNAL(triggered()), SLOT(newTileset()));
connect(mUi->actionResizeMap, SIGNAL(triggered()), SLOT(resizeMap()));
connect(mUi->actionOffsetMap, SIGNAL(triggered()), SLOT(offsetMap()));
connect(mUi->actionMapProperties, SIGNAL(triggered()),
SLOT(editMapProperties()));
connect(mUi->actionAddTileLayer, SIGNAL(triggered()), SLOT(addTileLayer()));
connect(mUi->actionAddObjectLayer, SIGNAL(triggered()),
SLOT(addObjectLayer()));
connect(mUi->actionDuplicateLayer, SIGNAL(triggered()),
SLOT(duplicateLayer()));
connect(mUi->actionMoveLayerUp, SIGNAL(triggered()), SLOT(moveLayerUp()));
connect(mUi->actionMoveLayerDown, SIGNAL(triggered()),
SLOT(moveLayerDown()));
connect(mUi->actionRemoveLayer, SIGNAL(triggered()), SLOT(removeLayer()));
connect(mUi->actionLayerProperties, SIGNAL(triggered()),
SLOT(editLayerProperties()));
connect(mUi->actionAbout, SIGNAL(triggered()), SLOT(aboutTiled()));
connect(mUi->actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
// Add recent file actions to the recent files menu
QMenu *menu = mUi->menuRecentFiles;
for (int i = 0; i < MaxRecentFiles; ++i)
{
mRecentFiles[i] = new QAction(this);
menu->insertAction
没有合适的资源?快使用搜索试试~ 我知道了~
til.rar_currentRowChanged_qt tile_til_tilemap qt_地图编辑器
共233个文件
h:75个
cpp:72个
png:54个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 22 浏览量
2022-09-23
09:45:18
上传
评论
收藏 399KB RAR 举报
温馨提示
Tile开源地图编辑器,这个版本是用Qt编写的,但和java片的一样使用方便。
资源推荐
资源详情
资源评论
收起资源包目录
til.rar_currentRowChanged_qt tile_til_tilemap qt_地图编辑器 (233个子文件)
AUTHORS 601B
COPYING 18KB
mainwindow.cpp 28KB
tmxmapreader.cpp 22KB
mapscene.cpp 14KB
tmxmapwriter.cpp 13KB
mapobjectitem.cpp 12KB
tilepainter.cpp 10KB
isometricrenderer.cpp 9KB
mapdocument.cpp 8KB
orthogonalrenderer.cpp 8KB
layerdock.cpp 6KB
bucketfilltool.cpp 6KB
saveasimagedialog.cpp 5KB
stampbrush.cpp 5KB
tilesetview.cpp 5KB
tilelayer.cpp 5KB
resizehelper.cpp 5KB
tilesetdock.cpp 5KB
layermodel.cpp 5KB
compression.cpp 5KB
toolmanager.cpp 4KB
abstracttiletool.cpp 4KB
propertiesmodel.cpp 4KB
tilesetmanager.cpp 4KB
selectiontool.cpp 4KB
preferencesdialog.cpp 4KB
propertiesdialog.cpp 4KB
preferences.cpp 4KB
main.cpp 4KB
clipboardmanager.cpp 4KB
mapview.cpp 4KB
painttilelayer.cpp 4KB
objectgroup.cpp 3KB
brushitem.cpp 3KB
offsetmapdialog.cpp 3KB
languagemanager.cpp 3KB
newtilesetdialog.cpp 3KB
erasetiles.cpp 3KB
tileset.cpp 3KB
addremovemapobject.cpp 3KB
tileselectionitem.cpp 3KB
objectgrouppropertiesdialog.cpp 3KB
objectpropertiesdialog.cpp 2KB
eraser.cpp 2KB
tilesetmodel.cpp 2KB
offsetlayer.cpp 2KB
utils.cpp 2KB
map.cpp 2KB
resizelayer.cpp 2KB
resizedialog.cpp 2KB
movelayer.cpp 2KB
addremovelayer.cpp 2KB
filltiles.cpp 2KB
zoomable.cpp 2KB
propertiesview.cpp 2KB
layer.cpp 2KB
newmapdialog.cpp 2KB
tilelayeritem.cpp 2KB
changemapobject.cpp 2KB
undodock.cpp 2KB
colorbutton.cpp 2KB
changeobjectgroupproperties.cpp 2KB
renamelayer.cpp 2KB
changeproperties.cpp 2KB
objectgroupitem.cpp 2KB
resizemapobject.cpp 2KB
test_tmxmapreader.cpp 2KB
movemapobject.cpp 2KB
changeselection.cpp 2KB
resizemap.cpp 2KB
mapobject.cpp 1KB
abstracttool.cpp 1KB
aboutdialog.cpp 1KB
Doxyfile 9KB
.gitignore 104B
mapdocument.h 6KB
map.h 6KB
tileset.h 5KB
mapobject.h 5KB
mainwindow.h 4KB
maprenderer.h 4KB
layer.h 4KB
abstracttool.h 4KB
tilesetmanager.h 4KB
mapscene.h 4KB
abstracttiletool.h 4KB
tilepainter.h 4KB
layermodel.h 4KB
tilelayer.h 3KB
tmxmapwriter.h 3KB
mapobjectitem.h 3KB
objectgroup.h 3KB
propertiesmodel.h 3KB
resizehelper.h 3KB
stampbrush.h 3KB
toolmanager.h 3KB
tilesetmodel.h 3KB
isometricrenderer.h 2KB
addremovelayer.h 2KB
共 233 条
- 1
- 2
- 3
资源评论
四散
- 粉丝: 49
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功