mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
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
This commit is contained in:
parent
d121dae1c8
commit
3626d1ce04
3
README
3
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.
|
||||
|
||||
|
@ -96,7 +96,7 @@ AC_DEFUN([QT_TRY_LINK],
|
||||
],
|
||||
[
|
||||
QString s("mangle_failure");
|
||||
#if (QT_VERSION < 221)
|
||||
#if (QT_VERSION < 0x030000)
|
||||
break_me_(\\\);
|
||||
#endif
|
||||
],
|
||||
|
@ -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')));
|
||||
|
@ -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<QWidget*>(list_->child("list view header"));
|
||||
if (w)
|
||||
|
@ -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<string,string> 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
|
||||
}
|
||||
|
||||
|
||||
|
@ -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<string,string> 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
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user