Skip to content
Browse files

Started working on the inners of selecting a vehicle

  • Loading branch information...
1 parent c683519 commit d73cbfd6293267e786a2a8bf6fcbc69ce9948707 @gnuvince committed Apr 26, 2011
Showing with 129 additions and 27 deletions.
  1. +38 −11 Makefile
  2. +1 −1 mainwindow.cpp
  3. +11 −2 pages/selectcarpage.cpp
  4. +5 −1 pages/selectcarpage.h
  5. +4 −2 projet.pro
  6. +1 −1 qrc_icones.cpp
  7. +1 −1 ui_cartewidget.h
  8. +1 −1 ui_mainwindow.h
  9. +1 −1 ui_userinterface.h
  10. +7 −1 userinterface.cpp
  11. +7 −1 userinterface.h
  12. +4 −3 vehicule.cpp
  13. +1 −1 vehicule.h
  14. +20 −0 vehiculefilterproxy.cpp
  15. +22 −0 vehiculefilterproxy.h
  16. +5 −0 vehiculemodel.cpp
View
49 Makefile
@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: projet
-# Generated by qmake (2.01a) (Qt 4.7.2) on: Mon Apr 25 14:02:41 2011
+# Generated by qmake (2.01a) (Qt 4.7.2) on: Tue Apr 26 09:53:16 2011
# Project: projet.pro
# Template: app
# Command: /usr/bin/qmake -spec /usr/share/qt/mkspecs/linux-g++-64 QMLJSDEBUGGER_PATH=/usr/share/qtcreator/qml/qmljsdebugger -o Makefile projet.pro
@@ -79,7 +79,8 @@ SOURCES = geoposition.cpp \
pages/bookingspage.cpp \
pages/mymessagespage.cpp \
pages/writecommentpage.cpp \
- pages/infostationpage.cpp moc_geopositiondelegate.cpp \
+ pages/infostationpage.cpp \
+ vehiculefilterproxy.cpp moc_geopositiondelegate.cpp \
moc_mainwindow.cpp \
moc_note.cpp \
moc_notemodel.cpp \
@@ -113,6 +114,7 @@ SOURCES = geoposition.cpp \
moc_mymessagespage.cpp \
moc_writecommentpage.cpp \
moc_infostationpage.cpp \
+ moc_vehiculefilterproxy.cpp \
qrc_icones.cpp
OBJECTS = geoposition.o \
geopositiondelegate.o \
@@ -151,6 +153,7 @@ OBJECTS = geoposition.o \
mymessagespage.o \
writecommentpage.o \
infostationpage.o \
+ vehiculefilterproxy.o \
moc_geopositiondelegate.o \
moc_mainwindow.o \
moc_note.o \
@@ -185,6 +188,7 @@ OBJECTS = geoposition.o \
moc_mymessagespage.o \
moc_writecommentpage.o \
moc_infostationpage.o \
+ moc_vehiculefilterproxy.o \
qrc_icones.o
DIST = /usr/share/qt/mkspecs/common/g++.conf \
/usr/share/qt/mkspecs/common/unix.conf \
@@ -291,7 +295,7 @@ qmake: FORCE
dist:
@$(CHK_DIR_EXISTS) .tmp/projet1.0.0 || $(MKDIR) .tmp/projet1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/projet1.0.0/ && $(COPY_FILE) --parents geoposition.h geopositiondelegate.h mainwindow.h manote.h note.h notemodel.h reservation.h reservationmodel.h simulateur.h station.h stationmodel.h usager.h usagermodel.h vehicule.h vehiculemodel.h robot.h reservationproxymodel.h cartescene.h carteelements.h cartewidget.h userinterface.h pages/page.h pages/mainmenupage.h pages/findstationpage.h pages/selectpositionpage.h pages/selectstationpage.h pages/selecttimepage.h pages/selectcarpage.h pages/confirmpage.h stationsortproxy.h pages/commentspage.h pages/unexpectedpage.h pages/myrsvppage.h pages/bookingspage.h pages/mymessagespage.h pages/writecommentpage.h pages/infostationpage.h .tmp/projet1.0.0/ && $(COPY_FILE) --parents icones.qrc .tmp/projet1.0.0/ && $(COPY_FILE) --parents geoposition.cpp geopositiondelegate.cpp main.cpp mainwindow.cpp manote.cpp note.cpp notemodel.cpp reservation.cpp reservationmodel.cpp simulateur.cpp station.cpp stationmodel.cpp usager.cpp usagermodel.cpp vehicule.cpp vehiculemodel.cpp reservationproxymodel.cpp robot.cpp cartescene.cpp carteelements.cpp cartewidget.cpp userinterface.cpp pages/page.cpp pages/mainmenupage.cpp pages/findstationpage.cpp pages/selectpositionpage.cpp pages/selectstationpage.cpp pages/selecttimepage.cpp pages/selectcarpage.cpp pages/confirmpage.cpp stationsortproxy.cpp pages/commentspage.cpp pages/unexpectedpage.cpp pages/bookingspage.cpp pages/mymessagespage.cpp pages/writecommentpage.cpp pages/infostationpage.cpp .tmp/projet1.0.0/ && $(COPY_FILE) --parents mainwindow.ui cartewidget.ui userinterface.ui .tmp/projet1.0.0/ && (cd `dirname .tmp/projet1.0.0` && $(TAR) projet1.0.0.tar projet1.0.0 && $(COMPRESS) projet1.0.0.tar) && $(MOVE) `dirname .tmp/projet1.0.0`/projet1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/projet1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/projet1.0.0/ && $(COPY_FILE) --parents geoposition.h geopositiondelegate.h mainwindow.h manote.h note.h notemodel.h reservation.h reservationmodel.h simulateur.h station.h stationmodel.h usager.h usagermodel.h vehicule.h vehiculemodel.h robot.h reservationproxymodel.h cartescene.h carteelements.h cartewidget.h userinterface.h pages/page.h pages/mainmenupage.h pages/findstationpage.h pages/selectpositionpage.h pages/selectstationpage.h pages/selecttimepage.h pages/selectcarpage.h pages/confirmpage.h stationsortproxy.h pages/commentspage.h pages/unexpectedpage.h pages/myrsvppage.h pages/bookingspage.h pages/mymessagespage.h pages/writecommentpage.h pages/infostationpage.h vehiculefilterproxy.h .tmp/projet1.0.0/ && $(COPY_FILE) --parents icones.qrc .tmp/projet1.0.0/ && $(COPY_FILE) --parents geoposition.cpp geopositiondelegate.cpp main.cpp mainwindow.cpp manote.cpp note.cpp notemodel.cpp reservation.cpp reservationmodel.cpp simulateur.cpp station.cpp stationmodel.cpp usager.cpp usagermodel.cpp vehicule.cpp vehiculemodel.cpp reservationproxymodel.cpp robot.cpp cartescene.cpp carteelements.cpp cartewidget.cpp userinterface.cpp pages/page.cpp pages/mainmenupage.cpp pages/findstationpage.cpp pages/selectpositionpage.cpp pages/selectstationpage.cpp pages/selecttimepage.cpp pages/selectcarpage.cpp pages/confirmpage.cpp stationsortproxy.cpp pages/commentspage.cpp pages/unexpectedpage.cpp pages/bookingspage.cpp pages/mymessagespage.cpp pages/writecommentpage.cpp pages/infostationpage.cpp vehiculefilterproxy.cpp .tmp/projet1.0.0/ && $(COPY_FILE) --parents mainwindow.ui cartewidget.ui userinterface.ui .tmp/projet1.0.0/ && (cd `dirname .tmp/projet1.0.0` && $(TAR) projet1.0.0.tar projet1.0.0 && $(COMPRESS) projet1.0.0.tar) && $(MOVE) `dirname .tmp/projet1.0.0`/projet1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/projet1.0.0
clean:compiler_clean
@@ -307,17 +311,17 @@ distclean: clean
tar:
- tar -zcf projet.tar.gz geoposition.cpp geopositiondelegate.cpp main.cpp mainwindow.cpp manote.cpp note.cpp notemodel.cpp reservation.cpp reservationmodel.cpp simulateur.cpp station.cpp stationmodel.cpp usager.cpp usagermodel.cpp vehicule.cpp vehiculemodel.cpp reservationproxymodel.cpp robot.cpp cartescene.cpp carteelements.cpp cartewidget.cpp userinterface.cpp pages/page.cpp pages/mainmenupage.cpp pages/findstationpage.cpp pages/selectpositionpage.cpp pages/selectstationpage.cpp pages/selecttimepage.cpp pages/selectcarpage.cpp pages/confirmpage.cpp stationsortproxy.cpp pages/commentspage.cpp pages/unexpectedpage.cpp pages/bookingspage.cpp pages/mymessagespage.cpp pages/writecommentpage.cpp pages/infostationpage.cpp geoposition.h geopositiondelegate.h mainwindow.h manote.h note.h notemodel.h reservation.h reservationmodel.h simulateur.h station.h stationmodel.h usager.h usagermodel.h vehicule.h vehiculemodel.h robot.h reservationproxymodel.h cartescene.h carteelements.h cartewidget.h userinterface.h pages/page.h pages/mainmenupage.h pages/findstationpage.h pages/selectpositionpage.h pages/selectstationpage.h pages/selecttimepage.h pages/selectcarpage.h pages/confirmpage.h stationsortproxy.h pages/commentspage.h pages/unexpectedpage.h pages/myrsvppage.h pages/bookingspage.h pages/mymessagespage.h pages/writecommentpage.h pages/infostationpage.h mainwindow.ui cartewidget.ui userinterface.ui icones.qrc data/xml/map_montreal.osm data/xml/*.xml data/images/icons/*.png data/images/stations/*.jpg data/images/stations/*.gif data/images/vehicules/*.png projet.pro
+ tar -zcf projet.tar.gz geoposition.cpp geopositiondelegate.cpp main.cpp mainwindow.cpp manote.cpp note.cpp notemodel.cpp reservation.cpp reservationmodel.cpp simulateur.cpp station.cpp stationmodel.cpp usager.cpp usagermodel.cpp vehicule.cpp vehiculemodel.cpp reservationproxymodel.cpp robot.cpp cartescene.cpp carteelements.cpp cartewidget.cpp userinterface.cpp pages/page.cpp pages/mainmenupage.cpp pages/findstationpage.cpp pages/selectpositionpage.cpp pages/selectstationpage.cpp pages/selecttimepage.cpp pages/selectcarpage.cpp pages/confirmpage.cpp stationsortproxy.cpp pages/commentspage.cpp pages/unexpectedpage.cpp pages/bookingspage.cpp pages/mymessagespage.cpp pages/writecommentpage.cpp pages/infostationpage.cpp vehiculefilterproxy.cpp geoposition.h geopositiondelegate.h mainwindow.h manote.h note.h notemodel.h reservation.h reservationmodel.h simulateur.h station.h stationmodel.h usager.h usagermodel.h vehicule.h vehiculemodel.h robot.h reservationproxymodel.h cartescene.h carteelements.h cartewidget.h userinterface.h pages/page.h pages/mainmenupage.h pages/findstationpage.h pages/selectpositionpage.h pages/selectstationpage.h pages/selecttimepage.h pages/selectcarpage.h pages/confirmpage.h stationsortproxy.h pages/commentspage.h pages/unexpectedpage.h pages/myrsvppage.h pages/bookingspage.h pages/mymessagespage.h pages/writecommentpage.h pages/infostationpage.h vehiculefilterproxy.h mainwindow.ui cartewidget.ui userinterface.ui icones.qrc data/xml/map_montreal.osm data/xml/*.xml data/images/icons/*.png data/images/stations/*.jpg data/images/stations/*.gif data/images/vehicules/*.png projet.pro
check: first
mocclean: compiler_moc_header_clean compiler_moc_source_clean
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
-compiler_moc_header_make_all: moc_geopositiondelegate.cpp moc_mainwindow.cpp moc_note.cpp moc_notemodel.cpp moc_reservation.cpp moc_reservationmodel.cpp moc_simulateur.cpp moc_station.cpp moc_stationmodel.cpp moc_usager.cpp moc_usagermodel.cpp moc_vehicule.cpp moc_vehiculemodel.cpp moc_robot.cpp moc_reservationproxymodel.cpp moc_cartescene.cpp moc_carteelements.cpp moc_cartewidget.cpp moc_userinterface.cpp moc_page.cpp moc_mainmenupage.cpp moc_findstationpage.cpp moc_selectpositionpage.cpp moc_selectstationpage.cpp moc_selecttimepage.cpp moc_selectcarpage.cpp moc_confirmpage.cpp moc_stationsortproxy.cpp moc_commentspage.cpp moc_unexpectedpage.cpp moc_bookingspage.cpp moc_mymessagespage.cpp moc_writecommentpage.cpp moc_infostationpage.cpp
+compiler_moc_header_make_all: moc_geopositiondelegate.cpp moc_mainwindow.cpp moc_note.cpp moc_notemodel.cpp moc_reservation.cpp moc_reservationmodel.cpp moc_simulateur.cpp moc_station.cpp moc_stationmodel.cpp moc_usager.cpp moc_usagermodel.cpp moc_vehicule.cpp moc_vehiculemodel.cpp moc_robot.cpp moc_reservationproxymodel.cpp moc_cartescene.cpp moc_carteelements.cpp moc_cartewidget.cpp moc_userinterface.cpp moc_page.cpp moc_mainmenupage.cpp moc_findstationpage.cpp moc_selectpositionpage.cpp moc_selectstationpage.cpp moc_selecttimepage.cpp moc_selectcarpage.cpp moc_confirmpage.cpp moc_stationsortproxy.cpp moc_commentspage.cpp moc_unexpectedpage.cpp moc_bookingspage.cpp moc_mymessagespage.cpp moc_writecommentpage.cpp moc_infostationpage.cpp moc_vehiculefilterproxy.cpp
compiler_moc_header_clean:
- -$(DEL_FILE) moc_geopositiondelegate.cpp moc_mainwindow.cpp moc_note.cpp moc_notemodel.cpp moc_reservation.cpp moc_reservationmodel.cpp moc_simulateur.cpp moc_station.cpp moc_stationmodel.cpp moc_usager.cpp moc_usagermodel.cpp moc_vehicule.cpp moc_vehiculemodel.cpp moc_robot.cpp moc_reservationproxymodel.cpp moc_cartescene.cpp moc_carteelements.cpp moc_cartewidget.cpp moc_userinterface.cpp moc_page.cpp moc_mainmenupage.cpp moc_findstationpage.cpp moc_selectpositionpage.cpp moc_selectstationpage.cpp moc_selecttimepage.cpp moc_selectcarpage.cpp moc_confirmpage.cpp moc_stationsortproxy.cpp moc_commentspage.cpp moc_unexpectedpage.cpp moc_bookingspage.cpp moc_mymessagespage.cpp moc_writecommentpage.cpp moc_infostationpage.cpp
+ -$(DEL_FILE) moc_geopositiondelegate.cpp moc_mainwindow.cpp moc_note.cpp moc_notemodel.cpp moc_reservation.cpp moc_reservationmodel.cpp moc_simulateur.cpp moc_station.cpp moc_stationmodel.cpp moc_usager.cpp moc_usagermodel.cpp moc_vehicule.cpp moc_vehiculemodel.cpp moc_robot.cpp moc_reservationproxymodel.cpp moc_cartescene.cpp moc_carteelements.cpp moc_cartewidget.cpp moc_userinterface.cpp moc_page.cpp moc_mainmenupage.cpp moc_findstationpage.cpp moc_selectpositionpage.cpp moc_selectstationpage.cpp moc_selecttimepage.cpp moc_selectcarpage.cpp moc_confirmpage.cpp moc_stationsortproxy.cpp moc_commentspage.cpp moc_unexpectedpage.cpp moc_bookingspage.cpp moc_mymessagespage.cpp moc_writecommentpage.cpp moc_infostationpage.cpp moc_vehiculefilterproxy.cpp
moc_geopositiondelegate.cpp: geopositiondelegate.h
/usr/bin/moc $(DEFINES) $(INCPATH) geopositiondelegate.h -o moc_geopositiondelegate.cpp
@@ -391,6 +395,9 @@ moc_userinterface.cpp: pages/page.h \
geoposition.h \
stationmodel.h \
stationsortproxy.h \
+ vehiculemodel.h \
+ vehicule.h \
+ vehiculefilterproxy.h \
userinterface.h
/usr/bin/moc $(DEFINES) $(INCPATH) userinterface.h -o moc_userinterface.cpp
@@ -412,6 +419,8 @@ moc_selectpositionpage.cpp: pages/page.h \
/usr/bin/moc $(DEFINES) $(INCPATH) pages/selectpositionpage.h -o moc_selectpositionpage.cpp
moc_selectstationpage.cpp: stationsortproxy.h \
+ station.h \
+ geoposition.h \
pages/page.h \
pages/selectstationpage.h
/usr/bin/moc $(DEFINES) $(INCPATH) pages/selectstationpage.h -o moc_selectstationpage.cpp
@@ -421,6 +430,7 @@ moc_selecttimepage.cpp: pages/page.h \
/usr/bin/moc $(DEFINES) $(INCPATH) pages/selecttimepage.h -o moc_selecttimepage.cpp
moc_selectcarpage.cpp: pages/page.h \
+ vehiculefilterproxy.h \
pages/selectcarpage.h
/usr/bin/moc $(DEFINES) $(INCPATH) pages/selectcarpage.h -o moc_selectcarpage.cpp
@@ -457,6 +467,9 @@ moc_infostationpage.cpp: pages/page.h \
pages/infostationpage.h
/usr/bin/moc $(DEFINES) $(INCPATH) pages/infostationpage.h -o moc_infostationpage.cpp
+moc_vehiculefilterproxy.cpp: vehiculefilterproxy.h
+ /usr/bin/moc $(DEFINES) $(INCPATH) vehiculefilterproxy.h -o moc_vehiculefilterproxy.cpp
+
compiler_rcc_make_all: qrc_icones.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_icones.cpp
@@ -536,7 +549,8 @@ mainwindow.o: mainwindow.cpp mainwindow.h \
carteelements.h \
userinterface.h \
pages/page.h \
- stationsortproxy.h
+ stationsortproxy.h \
+ vehiculefilterproxy.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp
manote.o: manote.cpp manote.h \
@@ -626,6 +640,9 @@ userinterface.o: userinterface.cpp userinterface.h \
geoposition.h \
stationmodel.h \
stationsortproxy.h \
+ vehiculemodel.h \
+ vehicule.h \
+ vehiculefilterproxy.h \
ui_userinterface.h \
pages/mainmenupage.h \
pages/findstationpage.h \
@@ -639,7 +656,8 @@ userinterface.o: userinterface.cpp userinterface.h \
pages/unexpectedpage.h \
pages/bookingspage.h \
pages/mymessagespage.h \
- pages/writecommentpage.h
+ pages/writecommentpage.h \
+ pages/infostationpage.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o userinterface.o userinterface.cpp
page.o: pages/page.cpp pages/page.h
@@ -663,18 +681,20 @@ selectpositionpage.o: pages/selectpositionpage.cpp pages/page.h \
selectstationpage.o: pages/selectstationpage.cpp pages/selectstationpage.h \
stationsortproxy.h \
+ station.h \
+ geoposition.h \
pages/page.h \
pages/infostationpage.h \
- station.h \
- geoposition.h
+ stationmodel.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o selectstationpage.o pages/selectstationpage.cpp
selecttimepage.o: pages/selecttimepage.cpp pages/page.h \
pages/selecttimepage.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o selecttimepage.o pages/selecttimepage.cpp
selectcarpage.o: pages/selectcarpage.cpp pages/page.h \
- pages/selectcarpage.h
+ pages/selectcarpage.h \
+ vehiculefilterproxy.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o selectcarpage.o pages/selectcarpage.cpp
confirmpage.o: pages/confirmpage.cpp pages/page.h \
@@ -712,6 +732,10 @@ infostationpage.o: pages/infostationpage.cpp pages/page.h \
pages/infostationpage.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o infostationpage.o pages/infostationpage.cpp
+vehiculefilterproxy.o: vehiculefilterproxy.cpp vehiculefilterproxy.h \
+ vehicule.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o vehiculefilterproxy.o vehiculefilterproxy.cpp
+
moc_geopositiondelegate.o: moc_geopositiondelegate.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_geopositiondelegate.o moc_geopositiondelegate.cpp
@@ -814,6 +838,9 @@ moc_writecommentpage.o: moc_writecommentpage.cpp
moc_infostationpage.o: moc_infostationpage.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_infostationpage.o moc_infostationpage.cpp
+moc_vehiculefilterproxy.o: moc_vehiculefilterproxy.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_vehiculefilterproxy.o moc_vehiculefilterproxy.cpp
+
qrc_icones.o: qrc_icones.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_icones.o qrc_icones.cpp
View
2 mainwindow.cpp
@@ -153,7 +153,7 @@ MainWindow::MainWindow(QWidget *parent) :
//important tout le monde partage la scène !
CarteWidget::setScene(scene);
- UserInterface *userInterface = new UserInterface(smodel, this);
+ UserInterface *userInterface = new UserInterface(smodel, vmodel, this);
userInterface->show();
}
View
13 pages/selectcarpage.cpp
@@ -3,13 +3,22 @@
#include "page.h"
#include "selectcarpage.h"
+#include "vehiculefilterproxy.h"
-SelectCarPage::SelectCarPage(QWidget *parent) :
- Page(parent)
+SelectCarPage::SelectCarPage(VehiculeFilterProxy *vproxy, QWidget *parent) :
+ Page(parent),
+ vehiculeProxy(vproxy)
{
addTitle(trUtf8("Choisir le véhicule\n(5 / 5)"));
QTableView *view = new QTableView(this);
+ view->setModel(vehiculeProxy);
+ view->setSelectionBehavior(QAbstractItemView::SelectRows);
+ view->setSelectionMode(QAbstractItemView::SingleSelection);
+ view->verticalHeader()->hide();
+ view->hideColumn(0);
+ view->resizeColumnsToContents();
+ view->resizeRowsToContents();
addWidget(view);
QPushButton *btnPrevious = new QPushButton(this);
View
6 pages/selectcarpage.h
@@ -4,12 +4,16 @@
#include <QtGui>
#include "page.h"
+#include "vehiculefilterproxy.h"
class SelectCarPage : public Page
{
Q_OBJECT
public:
- explicit SelectCarPage(QWidget *parent = 0);
+ explicit SelectCarPage(VehiculeFilterProxy *vproxy, QWidget *parent = 0);
+
+private:
+ VehiculeFilterProxy *vehiculeProxy;
signals:
View
6 projet.pro
@@ -51,7 +51,8 @@ HEADERS += geoposition.h \
pages/bookingspage.h \
pages/mymessagespage.h \
pages/writecommentpage.h \
- pages/infostationpage.h
+ pages/infostationpage.h \
+ vehiculefilterproxy.h
FORMS += mainwindow.ui \
cartewidget.ui \
userinterface.ui
@@ -91,7 +92,8 @@ SOURCES += geoposition.cpp \
pages/bookingspage.cpp \
pages/mymessagespage.cpp \
pages/writecommentpage.cpp \
- pages/infostationpage.cpp
+ pages/infostationpage.cpp \
+ vehiculefilterproxy.cpp
RESOURCES += \
icones.qrc
View
2 qrc_icones.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
** Resource object code
**
-** Created: Mon Apr 25 11:17:40 2011
+** Created: Mon Apr 25 22:04:50 2011
** by: The Resource Compiler for Qt version 4.7.2
**
** WARNING! All changes made in this file will be lost!
View
2 ui_cartewidget.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'cartewidget.ui'
**
-** Created: Fri Apr 15 11:47:49 2011
+** Created: Mon Apr 25 22:02:45 2011
** by: Qt User Interface Compiler version 4.7.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
View
2 ui_mainwindow.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'mainwindow.ui'
**
-** Created: Fri Apr 15 11:47:49 2011
+** Created: Mon Apr 25 22:02:45 2011
** by: Qt User Interface Compiler version 4.7.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
View
2 ui_userinterface.h
@@ -1,7 +1,7 @@
/********************************************************************************
** Form generated from reading UI file 'userinterface.ui'
**
-** Created: Mon Apr 25 19:21:26 2011
+** Created: Mon Apr 25 22:02:45 2011
** by: Qt User Interface Compiler version 4.7.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
View
8 userinterface.cpp
@@ -27,9 +27,11 @@
UserInterface::UserInterface(
StationModel *smodel,
+ VehiculeModel *vmodel,
QWidget *parent) :
QMainWindow(parent),
stationModel(smodel),
+ vehiculeModel(vmodel),
ui(new Ui::UserInterface)
{
ui->setupUi(this);
@@ -42,14 +44,18 @@ UserInterface::UserInterface(
stationProxy->setDynamicSortFilter(true);
stationProxy->sort(1);
+ vehiculeProxy = new VehiculeFilterProxy(this);
+ vehiculeProxy->setSourceModel(vehiculeModel);
+ vehiculeProxy->setDynamicSortFilter(true);
+
pages = new QMap<PageName, Page*>;
pages->insert(Page_MainMenu, new MainMenuPage(this));
pages->insert(Page_FindStation, new FindStationPage(this));
pages->insert(Page_SelectPosition, new SelectPositionPage(this));
pages->insert(Page_SelectStation, new SelectStationPage(stationProxy, this));
pages->insert(Page_SelectTime, new SelectTimePage(this));
- pages->insert(Page_SelectCar, new SelectCarPage(this));
+ pages->insert(Page_SelectCar, new SelectCarPage(vehiculeProxy, this));
pages->insert(Page_Confirm, new ConfirmPage(this));
pages->insert(Page_Bookings, new BookingsPage(this));
pages->insert(Page_Comments, new CommentsPage(this)); // comments main page
View
8 userinterface.h
@@ -10,6 +10,8 @@
#include "station.h"
#include "stationmodel.h"
#include "stationsortproxy.h"
+#include "vehiculemodel.h"
+#include "vehiculefilterproxy.h"
#include "geoposition.h"
enum PageName { Page_MainMenu,
@@ -28,6 +30,7 @@ class UserInterface : public QMainWindow
public:
explicit UserInterface(
StationModel *smodel,
+ VehiculeModel *vmodel,
QWidget *parent = 0);
~UserInterface();
@@ -36,8 +39,11 @@ class UserInterface : public QMainWindow
QMap<PageName, Page*> *pages;
Page* getPage(PageName name);
StationModel *stationModel;
- GeoPosition *currentPosition;
StationSortProxy *stationProxy;
+ VehiculeModel *vehiculeModel;
+ VehiculeFilterProxy *vehiculeProxy;
+ GeoPosition *currentPosition;
+
public slots:
void gotoPage(PageName name);
View
7 vehicule.cpp
@@ -31,11 +31,12 @@
QStringList& Vehicule::headers() {
static QStringList _headers = QStringList()
<< trUtf8("id")
- << trUtf8("marque")
- << trUtf8("modele")
+ << trUtf8("Marque")
+ << trUtf8("Modèle")
<< trUtf8("couleur")
<< trUtf8("description")
- << trUtf8("photo");
+ << trUtf8("photo")
+ << trUtf8("Info");
return _headers;
}
View
2 vehicule.h
@@ -31,7 +31,7 @@ class Vehicule : public QObject
{
Q_OBJECT
public:
- enum Colonnes { COL_ID, COL_MARQUE, COL_MODELE, COL_COULEUR, COL_DESCRIPTION, COL_PHOTO, COL_PERSO };
+ enum Colonnes { COL_ID, COL_MARQUE, COL_MODELE, COL_COULEUR, COL_DESCRIPTION, COL_PHOTO, COL_INFO };
explicit Vehicule(qint64 id,QString marque,QString modele,QString couleur,QString description,QPixmap photo, QObject *parent=0);
View
20 vehiculefilterproxy.cpp
@@ -0,0 +1,20 @@
+#include "vehiculefilterproxy.h"
+#include "vehicule.h"
+
+VehiculeFilterProxy::VehiculeFilterProxy(QObject *parent) :
+ QSortFilterProxyModel(parent)
+{
+}
+
+
+bool VehiculeFilterProxy::filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const {
+ return source_column == Vehicule::COL_ID
+ || source_column == Vehicule::COL_MARQUE
+ || source_column == Vehicule::COL_MODELE
+ || source_column == Vehicule::COL_INFO;
+}
+
+
+bool VehiculeFilterProxy::filterAcceptsRow(int source_row, const QModelIndex &source_parent) const {
+ return true;
+}
View
22 vehiculefilterproxy.h
@@ -0,0 +1,22 @@
+#ifndef VEHICULEFILTERPROXY_H
+#define VEHICULEFILTERPROXY_H
+
+#include <QSortFilterProxyModel>
+
+class VehiculeFilterProxy : public QSortFilterProxyModel
+{
+ Q_OBJECT
+public:
+ explicit VehiculeFilterProxy(QObject *parent = 0);
+
+protected:
+ bool filterAcceptsColumn(int source_column, const QModelIndex &source_parent) const;
+ bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const;
+
+signals:
+
+public slots:
+
+};
+
+#endif // VEHICULEFILTERPROXY_H
View
5 vehiculemodel.cpp
@@ -34,13 +34,18 @@ QVariant VehiculeModel::fieldAt(const QModelIndex &index, int role) const
qint64 id = vehicules.keys()[row];
Vehicule *v = vehicules[id];
+ if (column == Vehicule::COL_INFO && role == Qt::DecorationRole) {
+ return QPixmap(":/icones/data/icons/help.png");
+ }
+
return v->field(column, role);
}
QVariant VehiculeModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
+
return fieldAt(index, role);
}

0 comments on commit d73cbfd

Please sign in to comment.
Something went wrong with that request. Please try again.