From 6be393a4f153ae73824f838fb486c0cc446b2555 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Fri, 1 May 2015 18:11:57 +0200 Subject: [PATCH] Use EmptyTable widget in TabularCreate dialog. Fixes #3155. --- src/frontends/qt4/GuiTabularCreate.cpp | 10 + src/frontends/qt4/ui/TabularCreateUi.ui | 241 +++++++++++++----------- 2 files changed, 136 insertions(+), 115 deletions(-) diff --git a/src/frontends/qt4/GuiTabularCreate.cpp b/src/frontends/qt4/GuiTabularCreate.cpp index 12641443a2..96bbe1a790 100644 --- a/src/frontends/qt4/GuiTabularCreate.cpp +++ b/src/frontends/qt4/GuiTabularCreate.cpp @@ -32,6 +32,16 @@ GuiTabularCreate::GuiTabularCreate(GuiView & lv) rowsSB->setValue(5); columnsSB->setValue(5); + table->setMinimumSize(100, 100); + + connect(table, SIGNAL(rowsChanged(int)), + rowsSB, SLOT(setValue(int))); + connect(table, SIGNAL(colsChanged(int)), + columnsSB, SLOT(setValue(int))); + connect(rowsSB, SIGNAL(valueChanged(int)), + table, SLOT(setNumberRows(int))); + connect(columnsSB, SIGNAL(valueChanged(int)), + table, SLOT(setNumberColumns(int))); connect(okPB, SIGNAL(clicked()), this, SLOT(slotOK())); connect(closePB, SIGNAL(clicked()), this, SLOT(slotClose())); diff --git a/src/frontends/qt4/ui/TabularCreateUi.ui b/src/frontends/qt4/ui/TabularCreateUi.ui index 49613d26dd..63c75e8416 100644 --- a/src/frontends/qt4/ui/TabularCreateUi.ui +++ b/src/frontends/qt4/ui/TabularCreateUi.ui @@ -1,57 +1,132 @@ - + + TabularCreateUi - - + + 0 0 - 198 - 125 + 349 + 298 - + - + true - - - 9 - - - 6 - - - - - Qt::Vertical + + + + + + + + + Number of rows + + + &Rows: + + + rowsSB + + + + + + + Number of rows + + + QAbstractSpinBox::PlusMinus + + + 1 + + + 511 + + + + + + + + + + + Number of columns + + + &Columns: + + + columnsSB + + + + + + + Number of columns + + + QAbstractSpinBox::PlusMinus + + + 1 + + + 511 + + + + + + + + + + + Qt::Horizontal - + - 20 - 40 + 69 + 20 - - - - 0 + + + + + 0 + 0 + - - 6 + + Resize this to the correct table dimensions - + + + + + + 0 + + - + Qt::Horizontal - + QSizePolicy::Expanding - + 20 20 @@ -59,108 +134,44 @@ - - - + + + &OK - - - + + + Close - - - - Number of rows - - - &Rows: - - - rowsSB - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 58 - 22 - - - - - - - - Number of columns - - - &Columns: - - - columnsSB - - - - - - - Number of rows - - - QAbstractSpinBox::PlusMinus - - - 511 - - - 1 - - - - - - - Number of columns - - - QAbstractSpinBox::PlusMinus - - - 511 - - - 1 - - - + layoutWidget + layoutWidget + table + horizontalSpacer - - - qt_i18n.h - + + + EmptyTable + QWidget +
EmptyTable.h
+
+
rowsSB columnsSB okPB closePB + + qt_i18n.h +
-- 2.39.2