mirror of https://github.com/KLayout/klayout.git
Build enhancements
Qt <4.7 is partially supported now: * Without Qt bindings (build.sh -without-qtbinding ...) * With reduced functionality (i.e. package manager won't work) Build compatibility with STL-less Qt installations
This commit is contained in:
parent
fdb012aa2d
commit
2cd5d68db2
|
|
@ -25,6 +25,8 @@
|
|||
#include "tlProgress.h"
|
||||
#include "version.h"
|
||||
|
||||
#include <list>
|
||||
|
||||
namespace bd
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#define HDR_extDiffToolDialog
|
||||
|
||||
#include <QDialog>
|
||||
#include <string>
|
||||
|
||||
namespace Ui
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <QObject>
|
||||
#include <QWidget>
|
||||
#include <vector>
|
||||
|
||||
class QMouseEvent;
|
||||
class QKeyEvent;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
#include <set>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@
|
|||
#include <QDialog>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#define HDR_layHelpProvider
|
||||
|
||||
#include <QDomDocument>
|
||||
#include <string>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
|
|||
|
|
@ -613,7 +613,11 @@ void MacroEditorPage::cursor_position_changed ()
|
|||
// elements not being comment or string. So we need to iterate over elements
|
||||
// and over characters inside these elements.
|
||||
|
||||
#if QT_VERSION < 0x40700
|
||||
size_t pos = size_t (cursor.position() - cursor.block().position());
|
||||
#else
|
||||
size_t pos = size_t (cursor.positionInBlock ());
|
||||
#endif
|
||||
|
||||
std::vector<SyntaxHighlighterElement>::const_iterator e;
|
||||
for (e = user_data->elements ().begin (); e != user_data->elements ().end (); ++e) {
|
||||
|
|
|
|||
|
|
@ -562,7 +562,9 @@ CustomizeMenuConfigPage::apply (const std::vector<std::pair<std::string, std::st
|
|||
}
|
||||
|
||||
mp_ui->binding_le->setText (QString ());
|
||||
#if QT_VERSION >= 0x40700
|
||||
mp_ui->binding_le->setPlaceholderText (QString ());
|
||||
#endif
|
||||
mp_ui->binding_le->setEnabled (false);
|
||||
|
||||
m_enable_event = true;
|
||||
|
|
@ -733,7 +735,9 @@ CustomizeMenuConfigPage::current_changed (QTreeWidgetItem *current, QTreeWidgetI
|
|||
if (lay::MainWindow::instance ()->menu ()->is_menu (path)) {
|
||||
|
||||
mp_ui->binding_le->setText (QString ());
|
||||
#if QT_VERSION >= 0x40700
|
||||
mp_ui->binding_le->setPlaceholderText (QString ());
|
||||
#endif
|
||||
mp_ui->binding_le->setEnabled (false);
|
||||
|
||||
} else {
|
||||
|
|
@ -745,7 +749,9 @@ CustomizeMenuConfigPage::current_changed (QTreeWidgetItem *current, QTreeWidgetI
|
|||
std::string def_shortcut = a.get_default_shortcut ();
|
||||
|
||||
mp_ui->binding_le->setText (tl::to_qstring (shortcut));
|
||||
#if QT_VERSION >= 0x40700
|
||||
mp_ui->binding_le->setPlaceholderText (tl::to_qstring (def_shortcut));
|
||||
#endif
|
||||
mp_ui->binding_le->setEnabled (true);
|
||||
|
||||
}
|
||||
|
|
@ -753,7 +759,9 @@ CustomizeMenuConfigPage::current_changed (QTreeWidgetItem *current, QTreeWidgetI
|
|||
} else {
|
||||
|
||||
mp_ui->binding_le->setText (QString ());
|
||||
#if QT_VERSION >= 0x40700
|
||||
mp_ui->binding_le->setPlaceholderText (QString ());
|
||||
#endif
|
||||
mp_ui->binding_le->setEnabled (false);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,11 @@ SaltGrainDetailsTextWidget::loadResource (int type, const QUrl &url)
|
|||
img = img.scaled (QSize (icon_dim, icon_dim), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
QImage final_img (icon_dim, icon_dim, QImage::Format_ARGB32);
|
||||
#if QT_VERSION >= 0x40700
|
||||
final_img.fill (QColor (0, 0, 0, 0));
|
||||
#else
|
||||
final_img.fill (0);
|
||||
#endif
|
||||
QPainter painter (&final_img);
|
||||
painter.drawImage ((icon_dim - img.width ()) / 2, (icon_dim - img.height ()) / 2, img);
|
||||
|
||||
|
|
@ -95,7 +99,11 @@ SaltGrainDetailsTextWidget::loadResource (int type, const QUrl &url)
|
|||
QImage s = mp_grain->screenshot ().convertToFormat (QImage::Format_ARGB32_Premultiplied);
|
||||
|
||||
QImage smask (s.size (), QImage::Format_ARGB32_Premultiplied);
|
||||
#if QT_VERSION >= 0x40700
|
||||
smask.fill (QColor (0, 0, 0, 0));
|
||||
#else
|
||||
smask.fill (0);
|
||||
#endif
|
||||
{
|
||||
int border = 0;
|
||||
int radius = 6;
|
||||
|
|
|
|||
|
|
@ -205,7 +205,11 @@ SaltModel::data (const QModelIndex &index, int role) const
|
|||
QImage scaled = img.scaled (QSize (icon_dim, icon_dim), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
|
||||
img = QImage (icon_dim, icon_dim, QImage::Format_ARGB32);
|
||||
#if QT_VERSION >= 0x40700
|
||||
img.fill (QColor (0, 0, 0, 0));
|
||||
#else
|
||||
img.fill (0);
|
||||
#endif
|
||||
QPainter painter (&img);
|
||||
painter.drawImage ((icon_dim - scaled.width ()) / 2, (icon_dim - scaled.height ()) / 2, scaled);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include <string>
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
|
|||
|
|
@ -118,12 +118,14 @@ TEST (1)
|
|||
EXPECT_EQ (g.license (), "free");
|
||||
g.set_authored_time (QDateTime ());
|
||||
EXPECT_EQ (g.authored_time ().isNull (), true);
|
||||
#if QT_VERSION >= 0x40700
|
||||
g.set_authored_time (QDateTime::fromMSecsSinceEpoch (1000000000));
|
||||
EXPECT_EQ (QDateTime::fromMSecsSinceEpoch (0).msecsTo (g.authored_time ()), 1000000000);
|
||||
g.set_installed_time (QDateTime ());
|
||||
EXPECT_EQ (g.installed_time ().isNull (), true);
|
||||
g.set_installed_time (QDateTime::fromMSecsSinceEpoch (2000000000));
|
||||
EXPECT_EQ (QDateTime::fromMSecsSinceEpoch (0).msecsTo (g.installed_time ()), 2000000000);
|
||||
#endif
|
||||
|
||||
g.add_dependency (lay::SaltGrain::Dependency ());
|
||||
g.dependencies ().back ().name = "depname";
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include <QObject>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace lay
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "laybasicCommon.h"
|
||||
|
||||
#include <QDialog>
|
||||
#include <string>
|
||||
|
||||
namespace Ui {
|
||||
class TipDialog;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include <QLabel>
|
||||
#include <QLineEdit>
|
||||
#include <QProxyStyle>
|
||||
#include <string>
|
||||
|
||||
namespace db
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <QFileInfo>
|
||||
#include <QTimer>
|
||||
#include <list>
|
||||
|
||||
namespace tl
|
||||
{
|
||||
|
|
|
|||
|
|
@ -185,6 +185,14 @@ InputHttpStream::issue_request (const QUrl &url)
|
|||
}
|
||||
request.setRawHeader (QByteArray (h->first.c_str ()), QByteArray (h->second.c_str ()));
|
||||
}
|
||||
|
||||
#if QT_VERSION < 0x40700
|
||||
if (m_request == "GET" && m_data.isEmpty ()) {
|
||||
mp_active_reply.reset (s_network_manager->get (request));
|
||||
} else {
|
||||
throw tl::Exception (tl::to_string (QObject::tr ("Custom HTTP requests are not supported in this build (verb is %1)").arg (QString::fromUtf8 (m_request))));
|
||||
}
|
||||
#else
|
||||
if (m_data.isEmpty ()) {
|
||||
mp_active_reply.reset (s_network_manager->sendCustomRequest (request, m_request));
|
||||
} else {
|
||||
|
|
@ -194,6 +202,7 @@ InputHttpStream::issue_request (const QUrl &url)
|
|||
mp_buffer = new QBuffer (&m_data);
|
||||
mp_active_reply.reset (s_network_manager->sendCustomRequest (request, m_request, mp_buffer));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
size_t
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace tl
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue