Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

finetuning display

  • Loading branch information...
commit c40589f586f253ca8d43079a26601b3a65c7cfc4 1 parent af05f50
@Gabriano Gabriano authored
Showing with 16 additions and 3 deletions.
  1. +14 −3 pages/bookingspage.cpp
  2. +2 −0  pages/bookingspage.h
View
17 pages/bookingspage.cpp
@@ -15,14 +15,14 @@ BookingsPage::BookingsPage(
{
addTitle(trUtf8("Mes réservations"));
- QTableView *bookings = new QTableView(this);
+ bookings = new QTableView(this);
bookings->setModel(reservationProxy);
bookings->setSelectionBehavior(QAbstractItemView::SelectRows);
bookings->setSelectionMode(QAbstractItemView::SingleSelection);
bookings->verticalHeader()->hide();
bookings->hideColumn(0);
- //bookings->resizeColumnToContents(1);
- //bookings->resizeColumnToContents(2);
+ bookings->resizeColumnToContents(1);
+ bookings->resizeColumnToContents(2);
bookings->resizeColumnToContents(3);
bookings->resizeColumnToContents(4);
bookings->resizeColumnToContents(5);
@@ -59,4 +59,15 @@ BookingsPage::BookingsPage(
connect(past, SIGNAL(clicked(bool)), SIGNAL(includePastRes(bool)));
connect(current, SIGNAL(clicked(bool)), SIGNAL(includeCurrentRes(bool)));
connect(futur, SIGNAL(clicked(bool)), SIGNAL(includeFuturRes(bool)));
+ connect(bookings->model(), SIGNAL(dataChanged(QModelIndex,QModelIndex)), SLOT(resizeCols()));
+}
+
+void BookingsPage::resizeCols() {
+ qDebug() << "resizingCols";
+ bookings->resizeColumnToContents(1);
+ bookings->resizeColumnToContents(2);
+ bookings->resizeColumnToContents(3);
+ bookings->resizeColumnToContents(4);
+ bookings->resizeColumnToContents(5);
+ bookings->resizeColumnToContents(6);
}
View
2  pages/bookingspage.h
@@ -20,9 +20,11 @@ class BookingsPage : public Page
void includeFuturRes(bool);
public slots:
+ void resizeCols();
private:
ReservationFilterProxy *reservationProxy;
+ QTableView *bookings;
};
#endif // BOOKINGSPAGE_H
Please sign in to comment.
Something went wrong with that request. Please try again.