From 125bbb8b79dbe7c83c19b74cdcf309c7116410b3 Mon Sep 17 00:00:00 2001 From: John Levon Date: Fri, 31 Aug 2001 03:01:11 +0000 Subject: [PATCH] fix tab create to layout properly git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2635 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 9 +++ src/frontends/qt2/QTabularCreateDialog.C | 4 +- src/frontends/qt2/emptytable.C | 8 ++ src/frontends/qt2/emptytable.h | 2 + src/frontends/qt2/ui/QTabularCreateDialog.ui | 80 ++++++++++++++++++-- 5 files changed, 94 insertions(+), 9 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index fce542250f..eb89afdbc1 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,12 @@ +2001-08-31 John Levon + + * QTabularCreateDialog.C: fix warnings + + * emptytable.h: + * emptytable.C: + * ui/QTabularCreateDialog.ui: fix layout + when table size is changed + 2001-08-31 John Levon * Dialogs.C: diff --git a/src/frontends/qt2/QTabularCreateDialog.C b/src/frontends/qt2/QTabularCreateDialog.C index 46e7b573b7..7222f3235d 100644 --- a/src/frontends/qt2/QTabularCreateDialog.C +++ b/src/frontends/qt2/QTabularCreateDialog.C @@ -34,13 +34,13 @@ QTabularCreateDialog::QTabularCreateDialog(QTabularCreate * form) } -void QTabularCreateDialog::columnsChanged(int nr_cols) +void QTabularCreateDialog::columnsChanged(int) { form_->changed(); } -void QTabularCreateDialog::rowsChanged(int nr_rows) +void QTabularCreateDialog::rowsChanged(int) { form_->changed(); } diff --git a/src/frontends/qt2/emptytable.C b/src/frontends/qt2/emptytable.C index 466c408753..9f2359d5f8 100644 --- a/src/frontends/qt2/emptytable.C +++ b/src/frontends/qt2/emptytable.C @@ -24,6 +24,12 @@ EmptyTable::EmptyTable(QWidget * parent, const char * name) setTableFlags(Tbl_autoScrollBars); } +QSize EmptyTable::sizeHint() const +{ + return QSize(cellsize * numCols(), cellsize * numRows()); +} + + void EmptyTable::paintCell(QPainter *p, int row, int col) { int const x2 = cellWidth(col) - 1; @@ -42,6 +48,7 @@ void EmptyTable::setNumberColumns(int nr_cols) return; setAutoUpdate(false); setNumCols(nr_cols); + updateGeometry(); setAutoUpdate(true); update(); emit colsChanged(nr_cols); @@ -55,6 +62,7 @@ void EmptyTable::setNumberRows(int nr_rows) return; setAutoUpdate(false); setNumRows(nr_rows); + updateGeometry(); setAutoUpdate(true); update(); emit rowsChanged(nr_rows); diff --git a/src/frontends/qt2/emptytable.h b/src/frontends/qt2/emptytable.h index 953adfc7cd..bd66cf9106 100644 --- a/src/frontends/qt2/emptytable.h +++ b/src/frontends/qt2/emptytable.h @@ -23,6 +23,8 @@ public: ~EmptyTable() {}; + virtual QSize sizeHint() const; + public slots: /// set the number of columns in the table and emit colsChanged() signal void setNumberColumns(int nr_cols); diff --git a/src/frontends/qt2/ui/QTabularCreateDialog.ui b/src/frontends/qt2/ui/QTabularCreateDialog.ui index 35c850cf64..79da1999ea 100644 --- a/src/frontends/qt2/ui/QTabularCreateDialog.ui +++ b/src/frontends/qt2/ui/QTabularCreateDialog.ui @@ -13,7 +13,7 @@ 0 0 - 281 + 265 311 @@ -157,15 +157,81 @@ - EmptyTable + QLayoutWidget name - table - - - toolTip - Resize this to the correct table dimensions + Layout3 + + + margin + 0 + + + spacing + 6 + + + + name + Spacer1_2 + + + orientation + Horizontal + + + sizeType + MinimumExpanding + + + sizeHint + + 20 + 20 + + + + + + name + Spacer2_2 + + + orientation + Vertical + + + sizeType + MinimumExpanding + + + sizeHint + + 20 + 20 + + + + + EmptyTable + + name + table + + + sizePolicy + + 5 + 5 + + + + toolTip + Resize this to the correct table dimensions + + + QLayoutWidget -- 2.39.2