Changeset e6ab8a2 for src/gui/tabcontainer.cpp
- Timestamp:
- 07/04/11 23:42:02 (12 years ago)
- Branches:
- master, qt5
- Children:
- 526128c
- Parents:
- 8dd3dd2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/tabcontainer.cpp
r8dd3dd2 re6ab8a2 28 28 29 29 #include "eventdialog.h" 30 #include "mapwindow.h"31 30 #include "room.h" 32 31 #include "errormessage.h" … … 50 49 connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool))); 51 50 connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 52 connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));53 51 connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &))); 54 52 … … 81 79 dialog.exec(); 82 80 disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); 83 }84 85 void TabContainer::displayMap(const QModelIndex &aIndex)86 {87 Event *event = static_cast<Event*>(aIndex.internalPointer());88 89 QVariant mapPathV = event->room()->map();90 QString mapPath;91 if (!mapPathV.isValid()) {92 error_message("No map for this room");93 return;94 } else {95 mapPath = mapPathV.toString();96 if (!QFile::exists(mapPath)) {97 error_message("Map for this room not found: " + mapPath);98 return;99 }100 }101 102 QPixmap map(mapPath);103 MapWindow window(map, event->room()->name(),this);104 window.exec();105 81 } 106 82
Note: See TracChangeset
for help on using the changeset viewer.