From 74b8008837ab3f3d32a3f1bc17f696cd2c019a51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Peter=20K=C3=BCmmel?= Date: Sat, 30 Dec 2006 10:30:02 +0000 Subject: [PATCH] undo last acedential checkin git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16436 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/Action.C | 6 +- src/frontends/qt4/BulletsModule.C | 11 +- src/frontends/qt4/FileDialog.C | 2 +- src/frontends/qt4/FileDialog_private.C | 6 +- src/frontends/qt4/GuiView.C | 21 +- src/frontends/qt4/GuiWorkArea.C | 4 +- src/frontends/qt4/QCommandBuffer.C | 2 +- src/frontends/qt4/QDocumentDialog.C | 333 ++++++--------------- src/frontends/qt4/QSearchDialog.C | 28 +- src/frontends/qt4/QTabularDialog.C | 135 +++------ src/frontends/qt4/QTocDialog.C | 16 +- src/frontends/qt4/QURLDialog.C | 19 +- src/frontends/qt4/QVSpaceDialog.C | 29 +- src/frontends/qt4/QViewSourceDialog.C | 15 +- src/frontends/qt4/QWrapDialog.C | 27 +- src/frontends/qt4/qt_connection_check.h | 378 ------------------------ src/frontends/qt4/qt_helpers.h | 2 - src/frontends/qt4/socket_callback.C | 5 +- 18 files changed, 217 insertions(+), 822 deletions(-) delete mode 100755 src/frontends/qt4/qt_connection_check.h diff --git a/src/frontends/qt4/Action.C b/src/frontends/qt4/Action.C index 45b8c82356..504012308e 100644 --- a/src/frontends/qt4/Action.C +++ b/src/frontends/qt4/Action.C @@ -47,8 +47,7 @@ Action::Action(LyXView & lyxView, docstring const & text, setText(toqstr(text)); setToolTip(toqstr(tooltip)); setStatusTip(toqstr(tooltip)); - Q_CONNECT_1(QAction, this, triggered, bool, - Action, this, action, void); + connect(this, SIGNAL(triggered()), this, SLOT(action())); update(); } @@ -60,8 +59,7 @@ Action::Action(LyXView & lyxView, string const & icon, docstring const & text, setText(toqstr(text)); setToolTip(toqstr(tooltip)); setStatusTip(toqstr(tooltip)); - Q_CONNECT_1(QAction, this, triggered, bool, - Action, this, action, void); + connect(this, SIGNAL(triggered()), this, SLOT(action())); update(); } diff --git a/src/frontends/qt4/BulletsModule.C b/src/frontends/qt4/BulletsModule.C index bd726a7b97..e0847448c0 100644 --- a/src/frontends/qt4/BulletsModule.C +++ b/src/frontends/qt4/BulletsModule.C @@ -50,11 +50,8 @@ BulletsModule::BulletsModule(QWidget * , char const * , Qt::WFlags) setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 3"), "psnfss3"); setupPanel(new QListWidget(bulletpaneSW), qt_("Dings 4"), "psnfss4"); - Q_CONNECT_1(QListWidget, levelLW, currentRowChanged, int, - BulletsModule, this, showLevel,int); - - Q_CONNECT_1(QComboBox, bulletpaneCO, activated, int, - QStackedWidget, bulletpaneSW, setCurrentIndex, int); + connect(levelLW, SIGNAL(currentRowChanged(int)), this, SLOT(showLevel(int))); + connect(bulletpaneCO, SIGNAL(activated(int)), bulletpaneSW, SLOT(setCurrentIndex(int))); } @@ -65,8 +62,8 @@ BulletsModule::~BulletsModule() void BulletsModule::setupPanel(QListWidget * lw, QString panelname, std::string fname) { - Q_CONNECT_2(QListWidget, lw, currentItemChanged, QListWidgetItem*, QListWidgetItem*, - BulletsModule, this, bulletSelected, QListWidgetItem*, QListWidgetItem*); + connect(lw, SIGNAL(currentItemChanged(QListWidgetItem*, QListWidgetItem*)), + this, SLOT(bulletSelected(QListWidgetItem *, QListWidgetItem*))); // add panelname to combox bulletpaneCO->addItem(panelname); diff --git a/src/frontends/qt4/FileDialog.C b/src/frontends/qt4/FileDialog.C index 82667edff2..106a517c10 100644 --- a/src/frontends/qt4/FileDialog.C +++ b/src/frontends/qt4/FileDialog.C @@ -31,7 +31,7 @@ * * Therefore there is a tradeoff in enabling or disabling this (JMarc) */ -#if defined(Q_WS_MACX) //|| defined(Q_WS_WIN) +#ifdef Q_WS_MACX #define USE_NATIVE_FILEDIALOG 1 #endif diff --git a/src/frontends/qt4/FileDialog_private.C b/src/frontends/qt4/FileDialog_private.C index 27b51a2e09..2dcb1bf46c 100644 --- a/src/frontends/qt4/FileDialog_private.C +++ b/src/frontends/qt4/FileDialog_private.C @@ -66,8 +66,7 @@ LyXFileDialog::LyXFileDialog(docstring const & t, if (!b1.first.empty()) { b1_dir_ = b1.second; b1_ = new QToolButton(this); - Q_CONNECT_1(QToolButton, b1_, clicked, bool, - LyXFileDialog, this, buttonClicked, void); + connect(b1_, SIGNAL(clicked()), this, SLOT(buttonClicked())); b1_->setText(toqstr(getLabel(b1.first))); layout.at(0)->addWidget(b1_); } @@ -75,8 +74,7 @@ LyXFileDialog::LyXFileDialog(docstring const & t, if (!b2.first.empty()) { b2_dir_ = b2.second; b2_ = new QToolButton(this); - Q_CONNECT_1(QToolButton, b2_, clicked, bool, - LyXFileDialog, this, buttonClicked, void); + connect(b2_, SIGNAL(clicked()), this, SLOT(buttonClicked())); b2_->setText(toqstr(getLabel(b2.first))); layout.at(0)->addWidget(b2_); } diff --git a/src/frontends/qt4/GuiView.C b/src/frontends/qt4/GuiView.C index 867187457b..159388d462 100644 --- a/src/frontends/qt4/GuiView.C +++ b/src/frontends/qt4/GuiView.C @@ -125,23 +125,20 @@ struct GuiView::GuiViewPrivate QAction *smallIcons = new QAction(iconSizeGroup); smallIcons->setText("Small sized icons"); smallIcons->setCheckable(true); - Q_CONNECT_1(QAction, smallIcons, triggered, bool, - GuiView, parent, smallSizedIcons, void); + QObject::connect(smallIcons, SIGNAL(triggered()), parent, SLOT(smallSizedIcons())); menu->addAction(smallIcons); QAction *normalIcons = new QAction(iconSizeGroup); normalIcons->setText("Normal sized icons"); normalIcons->setCheckable(true); - Q_CONNECT_1(QAction, normalIcons, triggered, bool, - GuiView, parent, normalSizedIcons, void); + QObject::connect(normalIcons, SIGNAL(triggered()), parent, SLOT(normalSizedIcons())); menu->addAction(normalIcons); QAction *bigIcons = new QAction(iconSizeGroup); bigIcons->setText("Big sized icons"); bigIcons->setCheckable(true); - Q_CONNECT_1(QAction, bigIcons, triggered, bool, - GuiView, parent, bigSizedIcons, void); + QObject::connect(bigIcons, SIGNAL(triggered()), parent, SLOT(bigSizedIcons())); menu->addAction(bigIcons); unsigned int cur = parent->iconSize().width(); @@ -213,15 +210,15 @@ QMenu* GuiView::createPopupMenu() void GuiView::init() { menubar_.reset(new QLMenubar(this, menubackend)); - Q_CONNECT_1(QMenuBar, menuBar(), triggered, QAction*, - GuiView, this, updateMenu, QAction*); + QObject::connect(menuBar(), SIGNAL(triggered(QAction *)), + this, SLOT(updateMenu(QAction *))); getToolbars().init(); statusBar()->setSizeGripEnabled(false); - Q_CONNECT_1(QTimer, &statusbar_timer_, timeout, void, - GuiView, this, update_view_state_qt, void); + QObject::connect(&statusbar_timer_, SIGNAL(timeout()), + this, SLOT(update_view_state_qt())); if (!work_area_->bufferView().buffer() && !theBufferList().empty()) setBuffer(theBufferList().first()); @@ -462,8 +459,8 @@ void GuiView::initTab(QWidget* workarea) { d.wt = new WidgetWithTabBar(workarea); setCentralWidget(d.wt); - Q_CONNECT_1(QTabBar, d.wt->tabbar, currentChanged, int, - GuiView, this, currentTabChanged, int); + QObject::connect(d.wt->tabbar, SIGNAL(currentChanged(int)), + this, SLOT(currentTabChanged(int))); } diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index d61fcb3416..4683c6e0fd 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -186,8 +186,8 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view) this)); // Initialize the vertical Scroll Bar - Q_CONNECT_1(QScrollBar, verticalScrollBar(), actionTriggered, int, - GuiWorkArea, this, adjustViewWithScrollBar, int); + QObject::connect(verticalScrollBar(), SIGNAL(actionTriggered(int)), + this, SLOT(adjustViewWithScrollBar(int))); // PageStep only depends on the viewport height. verticalScrollBar()->setPageStep(viewport()->height()); diff --git a/src/frontends/qt4/QCommandBuffer.C b/src/frontends/qt4/QCommandBuffer.C index e6aa214dfd..dde8512bd4 100644 --- a/src/frontends/qt4/QCommandBuffer.C +++ b/src/frontends/qt4/QCommandBuffer.C @@ -58,7 +58,7 @@ protected: hide(); } else { // emit signal - //itemPressed(currentItem()); + itemPressed(currentItem()); } } diff --git a/src/frontends/qt4/QDocumentDialog.C b/src/frontends/qt4/QDocumentDialog.C index c5e1543404..5c7b913b39 100644 --- a/src/frontends/qt4/QDocumentDialog.C +++ b/src/frontends/qt4/QDocumentDialog.C @@ -63,20 +63,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form) { setupUi(this); - Q_CONNECT_1(QPushButton, okPB, clicked, bool, - QDocument, form, slotOK, void); - Q_CONNECT_1(QPushButton, applyPB, clicked, bool, - QDocument, form, slotApply, void); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QDocument, form, slotClose, void); - Q_CONNECT_1(QPushButton, restorePB, clicked, bool, - QDocument, form, slotRestore, void); + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); - Q_CONNECT_1(QPushButton, savePB, clicked, bool, - QDocumentDialog, this, saveDefaultClicked, void); - Q_CONNECT_1(QPushButton, defaultPB, clicked, bool, - QDocumentDialog, this, useDefaultsClicked, void); + connect(savePB, SIGNAL( clicked() ), + this, SLOT( saveDefaultClicked() ) ); + connect(defaultPB, SIGNAL( clicked() ), + this, SLOT( useDefaultsClicked() ) ); // Manage the restore, ok, apply, restore and cancel/close buttons form_->bcview().setOK(okPB); @@ -87,29 +87,17 @@ QDocumentDialog::QDocumentDialog(QDocument * form) textLayoutModule = new UiWidget; // text layout - Q_CONNECT_1(QComboBox, textLayoutModule->lspacingCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, textLayoutModule->lspacingCO, activated, int, - QDocumentDialog, this, setLSpacing, int); - Q_CONNECT_1(QLineEdit, textLayoutModule->lspacingLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QRadioButton, textLayoutModule->skipRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QRadioButton, textLayoutModule->indentRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, textLayoutModule->skipCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QLineEdit, textLayoutModule->skipLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, textLayoutModule->skipLengthCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, textLayoutModule->skipCO, activated, int, - QDocumentDialog, this, setSkip, int); - Q_CONNECT_1(QRadioButton, textLayoutModule->skipRB, toggled, bool, - QDocumentDialog, this, enableSkip, bool); - Q_CONNECT_1(QCheckBox, textLayoutModule->twoColumnCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - + connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(textLayoutModule->lspacingCO, SIGNAL(activated(int)), this, SLOT(setLSpacing(int))); + connect(textLayoutModule->lspacingLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(textLayoutModule->indentRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(textLayoutModule->skipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(textLayoutModule->skipLengthCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(textLayoutModule->skipCO, SIGNAL(activated(int)), this, SLOT(setSkip(int))); + connect(textLayoutModule->skipRB, SIGNAL(toggled(bool)), this, SLOT(enableSkip(bool))); + connect(textLayoutModule->twoColumnCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); textLayoutModule->lspacingLE->setValidator(new QDoubleValidator( textLayoutModule->lspacingLE)); textLayoutModule->skipLE->setValidator(unsignedLengthValidator( @@ -138,42 +126,18 @@ QDocumentDialog::QDocumentDialog(QDocument * form) fontModule = new UiWidget; // fonts - - Q_CONNECT_1(QComboBox, fontModule->fontsRomanCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, fontModule->fontsRomanCO, activated, int, - QDocumentDialog, this, romanChanged, int); - - Q_CONNECT_1(QComboBox, fontModule->fontsSansCO, activated, int, - QDocumentDialog, this, change_adaptor, void) - - Q_CONNECT_1(QComboBox, fontModule->fontsSansCO, activated, int, - QDocumentDialog, this, sansChanged, int); - - Q_CONNECT_1(QComboBox, fontModule->fontsTypewriterCO, activated,int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, fontModule->fontsTypewriterCO, activated, int, - QDocumentDialog, this, ttChanged, int); - - Q_CONNECT_1(QComboBox, fontModule->fontsDefaultCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, fontModule->fontsizeCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QSpinBox, fontModule->scaleSansSB, valueChanged, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QSpinBox, fontModule->scaleTypewriterSB, valueChanged, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, fontModule->fontScCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, fontModule->fontOsfCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); + connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(fontModule->fontsRomanCO, SIGNAL(activated(int)), this, SLOT(romanChanged(int))); + connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(fontModule->fontsSansCO, SIGNAL(activated(int)), this, SLOT(sansChanged(int))); + connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(fontModule->fontsTypewriterCO, SIGNAL(activated(int)), this, SLOT(ttChanged(int))); + connect(fontModule->fontsDefaultCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(fontModule->fontsizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(fontModule->scaleSansSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(fontModule->scaleTypewriterSB, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(fontModule->fontScCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(fontModule->fontOsfCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); for (int n = 0; tex_fonts_roman[n][0]; ++n) { QString font = toqstr(tex_fonts_roman_gui[n]); @@ -208,42 +172,18 @@ QDocumentDialog::QDocumentDialog(QDocument * form) pageLayoutModule = new UiWidget; // page layout - Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int, - QDocumentDialog, this, setCustomPapersize, int); - - Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int, - QDocumentDialog, this, setCustomPapersize, int); - - Q_CONNECT_1(QRadioButton, pageLayoutModule->portraitRB, toggled, bool, - QDocumentDialog, this, portraitChanged, void); - - Q_CONNECT_1(QComboBox, pageLayoutModule->papersizeCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, pageLayoutModule->paperheightLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, pageLayoutModule->paperwidthLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, pageLayoutModule->paperwidthUnitCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, pageLayoutModule->paperheightUnitCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QRadioButton, pageLayoutModule->portraitRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QRadioButton, pageLayoutModule->landscapeRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, pageLayoutModule->facingPagesCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, pageLayoutModule->pagestyleCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - + connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int))); + connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(setCustomPapersize(int))); + connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), this, SLOT(portraitChanged())); + connect(pageLayoutModule->papersizeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->paperheightLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->paperwidthLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->paperwidthUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->paperheightUnitCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->portraitRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->landscapeRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->facingPagesCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(pageLayoutModule->pagestyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); pageLayoutModule->pagestyleCO->addItem(qt_("default")); pageLayoutModule->pagestyleCO->addItem(qt_("empty")); pageLayoutModule->pagestyleCO->addItem(qt_("plain")); @@ -280,55 +220,22 @@ QDocumentDialog::QDocumentDialog(QDocument * form) marginsModule = new UiWidget; // margins - - Q_CONNECT_1(QCheckBox, marginsModule->marginCB, toggled, bool, - QDocumentDialog, this, setCustomMargins, bool); - - Q_CONNECT_1(QCheckBox, marginsModule->marginCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->topLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->topUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->bottomLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->bottomUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->innerLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->innerUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->outerLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->outerUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->headheightLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->headheightUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->headsepLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->headsepUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, marginsModule->footskipLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(LengthCombo, marginsModule->footskipUnit, activated, int, - QDocumentDialog, this, change_adaptor, void); - + connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(setCustomMargins(bool))); + connect(marginsModule->marginCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(marginsModule->topLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->topUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->bottomLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->bottomUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->innerLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->innerUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->outerLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->outerUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->headheightLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->headheightUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->headsepLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->headsepUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(marginsModule->footskipLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(marginsModule->footskipUnit, SIGNAL(activated(int)), this, SLOT(change_adaptor())); marginsModule->topLE->setValidator(unsignedLengthValidator( marginsModule->topLE)); marginsModule->bottomLE->setValidator(unsignedLengthValidator( @@ -364,24 +271,13 @@ QDocumentDialog::QDocumentDialog(QDocument * form) langModule = new UiWidget; - Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool, - QLabel, langModule->encodingL, setDisabled, bool); - - Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool, - QComboBox, langModule->encodingCO, setDisabled, bool); - + connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), langModule->encodingL, SLOT(setDisabled(bool))); + connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), langModule->encodingCO, SLOT(setDisabled(bool))); // language & quote - Q_CONNECT_1(QComboBox, langModule->languageCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, langModule->defaultencodingCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, langModule->encodingCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, langModule->quoteStyleCO, activated, int, - QDocumentDialog, this, change_adaptor, void); + connect(langModule->languageCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(langModule->defaultencodingCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(langModule->encodingCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(langModule->quoteStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); // language & quotes vector const langs = getLanguageData(false); vector::const_iterator lit = langs.begin(); @@ -410,18 +306,10 @@ QDocumentDialog::QDocumentDialog(QDocument * form) numberingModule = new UiWidget; // numbering - Q_CONNECT_1(QSlider, numberingModule->depthSL, valueChanged, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QSlider, numberingModule->tocSL, valueChanged, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QSlider, numberingModule->depthSL, valueChanged, int, - QDocumentDialog, this, updateNumbering, void); - - Q_CONNECT_1(QSlider, numberingModule->tocSL, valueChanged, int, - QDocumentDialog, this, updateNumbering, void); - + connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(change_adaptor())); + connect(numberingModule->depthSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering())); + connect(numberingModule->tocSL, SIGNAL(valueChanged(int)), this, SLOT(updateNumbering())); numberingModule->tocTW->setColumnCount(3); numberingModule->tocTW->headerItem()->setText(0, qt_("Example")); numberingModule->tocTW->headerItem()->setText(1, qt_("Numbered")); @@ -429,26 +317,14 @@ QDocumentDialog::QDocumentDialog(QDocument * form) biblioModule = new UiWidget; - Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool, - QLabel, biblioModule->citationStyleL, setEnabled, bool); - - Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool, - QComboBox, biblioModule->citeStyleCO, setEnabled, bool); + connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citationStyleL, SLOT( setEnabled(bool) ) ); + connect( biblioModule->citeNatbibRB, SIGNAL( toggled(bool) ), biblioModule->citeStyleCO, SLOT( setEnabled(bool) ) ); // biblio - Q_CONNECT_1(QRadioButton, biblioModule->citeDefaultRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QRadioButton, biblioModule->citeNatbibRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, biblioModule->citeStyleCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QRadioButton, biblioModule->citeJurabibRB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, biblioModule->bibtopicCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); + connect(biblioModule->citeDefaultRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(biblioModule->citeNatbibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(biblioModule->citeStyleCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(biblioModule->citeJurabibRB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(biblioModule->bibtopicCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); // biblio biblioModule->citeStyleCO->addItem(qt_("Author-year")); biblioModule->citeStyleCO->addItem(qt_("Numerical")); @@ -457,37 +333,20 @@ QDocumentDialog::QDocumentDialog(QDocument * form) mathsModule = new UiWidget; - Q_CONNECT_1(QCheckBox, mathsModule->amsautoCB, toggled, bool, - QCheckBox, mathsModule->amsCB, setDisabled, bool); - - Q_CONNECT_1(QCheckBox, mathsModule->esintautoCB, toggled, bool, - QCheckBox, mathsModule->esintCB, setDisabled, bool); + connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), mathsModule->amsCB, SLOT(setDisabled(bool))); + connect(mathsModule->esintautoCB, SIGNAL(toggled(bool)), mathsModule->esintCB, SLOT(setDisabled(bool))); // maths - Q_CONNECT_1(QCheckBox, mathsModule->amsCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, mathsModule->amsautoCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, mathsModule->esintCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QCheckBox, mathsModule->esintautoCB, toggled, bool, - QDocumentDialog, this, change_adaptor, void); + connect(mathsModule->amsCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(mathsModule->amsautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(mathsModule->esintCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); + connect(mathsModule->esintautoCB, SIGNAL(toggled(bool)), this, SLOT(change_adaptor())); latexModule = new UiWidget; // latex class - Q_CONNECT_1(QComboBox, latexModule->classCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QLineEdit, latexModule->optionsLE, textChanged, const QString&, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, latexModule->psdriverCO, activated, int, - QDocumentDialog, this, change_adaptor, void); - - Q_CONNECT_1(QComboBox, latexModule->classCO, activated, int, - QDocumentDialog, this, classChanged, void); + connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(latexModule->optionsLE, SIGNAL(textChanged(const QString&)), this, SLOT(change_adaptor())); + connect(latexModule->psdriverCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); + connect(latexModule->classCO, SIGNAL(activated(int)), this, SLOT(classChanged())); // packages for (int n = 0; tex_graphics[n][0]; ++n) { QString enc = tex_graphics[n]; @@ -507,25 +366,21 @@ QDocumentDialog::QDocumentDialog(QDocument * form) // branches branchesModule = new QBranches; - Q_CONNECT_0(QBranches, branchesModule, changed, - QDocumentDialog, this, change_adaptor); + connect(branchesModule, SIGNAL(changed()), this, SLOT(change_adaptor())); // preamble preambleModule = new UiWidget; - Q_CONNECT_0(QTextEdit, preambleModule->preambleTE, textChanged, - QDocumentDialog, this, change_adaptor); + connect(preambleModule->preambleTE, SIGNAL(textChanged()), this, SLOT(change_adaptor())); // bullets bulletsModule = new BulletsModule; - Q_CONNECT_0(BulletsModule, bulletsModule, changed, - QDocumentDialog, this, change_adaptor); + connect(bulletsModule, SIGNAL(changed()), this, SLOT(change_adaptor())); // float floatModule = new FloatPlacement; - Q_CONNECT_0(FloatPlacement, floatModule, changed, - QDocumentDialog, this, change_adaptor); + connect(floatModule, SIGNAL(changed()), this, SLOT(change_adaptor())); docPS->addPanel(latexModule, _("Document Class")); docPS->addPanel(fontModule, _("Fonts")); diff --git a/src/frontends/qt4/QSearchDialog.C b/src/frontends/qt4/QSearchDialog.C index 4f3fc1cea8..b8f329a6ce 100644 --- a/src/frontends/qt4/QSearchDialog.C +++ b/src/frontends/qt4/QSearchDialog.C @@ -15,7 +15,6 @@ #include "qt_helpers.h" //Added by qt3to4: #include -#include #include "controllers/ControlSearch.h" @@ -41,32 +40,19 @@ void uniqueInsert(QComboBox * box, QString const & text) }; + QSearchDialog::QSearchDialog(QSearch * form) : form_(form) { setupUi(this); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QSearch, form_, slotClose, void); - - Q_CONNECT_1(QPushButton, findPB, clicked, bool, - QSearchDialog, this, findClicked, void) ; - - Q_CONNECT_1(QPushButton, replacePB, clicked, bool, - QSearchDialog, this, replaceClicked, void); - - Q_CONNECT_1(QPushButton, replaceallPB, clicked, bool, - QSearchDialog, this, replaceallClicked, void); - - Q_CONNECT_1(QComboBox, findCO, editTextChanged, const QString&, - QSearchDialog, this, findChanged, void); - - - - //check(findCO); -// check(findCO, &QComboBox::editTextChanged); + connect(closePB, SIGNAL(clicked()), + form_, SLOT(slotClose())); - //check(this); + connect( findPB, SIGNAL( clicked() ), this, SLOT( findClicked() ) ); + connect( replacePB, SIGNAL( clicked() ), this, SLOT( replaceClicked() ) ); + connect( replaceallPB, SIGNAL( clicked() ), this, SLOT( replaceallClicked() ) ); + connect( findCO, SIGNAL( editTextChanged(const QString&) ), this, SLOT( findChanged() ) ); } diff --git a/src/frontends/qt4/QTabularDialog.C b/src/frontends/qt4/QTabularDialog.C index cc6b367836..47837b0396 100644 --- a/src/frontends/qt4/QTabularDialog.C +++ b/src/frontends/qt4/QTabularDialog.C @@ -42,92 +42,55 @@ QTabularDialog::QTabularDialog(QTabular * form) bottomspaceED->setValidator(new LengthValidator(bottomspaceED)); interlinespaceED->setValidator(new LengthValidator(interlinespaceED)); - Q_CONNECT_0(QLineEdit, topspaceED, returnPressed, - QTabularDialog, this, topspace_changed); - Q_CONNECT_1(LengthCombo, topspaceUnit, selectionChanged, lyx::LyXLength::UNIT, - QTabularDialog, this, topspace_changed, void); - Q_CONNECT_1(QComboBox, topspaceCO, activated, int, - QTabularDialog, this, topspace_changed, void); - Q_CONNECT_0(QLineEdit, bottomspaceED, returnPressed, - QTabularDialog, this, bottomspace_changed); - Q_CONNECT_1(LengthCombo, bottomspaceUnit, selectionChanged, lyx::LyXLength::UNIT, - QTabularDialog, this, bottomspace_changed, void); - Q_CONNECT_1(QComboBox, bottomspaceCO, activated, int, - QTabularDialog, this, bottomspace_changed, void); - Q_CONNECT_0(QLineEdit, interlinespaceED, returnPressed, - QTabularDialog, this, interlinespace_changed); - Q_CONNECT_1(LengthCombo, interlinespaceUnit, selectionChanged, lyx::LyXLength::UNIT, - QTabularDialog, this, interlinespace_changed, void); - Q_CONNECT_1(QComboBox, interlinespaceCO, activated, int, - QTabularDialog, this, interlinespace_changed, void); - Q_CONNECT_1(QRadioButton, booktabsRB, clicked, bool, - QTabularDialog, this, on_booktabsRB_toggled, void); - Q_CONNECT_1(QPushButton, borderSetPB, clicked, bool, - QTabularDialog, this, borderSet_clicked, void); - Q_CONNECT_1(QPushButton, borderUnsetPB, clicked, bool, - QTabularDialog, this, borderUnset_clicked, void); - Q_CONNECT_1(QCheckBox, longTabularCB, toggled, bool, - QGroupBox, longtableGB, setEnabled, bool); - Q_CONNECT_1(QCheckBox, longTabularCB, toggled, bool, - QCheckBox, newpageCB, setEnabled, bool); - Q_CONNECT_1(QComboBox, hAlignCB, activated, int, - QTabularDialog, this, hAlign_changed, int); - Q_CONNECT_1(QComboBox, vAlignCB, activated, int, - QTabularDialog, this, vAlign_changed, int); - Q_CONNECT_1(QCheckBox, multicolumnCB, clicked, bool, - QTabularDialog, this, multicolumn_clicked, void); - Q_CONNECT_1(QCheckBox, newpageCB, clicked, bool, - QTabularDialog, this, ltNewpage_clicked, void); - Q_CONNECT_1(QCheckBox, headerStatusCB, clicked, bool, - QTabularDialog, this, ltHeaderStatus_clicked, void); - Q_CONNECT_1(QCheckBox, headerBorderAboveCB, clicked, bool, - QTabularDialog, this, ltHeaderBorderAbove_clicked, void); - Q_CONNECT_1(QCheckBox, headerBorderBelowCB, clicked, bool, - QTabularDialog, this, ltHeaderBorderBelow_clicked, void); - Q_CONNECT_1(QCheckBox, firstheaderStatusCB, clicked, bool, - QTabularDialog, this, ltFirstHeaderStatus_clicked, void); - Q_CONNECT_1(QCheckBox, firstheaderBorderAboveCB, clicked, bool, - QTabularDialog, this, ltFirstHeaderBorderAbove_clicked, void); - Q_CONNECT_1(QCheckBox, firstheaderBorderBelowCB, clicked, bool, - QTabularDialog, this, ltFirstHeaderBorderBelow_clicked, void); - Q_CONNECT_1(QCheckBox, firstheaderNoContentsCB, clicked, bool, - QTabularDialog, this, ltFirstHeaderEmpty_clicked, void); - Q_CONNECT_1(QCheckBox, footerStatusCB, clicked, bool, - QTabularDialog, this, ltFooterStatus_clicked, void); - Q_CONNECT_1(QCheckBox, footerBorderAboveCB, clicked, bool, - QTabularDialog, this, ltFooterBorderAbove_clicked, void); - Q_CONNECT_1(QCheckBox, footerBorderBelowCB, clicked, bool, - QTabularDialog, this, ltFooterBorderBelow_clicked, void); - Q_CONNECT_1(QCheckBox, lastfooterStatusCB, clicked, bool, - QTabularDialog, this, ltLastFooterStatus_clicked, void); - Q_CONNECT_1(QCheckBox, lastfooterBorderAboveCB, clicked, bool, - QTabularDialog, this, ltLastFooterBorderAbove_clicked, void); - Q_CONNECT_1(QCheckBox, lastfooterBorderBelowCB, clicked, bool, - QTabularDialog, this, ltLastFooterBorderBelow_clicked, void); - Q_CONNECT_1(QCheckBox, lastfooterNoContentsCB, clicked, bool, - QTabularDialog, this, ltLastFooterEmpty_clicked, void); - Q_CONNECT_0(QLineEdit, specialAlignmentED, returnPressed, - QTabularDialog, this, specialAlignment_changed); - Q_CONNECT_0(QLineEdit, widthED, returnPressed, - QTabularDialog, this, width_changed); - Q_CONNECT_1(LengthCombo, widthUnit, selectionChanged, lyx::LyXLength::UNIT, - QTabularDialog, this, width_changed, void); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QTabularDialog, this, close_clicked, void); - Q_CONNECT_1(QSetBorder, borders, topSet, bool, - QTabularDialog, this, topBorder_changed, void); - Q_CONNECT_1(QSetBorder, borders, bottomSet, bool, - QTabularDialog, this, bottomBorder_changed, void); - Q_CONNECT_1(QSetBorder, borders, rightSet, bool, - QTabularDialog, this, rightBorder_changed, void); - Q_CONNECT_1(QSetBorder, borders, leftSet, bool, - QTabularDialog, this, leftBorder_changed, void); - Q_CONNECT_1(QCheckBox, rotateTabularCB, clicked, bool, - QTabularDialog, this, rotateTabular, void); - Q_CONNECT_1(QCheckBox, rotateCellCB, clicked, bool, - QTabularDialog, this, rotateCell, void); - Q_CONNECT_1(QCheckBox, longTabularCB, clicked, bool, - QTabularDialog, this, longTabular, void); + connect(topspaceED, SIGNAL(returnPressed()), + this, SLOT(topspace_changed())); + connect(topspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), + this, SLOT(topspace_changed())); + connect(topspaceCO, SIGNAL(activated(int)), this, SLOT(topspace_changed())); + connect(bottomspaceED, SIGNAL(returnPressed()), + this, SLOT(bottomspace_changed())); + connect(bottomspaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), + this, SLOT(bottomspace_changed())); + connect(bottomspaceCO, SIGNAL(activated(int)), this, SLOT(bottomspace_changed())); + connect(interlinespaceED, SIGNAL(returnPressed()), + this, SLOT(interlinespace_changed())); + connect(interlinespaceUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), + this, SLOT(interlinespace_changed())); + connect(interlinespaceCO, SIGNAL(activated(int)), this, SLOT(interlinespace_changed())); + connect(booktabsRB, SIGNAL(clicked()), this, SLOT(on_booktabsRB_toggled())); + connect(borderSetPB, SIGNAL(clicked()), this, SLOT(borderSet_clicked())); + connect(borderUnsetPB, SIGNAL(clicked()), this, SLOT(borderUnset_clicked())); + connect(longTabularCB, SIGNAL(toggled(bool)), longtableGB, SLOT(setEnabled(bool))); + connect(longTabularCB, SIGNAL(toggled(bool)), newpageCB, SLOT(setEnabled(bool))); + connect(hAlignCB, SIGNAL(activated(int)), this, SLOT(hAlign_changed(int))); + connect(vAlignCB, SIGNAL(activated(int)), this, SLOT(vAlign_changed(int))); + connect(multicolumnCB, SIGNAL(clicked()), this, SLOT(multicolumn_clicked())); + connect(newpageCB, SIGNAL(clicked()), this, SLOT(ltNewpage_clicked())); + connect(headerStatusCB, SIGNAL(clicked()), this, SLOT(ltHeaderStatus_clicked())); + connect(headerBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltHeaderBorderAbove_clicked())); + connect(headerBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltHeaderBorderBelow_clicked())); + connect(firstheaderStatusCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderStatus_clicked())); + connect(firstheaderBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderBorderAbove_clicked())); + connect(firstheaderBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderBorderBelow_clicked())); + connect(firstheaderNoContentsCB, SIGNAL(clicked()), this, SLOT(ltFirstHeaderEmpty_clicked())); + connect(footerStatusCB, SIGNAL(clicked()), this, SLOT(ltFooterStatus_clicked())); + connect(footerBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltFooterBorderAbove_clicked())); + connect(footerBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltFooterBorderBelow_clicked())); + connect(lastfooterStatusCB, SIGNAL(clicked()), this, SLOT(ltLastFooterStatus_clicked())); + connect(lastfooterBorderAboveCB, SIGNAL(clicked()), this, SLOT(ltLastFooterBorderAbove_clicked())); + connect(lastfooterBorderBelowCB, SIGNAL(clicked()), this, SLOT(ltLastFooterBorderBelow_clicked())); + connect(lastfooterNoContentsCB, SIGNAL(clicked()), this, SLOT(ltLastFooterEmpty_clicked())); + connect(specialAlignmentED, SIGNAL(returnPressed()), this, SLOT(specialAlignment_changed())); + connect(widthED, SIGNAL(returnPressed()), this, SLOT(width_changed())); + connect(widthUnit, SIGNAL(selectionChanged(lyx::LyXLength::UNIT)), this, SLOT(width_changed())); + connect(closePB, SIGNAL(clicked()), this, SLOT(close_clicked())); + connect(borders, SIGNAL(topSet(bool)), this, SLOT(topBorder_changed())); + connect(borders, SIGNAL(bottomSet(bool)), this, SLOT(bottomBorder_changed())); + connect(borders, SIGNAL(rightSet(bool)), this, SLOT(rightBorder_changed())); + connect(borders, SIGNAL(leftSet(bool)), this, SLOT(leftBorder_changed())); + connect(rotateTabularCB, SIGNAL(clicked()), this, SLOT(rotateTabular())); + connect(rotateCellCB, SIGNAL(clicked()), this, SLOT(rotateCell())); + connect(longTabularCB, SIGNAL(clicked()), this, SLOT(longTabular())); } diff --git a/src/frontends/qt4/QTocDialog.C b/src/frontends/qt4/QTocDialog.C index 639cd21bcc..9264be428d 100644 --- a/src/frontends/qt4/QTocDialog.C +++ b/src/frontends/qt4/QTocDialog.C @@ -106,22 +106,16 @@ void QTocDialog::setTreeDepth(int depth) { if(depth!=-1) depth_ = depth; - - // expanding and then collapsing is probably better, - // but my qt 4.1.2 doesn't have expandAll().. - //tocTV->expandAll(); +// tocTV->expandAll(); //expanding and then collapsing is probably better, but my qt 4.1.2 doesn't have expandAll().. QModelIndexList indices = form_->tocModel()->match(form_->tocModel()->index(0,0), Qt::DisplayRole, "*", -1, Qt::MatchWildcard|Qt::MatchRecursive); - - int size = indices.size(); - for (int i = 0; i < size; i++) { - QModelIndex index = indices[i]; - if (getIndexDepth(index) < depth_) - tocTV->expand(index); + Q_FOREACH (QModelIndex index, indices) { // I had to use Q_FOREACH instead of foreach + if(getIndexDepth(index) < depth_) // because compile flag -DQT_NO_KEYWORDS doesn't allow me.. + tocTV->expand(index); else - tocTV->collapse(index); + tocTV->collapse(index); } } diff --git a/src/frontends/qt4/QURLDialog.C b/src/frontends/qt4/QURLDialog.C index 607b5a90a9..b2b952dd88 100644 --- a/src/frontends/qt4/QURLDialog.C +++ b/src/frontends/qt4/QURLDialog.C @@ -25,17 +25,14 @@ QURLDialog::QURLDialog(UrlView * form) { setupUi(this); - Q_CONNECT_1(QPushButton, okPB, clicked, bool, - UrlView, form_, slotOK, void); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - UrlView, form_, slotClose, void); - - Q_CONNECT_1(QLineEdit, urlED, textChanged, const QString&, - QURLDialog, this, changed_adaptor, void); - Q_CONNECT_1(QCheckBox, hyperlinkCB, clicked, bool, - QURLDialog, this, changed_adaptor, void); - Q_CONNECT_1(QLineEdit, nameED, textChanged, const QString&, - QURLDialog, this, changed_adaptor, void); + connect(okPB, SIGNAL(clicked()), + form_, SLOT(slotOK())); + connect(closePB, SIGNAL(clicked()), + form_, SLOT(slotClose())); + + connect( urlED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) ); + connect( hyperlinkCB, SIGNAL( clicked() ), this, SLOT( changed_adaptor() ) ); + connect( nameED, SIGNAL( textChanged(const QString&) ), this, SLOT( changed_adaptor() ) ); } diff --git a/src/frontends/qt4/QVSpaceDialog.C b/src/frontends/qt4/QVSpaceDialog.C index f7615de16a..77cd26dffa 100644 --- a/src/frontends/qt4/QVSpaceDialog.C +++ b/src/frontends/qt4/QVSpaceDialog.C @@ -35,23 +35,18 @@ QVSpaceDialog::QVSpaceDialog(QVSpace * form) { setupUi(this); - Q_CONNECT_1(QPushButton, okPB, clicked, bool, - QVSpace, form_, slotOK, void); - Q_CONNECT_1(QPushButton, applyPB, clicked, bool, - QVSpace, form_, slotApply, void); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QVSpace, form_, slotClose, void); - - Q_CONNECT_1(QComboBox, spacingCO, highlighted, const QString&, - QVSpaceDialog, this, change_adaptor, void); - Q_CONNECT_1(QLineEdit, valueLE, textChanged, const QString&, - QVSpaceDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, spacingCO, activated, int, - QVSpaceDialog, this, enableCustom, int); - Q_CONNECT_1(QCheckBox, keepCB, clicked, bool, - QVSpaceDialog, this, change_adaptor, void); - Q_CONNECT_1(LengthCombo, unitCO, selectionChanged, lyx::LyXLength::UNIT, - QVSpaceDialog, this, change_adaptor, void); + connect(okPB, SIGNAL(clicked()), + form_, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form_, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form_, SLOT(slotClose())); + + connect( spacingCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) ); + connect( valueLE, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) ); + connect( spacingCO, SIGNAL( activated(int) ), this, SLOT( enableCustom(int) ) ); + connect( keepCB, SIGNAL( clicked() ), this, SLOT( change_adaptor() ) ); + connect( unitCO, SIGNAL( selectionChanged(lyx::LyXLength::UNIT) ), this, SLOT( change_adaptor() ) ); valueLE->setValidator(unsignedLengthValidator(valueLE)); } diff --git a/src/frontends/qt4/QViewSourceDialog.C b/src/frontends/qt4/QViewSourceDialog.C index 06df3262b8..281c65725d 100644 --- a/src/frontends/qt4/QViewSourceDialog.C +++ b/src/frontends/qt4/QViewSourceDialog.C @@ -26,14 +26,13 @@ QViewSourceDialog::QViewSourceDialog(QViewSource * form) { setupUi(this); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QViewSource, form, slotClose, void); - Q_CONNECT_1(QCheckBox, viewFullSourceCB, toggled, bool, - QViewSourceDialog, this, slotUpdate, void); - Q_CONNECT_1(QCheckBox, autoUpdateCB, toggled, bool, - QPushButton, updatePB, setDisabled, bool); - Q_CONNECT_1(QPushButton, updatePB, clicked, bool, - QViewSourceDialog, this, slotUpdate, void); + connect(closePB, SIGNAL(clicked()), form, SLOT(slotClose())); + connect(viewFullSourceCB, SIGNAL(toggled(bool)), + this, SLOT(slotUpdate())); + connect(autoUpdateCB, SIGNAL(toggled(bool)), + updatePB, SLOT(setDisabled(bool))); + connect(updatePB, SIGNAL(clicked()), + this, SLOT(slotUpdate())); } diff --git a/src/frontends/qt4/QWrapDialog.C b/src/frontends/qt4/QWrapDialog.C index 6609daac91..eb40d2f563 100644 --- a/src/frontends/qt4/QWrapDialog.C +++ b/src/frontends/qt4/QWrapDialog.C @@ -26,21 +26,18 @@ QWrapDialog::QWrapDialog(QWrap * form) { setupUi(this); - Q_CONNECT_1(QPushButton, restorePB, clicked, bool, - QWrap, form, slotRestore, void); - Q_CONNECT_1(QPushButton, okPB, clicked, bool, - QWrap, form, slotOK, void); - Q_CONNECT_1(QPushButton, applyPB, clicked, bool, - QWrap, form, slotApply, void); - Q_CONNECT_1(QPushButton, closePB, clicked, bool, - QWrap, form, slotClose, void); - - Q_CONNECT_1(QLineEdit, widthED, textChanged, const QString&, - QWrapDialog, this, change_adaptor, void); - Q_CONNECT_1(LengthCombo, unitsLC, selectionChanged, LyXLength::UNIT, - QWrapDialog, this, change_adaptor, void); - Q_CONNECT_1(QComboBox, valignCO, highlighted, const QString&, - QWrapDialog, this, change_adaptor, void); + connect(restorePB, SIGNAL(clicked()), + form, SLOT(slotRestore())); + connect(okPB, SIGNAL(clicked()), + form, SLOT(slotOK())); + connect(applyPB, SIGNAL(clicked()), + form, SLOT(slotApply())); + connect(closePB, SIGNAL(clicked()), + form, SLOT(slotClose())); + + connect( widthED, SIGNAL( textChanged(const QString&) ), this, SLOT( change_adaptor() ) ); + connect( unitsLC, SIGNAL( selectionChanged(LyXLength::UNIT) ), this, SLOT( change_adaptor() ) ); + connect( valignCO, SIGNAL( highlighted(const QString&) ), this, SLOT( change_adaptor() ) ); } diff --git a/src/frontends/qt4/qt_connection_check.h b/src/frontends/qt4/qt_connection_check.h deleted file mode 100755 index 752dea6aba..0000000000 --- a/src/frontends/qt4/qt_connection_check.h +++ /dev/null @@ -1,378 +0,0 @@ -/** - * \file qt_connection_check.h - * - * \author Peter Kümmel - * - * Permission to use, copy, modify, distribute and sell this software for any - * purpose is hereby granted without fee, provided that the above copyright - * notice appear in all copies and that both that copyright notice and this - * permission notice appear in supporting documentation. - * The author makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - */ -#ifndef QT_CONNECTION_CHECK_H -#define QT_CONNECTION_CHECK_H - - -/* - -Usage: -src/corelib/kernel/qobjectdefs.h must be patched. -Add this at the end before the endif to the header: - -#ifdef signals -# ifdef QT_CONNECTION_SIGNATURE_CHECK -# undef signals -# define signals public -# endif -#endif - -#ifdef Q_SIGNALS -# ifdef QT_CONNECTION_SIGNATURE_CHECK -# undef Q_SIGNALS -# define Q_SIGNALS public -# endif -#endif -*/ - - - -template< class SIGNAL_ARG_1 = void, - class SIGNAL_ARG_2 = void, - class SIGNAL_ARG_3 = void, - class SIGNAL_ARG_4 = void> -struct Wrong_Signal_Signature -{ - template - static void signature(T*, void (T::* )(SIGNAL_ARG_1, - SIGNAL_ARG_2, - SIGNAL_ARG_3, - SIGNAL_ARG_4) ){} - - template - static void existance(T*) - { - typedef SIGNAL_ARG_1 T1; - typedef SIGNAL_ARG_2 T2; - typedef SIGNAL_ARG_3 T3; - typedef SIGNAL_ARG_4 T4; - } -}; - - -template< class SIGNAL_ARG_1, - class SIGNAL_ARG_2, - class SIGNAL_ARG_3> -struct Wrong_Signal_Signature< SIGNAL_ARG_1, - SIGNAL_ARG_2, - SIGNAL_ARG_3, - void> -{ - template - static void signature(T*, void (T::* )(SIGNAL_ARG_1, - SIGNAL_ARG_2, - SIGNAL_ARG_3) ){} - template - static void existance(T*) - { - typedef SIGNAL_ARG_1 T1; - typedef SIGNAL_ARG_2 T2; - typedef SIGNAL_ARG_3 T3; - } -}; - -template< class SIGNAL_ARG_1, - class SIGNAL_ARG_2> -struct Wrong_Signal_Signature< SIGNAL_ARG_1, - SIGNAL_ARG_2, - void, - void> -{ - template - static void signature(T*, void (T::* )(SIGNAL_ARG_1, - SIGNAL_ARG_2) ){} - template - static void existance(T*) - { - typedef SIGNAL_ARG_1 T1; - typedef SIGNAL_ARG_2 T2; - } -}; - - -template< class SIGNAL_ARG_1> -struct Wrong_Signal_Signature< SIGNAL_ARG_1, - void, - void, - void> -{ - template - static void signature(T*, void (T::* )(SIGNAL_ARG_1) ){} - - template - static void existance(T*) - { - typedef SIGNAL_ARG_1 T1; - } -}; - -template<> -struct Wrong_Signal_Signature -{ - template - static void signature(T*, void (T::* )()){} - - template - static void existance(T*) {} -}; - -template< class SLOT_ARG_1 = void, - class SLOT_ARG_2 = void, - class SLOT_ARG_3 = void, - class SLOT_ARG_4 = void> -struct Wrong__Slot__Signature -{ - template - static void signature(T*, void (T::* )(SLOT_ARG_1, - SLOT_ARG_2, - SLOT_ARG_3, - SLOT_ARG_4) ){} - template - static void existance(T*) - { - typedef SLOT_ARG_1 T1; - typedef SLOT_ARG_2 T2; - typedef SLOT_ARG_3 T3; - typedef SLOT_ARG_4 T4; - } -}; - - -template< class SLOT_ARG_1, - class SLOT_ARG_2, - class SLOT_ARG_3> -struct Wrong__Slot__Signature< SLOT_ARG_1, - SLOT_ARG_2, - SLOT_ARG_3, - void> -{ - template - static void signature(T*, void (T::* )(SLOT_ARG_1, - SLOT_ARG_2, - SLOT_ARG_3)){} - template - static void existance(T*) - { - typedef SLOT_ARG_1 T1; - typedef SLOT_ARG_2 T2; - typedef SLOT_ARG_3 T3; - } -}; - -template< class SLOT_ARG_1, - class SLOT_ARG_2> -struct Wrong__Slot__Signature< SLOT_ARG_1, - SLOT_ARG_2, - void, - void> -{ - template - static void signature(T*, void (T::* )(SLOT_ARG_1, - SLOT_ARG_2)){} - template - static void existance(T*) - { - typedef SLOT_ARG_1 T1; - typedef SLOT_ARG_2 T2; - } -}; - -template< class SLOT_ARG_1> -struct Wrong__Slot__Signature< SLOT_ARG_1, - void, - void, - void> -{ - template - static void signature(T*, void (T::* )(SLOT_ARG_1)){} - - template - static void existance(T*) - { - typedef SLOT_ARG_1 T1; - } -}; - -template<> -struct Wrong__Slot__Signature -{ - template - static void signature(T*, void (T::* )()){} - - template - static void existance(T*){} -}; - - -template -struct Signal_Slot_argument_mismatch -{ - // remove '&' from the type - templatestruct RefType {typedef T Result;}; - templatestruct RefType {typedef T Result;}; - templatestruct RefType{typedef T const Result;}; - - template - static void signal_slot_arguments_mismatch(SIGNAL_SLOT_ARGUMENT_MISMATCH*) {} - static void match() - { - RefType::Result *p(0); - signal_slot_arguments_mismatch::Result>(p); - } -}; - -template -struct Signal_Slot_argument_mismatch -{ - static void match() {} -}; - -template<> -struct Signal_Slot_argument_mismatch -{ - static void match() {} -}; - -template -struct Signal_Slot_argument_mismatch -{ - template - void to_much_slot_aruments(TOO_MUCH_SLOT_ARGUMENTS*) - {} - static void match() - { - TOO_MUCH_SLOT_ARGUMENTS *p(0); - to_much_slot_aruments(&p); - } -}; - - -#undef QT_CONNECTION_SIGNATURE_CHECK -#ifdef QT_CONNECTION_SIGNATURE_CHECK - -#define Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \ - SL_HOST, PTR_SL, SL_NAME) \ - Wrong_Signal_Signature::signature(PTR_SI,&SI_HOST::SI_NAME); \ - Wrong__Slot__Signature::signature(PTR_SL,&SL_HOST::SL_NAME); - -#define Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \ - Wrong_Signal_Signature::signature(PTR_SI,&SI_HOST::SI_NAME); \ - Wrong__Slot__Signature::signature(PTR_SL,&SL_HOST::SL_NAME); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \ - Wrong_Signal_Signature::signature(PTR_SI,&SI_HOST::SI_NAME); \ - Wrong__Slot__Signature::signature(PTR_SL,&SL_HOST::SL_NAME); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \ - Wrong_Signal_Signature::signature(PTR_SI,&SI_HOST::SI_NAME); \ - Wrong__Slot__Signature::signature(PTR_SL,&SL_HOST::SL_NAME); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \ - Wrong_Signal_Signature::signature(PTR_SI,&SI_HOST::SI_NAME); \ - Wrong__Slot__Signature::signature(PTR_SL,&SL_HOST::SL_NAME); - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#else - -#define Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \ - SL_HOST, PTR_SL, SL_NAME) \ - Wrong_Signal_Signature::existance(PTR_SI); \ - Wrong__Slot__Signature::existance(PTR_SL); - -#define Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \ - Wrong_Signal_Signature::existance(PTR_SI); \ - Wrong__Slot__Signature::existance(PTR_SL); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \ - Wrong_Signal_Signature::existance(PTR_SI); \ - Wrong__Slot__Signature::existance(PTR_SL); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \ - Wrong_Signal_Signature::existance(PTR_SI); \ - Wrong__Slot__Signature::existance(PTR_SL); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#define Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \ - Wrong_Signal_Signature::existance(PTR_SI); \ - Wrong__Slot__Signature::existance(PTR_SL); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); \ - Signal_Slot_argument_mismatch::match(); - -#endif - - -#define Q_CONNECT_0(SI_HOST, PTR_SI, SI_NAME, \ - SL_HOST, PTR_SL, SL_NAME) \ - Q_CONNECT_0_CHECK( SI_HOST, PTR_SI, SI_NAME, \ - SL_HOST, PTR_SL, SL_NAME); \ - QObject::connect( PTR_SI, SIGNAL(SI_NAME()), \ - PTR_SL, SLOT (SL_NAME())); - -#define Q_CONNECT_1(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1) \ - Q_CONNECT_1_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1); \ - QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1)), \ - PTR_SL, SLOT (SL_NAME(SL_ARG_1))); - -#define Q_CONNECT_2(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2) \ - Q_CONNECT_2_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2); \ - QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2)), \ - PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2))); - -#define Q_CONNECT_3(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3) \ - Q_CONNECT_3_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3); \ - QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2,SI_ARG_3)), \ - PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2,SL_ARG_3))); - -#define Q_CONNECT_4(SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4) \ - Q_CONNECT_4_CHECK( SI_HOST, PTR_SI, SI_NAME, SI_ARG_1, SI_ARG_2, SI_ARG_3, SI_ARG_4, \ - SL_HOST, PTR_SL, SL_NAME, SL_ARG_1, SL_ARG_2, SL_ARG_3, SL_ARG_4); \ - QObject::connect( PTR_SI, SIGNAL(SI_NAME(SI_ARG_1,SI_ARG_2,SI_ARG_3,SI_ARG_4)), \ - PTR_SL, SLOT (SL_NAME(SL_ARG_1,SL_ARG_2,SL_ARG_3,SL_ARG_4))); - - - - -#endif diff --git a/src/frontends/qt4/qt_helpers.h b/src/frontends/qt4/qt_helpers.h index 7c359c7ae7..5c52b1fdfa 100644 --- a/src/frontends/qt4/qt_helpers.h +++ b/src/frontends/qt4/qt_helpers.h @@ -20,8 +20,6 @@ #include -#include "qt_connection_check.h" - class QComboBox; class QLineEdit; diff --git a/src/frontends/qt4/socket_callback.C b/src/frontends/qt4/socket_callback.C index 7b22388d70..d3ae2983b5 100644 --- a/src/frontends/qt4/socket_callback.C +++ b/src/frontends/qt4/socket_callback.C @@ -13,7 +13,7 @@ #include #include "socket_callback.h" -#include "qt_helpers.h" + namespace lyx { @@ -21,8 +21,7 @@ socket_callback::socket_callback(int fd, boost::function func) : func_(func) { sn_.reset(new QSocketNotifier(fd, QSocketNotifier::Read, this)); - Q_CONNECT_1(QSocketNotifier, sn_.get(), activated, int, - socket_callback, this, data_received, void); + connect(sn_.get(), SIGNAL(activated(int)), this, SLOT(data_received())); } -- 2.39.2