From 3626d1ce04a844c6b9befc7626281b1b8d743434 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Fri, 17 Mar 2006 19:02:43 +0000 Subject: [PATCH] Remove qt2 support in the following files: * src/frontends/qt2/qt_helpers.C (makeFontName): * src/frontends/qt2/QWorkArea.C (QWorkArea::haveSelection): (QWorkArea::haveSelection): (QWorkArea::getClipboard): * src/frontends/qt2/panelstack.C (PanelStack::PanelStack): * src/frontends/qt4/qt_helpers.C (makeFontName): * README: remove notice about qt2 * config/qt.m4: make 3.0 the minimum required qt version git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13414 a592a061-630c-0410-9148-cb99ea01b6c8 --- README | 3 +-- config/qt.m4 | 2 +- src/frontends/qt2/QWorkArea.C | 6 ------ src/frontends/qt2/panelstack.C | 2 -- src/frontends/qt2/qt_helpers.C | 12 ------------ src/frontends/qt4/qt_helpers.C | 12 ------------ 6 files changed, 2 insertions(+), 35 deletions(-) diff --git a/README b/README index 87c9f10f3c..884325b613 100644 --- a/README +++ b/README @@ -83,8 +83,7 @@ What do I need to compile LyX from the source distribution? * LibXpm, version 4.7 or newer. Or: - * The Qt library, version 3.0 or newer (although version 2.3 - may work). + * The Qt library, version 3.0 or newer. Read the file "INSTALL" for more information on compiling. diff --git a/config/qt.m4 b/config/qt.m4 index ff6b9adf56..61eafb104e 100644 --- a/config/qt.m4 +++ b/config/qt.m4 @@ -96,7 +96,7 @@ AC_DEFUN([QT_TRY_LINK], ], [ QString s("mangle_failure"); - #if (QT_VERSION < 221) + #if (QT_VERSION < 0x030000) break_me_(\\\); #endif ], diff --git a/src/frontends/qt2/QWorkArea.C b/src/frontends/qt2/QWorkArea.C index 0dbefef5e3..a647a4cdfe 100644 --- a/src/frontends/qt2/QWorkArea.C +++ b/src/frontends/qt2/QWorkArea.C @@ -184,7 +184,6 @@ void QWorkArea::haveSelection(bool own) const { wa_ptr = this; -#if QT_VERSION >= 300 if (!QApplication::clipboard()->supportsSelection()) return; @@ -194,15 +193,12 @@ void QWorkArea::haveSelection(bool own) const } // We don't need to do anything if own = false, as this case is // handled by QT. -#endif } string const QWorkArea::getClipboard() const { -#if QT_VERSION >= 300 QApplication::clipboard()->setSelectionMode(true); -#endif QString str = QApplication::clipboard()->text(); if (str.isNull()) return string(); @@ -217,9 +213,7 @@ string const QWorkArea::getClipboard() const void QWorkArea::putClipboard(string const & str) const { -#if QT_VERSION >= 300 QApplication::clipboard()->setSelectionMode(true); -#endif #ifdef Q_OS_MAC // The MAC clipboard uses \r for lineendings, and we use \n QApplication::clipboard()->setText(toqstr(subst(str, '\n', '\r'))); diff --git a/src/frontends/qt2/panelstack.C b/src/frontends/qt2/panelstack.C index 1845c73b2a..33d073d813 100644 --- a/src/frontends/qt2/panelstack.C +++ b/src/frontends/qt2/panelstack.C @@ -37,9 +37,7 @@ PanelStack::PanelStack(QWidget * parent, const char * name) list_->setVScrollBarMode(QScrollView::AlwaysOff); list_->addColumn(""); list_->setColumnWidthMode(0, QListView::Maximum); -#if QT_VERSION >= 300 list_->setResizeMode(QListView::AllColumns); -#endif list_->setRootIsDecorated(true); QWidget * w = static_cast(list_->child("list view header")); if (w) diff --git a/src/frontends/qt2/qt_helpers.C b/src/frontends/qt2/qt_helpers.C index 9dfa68efad..0317ff2b2e 100644 --- a/src/frontends/qt2/qt_helpers.C +++ b/src/frontends/qt2/qt_helpers.C @@ -38,29 +38,17 @@ string makeFontName(string const & family, string const & foundry) { if (foundry.empty()) return family; -#if QT_VERSION >= 300 return family + " [" + foundry + ']'; -#else - return foundry + '-' + family; -#endif } pair parseFontName(string const & name) { -#if QT_VERSION >= 300 string::size_type const idx = name.find('['); if (idx == string::npos || idx == 0) return make_pair(name, string()); return make_pair(name.substr(0, idx - 1), name.substr(idx + 1, name.size() - idx - 2)); -#else - string::size_type const idx = name.find('-'); - if (idx == string::npos || idx == 0) - return make_pair(name, string()); - return make_pair(name.substr(idx + 1), - name.substr(0, idx)); -#endif } diff --git a/src/frontends/qt4/qt_helpers.C b/src/frontends/qt4/qt_helpers.C index ceab4ddb1c..1b019f7a2c 100644 --- a/src/frontends/qt4/qt_helpers.C +++ b/src/frontends/qt4/qt_helpers.C @@ -38,29 +38,17 @@ string makeFontName(string const & family, string const & foundry) { if (foundry.empty()) return family; -#if QT_VERSION >= 300 return family + " [" + foundry + ']'; -#else - return foundry + '-' + family; -#endif } pair parseFontName(string const & name) { -#if QT_VERSION >= 300 string::size_type const idx = name.find('['); if (idx == string::npos || idx == 0) return make_pair(name, string()); return make_pair(name.substr(0, idx - 1), name.substr(idx + 1, name.size() - idx - 2)); -#else - string::size_type const idx = name.find('-'); - if (idx == string::npos || idx == 0) - return make_pair(name, string()); - return make_pair(name.substr(idx + 1), - name.substr(0, idx)); -#endif } -- 2.39.5