This commit is contained in:
Matthias Koefferlein 2021-11-25 00:57:11 +01:00
parent a4d2e7891c
commit 0e15426c9f
42 changed files with 182 additions and 122 deletions

View File

@ -110,7 +110,7 @@ InstPropertiesPage::InstPropertiesPage (edt::Service *service, db::Manager *mana
}
QHBoxLayout *layout = new QHBoxLayout (pcell_tab);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
pcell_tab->setLayout (layout);
}

View File

@ -161,7 +161,7 @@ PCellParametersPage::init ()
QGridLayout *frame_layout = new QGridLayout (this);
// spacing and margin for tool windows
frame_layout->setMargin (0);
frame_layout->setContentsMargins (0, 0, 0, 0);
setLayout (frame_layout);
mp_error_icon = new QLabel (this);
@ -172,7 +172,7 @@ PCellParametersPage::init ()
mp_error_label = new QLabel (this);
mp_error_label->setWordWrap (true);
QPalette palette = mp_error_label->palette ();
palette.setColor (QPalette::Foreground, Qt::red);
palette.setColor (QPalette::WindowText, Qt::red);
mp_error_label->setPalette (palette);
QFont font = mp_error_label->font ();
font.setBold (true);
@ -210,7 +210,7 @@ PCellParametersPage::setup (lay::LayoutView *view, int cv_index, const db::PCell
QGridLayout *inner_grid = new QGridLayout (inner_frame);
inner_frame->setLayout (inner_grid);
if (m_dense) {
inner_grid->setMargin (4);
inner_grid->setContentsMargins (4, 4, 4, 4);
inner_grid->setHorizontalSpacing (6);
inner_grid->setVerticalSpacing (2);
}
@ -251,7 +251,7 @@ PCellParametersPage::setup (lay::LayoutView *view, int cv_index, const db::PCell
inner_grid = new QGridLayout (gb);
if (m_dense) {
inner_grid->setMargin (4);
inner_grid->setContentsMargins (4, 4, 4, 4);
inner_grid->setHorizontalSpacing (6);
inner_grid->setVerticalSpacing (2);
}
@ -292,7 +292,7 @@ PCellParametersPage::setup (lay::LayoutView *view, int cv_index, const db::PCell
{
QFrame *f = new QFrame (inner_frame);
QHBoxLayout *hb = new QHBoxLayout (f);
hb->setMargin (0);
hb->setContentsMargins (0, 0, 0, 0);
f->setLayout (hb);
f->setFrameShape (QFrame::NoFrame);

View File

@ -42,7 +42,7 @@ void
RecentConfigurationPage::init ()
{
QVBoxLayout *ly = new QVBoxLayout (this);
ly->setMargin (0);
ly->setContentsMargins (0, 0, 0, 0);
QLabel *label = new QLabel (this);
label->setText (tr ("Click to select a recent configuration"));

View File

@ -1644,11 +1644,13 @@ void push_vector (std::set<X> &v, const X &x)
#if defined(HAVE_QT)
#if QT_VERSION < 0x60000
template <class X>
void push_vector (QVector<X> &v, const X &x)
{
v.push_back (x);
}
#endif
inline void push_vector (QStringList &v, const QString &x)
{

View File

@ -749,6 +749,7 @@ struct type_traits< QSet<X> * >
typedef X inner_type;
};
#if QT_VERSION < 0x60000
template <class X>
struct type_traits< QVector<X> >
: generic_type_traits<vector_tag, VectorAdaptor, T_vector>
@ -783,6 +784,7 @@ struct type_traits< QVector<X> * >
{
typedef X inner_type;
};
#endif
template <class X, class Y>
struct type_traits< QHash<X, Y> >

View File

@ -58,7 +58,7 @@ Navigator::setup (lay::Dispatcher *root, img::Object *img)
QVBoxLayout *layout = new QVBoxLayout (this);
layout->addWidget (mp_view);
layout->setStretchFactor (mp_view, 1);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
layout->setSpacing (0);
setLayout (layout);

View File

@ -40,6 +40,7 @@
#include <fstream>
#include <QColor>
#include <QRegExp>
#include <QPalette>
#include <QApplication>
#include <QDir>
@ -500,7 +501,11 @@ HelpSource::get_image (const std::string &u)
}
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());
@ -529,7 +534,11 @@ HelpSource::get_css (const std::string &u)
}
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -336,7 +336,7 @@ MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection
setObjectName (QString::fromUtf8 ("MacroEditorDialog"));
QHBoxLayout *layout = new QHBoxLayout (console_text_frame);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
console_text_frame->setLayout (layout);
mp_console_text = new TextEditWidget (console_text_frame);
mp_console_text->setReadOnly (true);
@ -467,7 +467,11 @@ MacroEditorDialog::MacroEditorDialog (lay::Dispatcher *pr, lym::MacroCollection
// add standard templates
QResource res (QString::fromUtf8 (":/macro-templates/index.txt"));
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -119,7 +119,11 @@ MacroEditorHighlighters::highlighter_for_scheme (QObject *parent, const std::str
QResource res (tl::to_qstring (":/syntax/" + scheme + ".xml"));
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());
@ -514,7 +518,7 @@ MacroEditorPage::MacroEditorPage (QWidget * /*parent*/, MacroEditorHighlighters
mp_completer_popup = new QWidget (window (), Qt::ToolTip);
mp_completer_popup->setWindowModality (Qt::NonModal);
QHBoxLayout *ly = new QHBoxLayout (mp_completer_popup);
ly->setMargin (0);
ly->setContentsMargins (0, 0, 0, 0);
mp_completer_list = new QListWidget (mp_completer_popup);
ly->addWidget (mp_completer_list);
mp_completer_popup->hide ();

View File

@ -220,7 +220,7 @@ MainWindow::MainWindow (QApplication *app, const char *name, bool undo_enabled)
mp_main_stack_widget->setCurrentIndex (0);
QVBoxLayout *vbl = new QVBoxLayout (mp_main_frame);
vbl->setMargin (0);
vbl->setContentsMargins (0, 0, 0, 0);
vbl->setSpacing (0);
mp_tab_bar = new QTabBar (mp_main_frame);
@ -348,7 +348,7 @@ MainWindow::MainWindow (QApplication *app, const char *name, bool undo_enabled)
mp_status_bar->addWidget (mp_cp_frame);
QHBoxLayout *cp_frame_ly = new QHBoxLayout (mp_cp_frame);
cp_frame_ly->setMargin (0);
cp_frame_ly->setContentsMargins (0, 0, 0, 0);
cp_frame_ly->setSpacing (0);
mp_cpx_label = new QLabel (mp_cp_frame);
mp_cpx_label->setObjectName (QString::fromUtf8 ("cpx_label"));

View File

@ -479,7 +479,7 @@ Navigator::Navigator (MainWindow *main_window)
layout->addWidget (mp_menu_bar);
layout->addWidget (mp_placeholder_label);
layout->setStretchFactor (mp_placeholder_label, 1);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
layout->setSpacing (0);
setLayout (layout);

View File

@ -32,7 +32,7 @@ ProgressDialog::ProgressDialog (QWidget *parent, ProgressReporter *pr)
: QDialog (parent), mp_pr (pr)
{
QVBoxLayout *vbl = new QVBoxLayout (this);
vbl->setMargin (0);
vbl->setContentsMargins (0, 0, 0, 0);
vbl->setSpacing (0);
mp_progress_widget = new ProgressWidget (pr, this, true);

View File

@ -192,7 +192,7 @@ ProgressWidget::ProgressWidget (ProgressReporter *pr, QWidget *parent, bool fw)
mp_layout = layout;
layout->setSpacing (4);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
int col = 0;
@ -212,7 +212,7 @@ ProgressWidget::ProgressWidget (ProgressReporter *pr, QWidget *parent, bool fw)
QGridLayout *pbf_layout = new QGridLayout (mp_progress_bar_frame);
mp_progress_bar_frame->setLayout (pbf_layout);
pbf_layout->setMargin (0);
pbf_layout->setContentsMargins (0, 0, 0, 0);
pbf_layout->setSpacing (0);
mp_progress_bar1 = new ProgressBarWidget (mp_progress_bar_frame);

View File

@ -58,7 +58,11 @@ ResourceHelpProvider::get (const std::string &path) const
}
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -336,7 +336,11 @@ public:
}
QByteArray data;
#if QT_VERSION >= 0x60000
if (child_res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (child_res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)child_res.data (), (int)child_res.size ());
} else {
data = QByteArray ((const char *)child_res.data (), (int)child_res.size ());

View File

@ -97,7 +97,7 @@ SettingsForm::SettingsForm (QWidget *parent, lay::Dispatcher *dispatcher, const
if (config_page->layout () == 0) {
tl::warn << "No layout in configuration page " << p->first;
} else {
config_page->layout ()->setMargin (0);
config_page->layout ()->setContentsMargins (0, 0, 0, 0);
}
m_config_pages.push_back (config_page);

View File

@ -1242,7 +1242,7 @@ TechComponentSetupDialog::TechComponentSetupDialog (QWidget *parent, db::Technol
QVBoxLayout *layout = new QVBoxLayout (mp_ui->content_frame);
layout->addWidget (mp_editor);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
mp_ui->content_frame->setLayout (layout);
mp_editor->set_technology (tech, mp_component);

View File

@ -58,6 +58,7 @@
#include <fstream>
#include <sstream>
#include <map>
#include <memory>
// --------------------------------------------------------------
// A helper class that allows putting a QImage into a tl::Variant
@ -376,14 +377,14 @@ MouseTrackerWidget::set (const QMouseEvent &me)
if (me.button () == Qt::RightButton) {
mp_current_pixmap = &m_rb_pm;
} else if (me.button () == Qt::MidButton) {
} else if (me.button () == Qt::MiddleButton) {
mp_current_pixmap = &m_mb_pm;
} else if (me.button () == Qt::LeftButton) {
mp_current_pixmap = &m_lb_pm;
} else if (me.type () == QEvent::MouseMove) {
if (me.buttons () & Qt::RightButton) {
mp_current_pixmap = &m_rb_pm;
} else if (me.buttons () & Qt::MidButton) {
} else if (me.buttons () & Qt::MiddleButton) {
mp_current_pixmap = &m_mb_pm;
} else if (me.buttons () & Qt::LeftButton) {
mp_current_pixmap = &m_lb_pm;
@ -578,7 +579,12 @@ class LogMouseEvent
{
public:
LogMouseEvent (const std::string &target, const QMouseEvent &me, int xml_line = 0)
: LogTargetedEvent (target, xml_line), m_mouse_event (me)
: LogTargetedEvent (target, xml_line),
#if QT_VERSION >= 0x60000
m_mouse_event (new QMouseEvent (me.type (), me.position (), me.globalPosition (), me.button (), me.buttons (), me.modifiers ()))
#else
m_mouse_event (new QMouseEvent (me.type (), me.pos (), me.button (), me.buttons (), me.modifiers ()))
#endif
{
// .. nothing yet ..
}
@ -587,11 +593,11 @@ public:
{
QWidget *target = target_widget ();
if (m_mouse_event.type () == QEvent::MouseButtonPress) {
if (m_mouse_event->type () == QEvent::MouseButtonPress) {
target->setFocus ();
}
QMouseEvent me (m_mouse_event.type (), m_mouse_event.pos (), target->mapToGlobal (m_mouse_event.pos ()), m_mouse_event.button (), m_mouse_event.buttons (), m_mouse_event.modifiers ());
QMouseEvent me (m_mouse_event->type (), m_mouse_event->pos (), m_mouse_event->globalPos (), m_mouse_event->button (), m_mouse_event->buttons (), m_mouse_event->modifiers ());
MouseTrackerWidget::instance ()->set (me);
Player::instance ()->issue_event (target, &me);
}
@ -599,13 +605,13 @@ public:
virtual const char *name () const
{
const char *event_name = "";
if (m_mouse_event.type () == QEvent::MouseMove) {
if (m_mouse_event->type () == QEvent::MouseMove) {
event_name = "mouse_move";
} else if (m_mouse_event.type() == QEvent::MouseButtonDblClick) {
} else if (m_mouse_event->type() == QEvent::MouseButtonDblClick) {
event_name = "mouse_button_dbl_click";
} else if (m_mouse_event.type() == QEvent::MouseButtonPress) {
} else if (m_mouse_event->type() == QEvent::MouseButtonPress) {
event_name = "mouse_button_press";
} else if (m_mouse_event.type() == QEvent::MouseButtonRelease) {
} else if (m_mouse_event->type() == QEvent::MouseButtonRelease) {
event_name = "mouse_button_release";
}
return event_name;
@ -615,29 +621,29 @@ public:
{
LogTargetedEvent::attributes (attr);
attr.push_back (std::make_pair (std::string ("xpos"), tl::to_string (m_mouse_event.x ())));
attr.push_back (std::make_pair (std::string ("ypos"), tl::to_string (m_mouse_event.y ())));
if (m_mouse_event.type () == QEvent::MouseMove) {
attr.push_back (std::make_pair (std::string ("buttons"), tl::sprintf ("%x", int (m_mouse_event.buttons ()))));
attr.push_back (std::make_pair (std::string ("xpos"), tl::to_string (m_mouse_event->x ())));
attr.push_back (std::make_pair (std::string ("ypos"), tl::to_string (m_mouse_event->y ())));
if (m_mouse_event->type () == QEvent::MouseMove) {
attr.push_back (std::make_pair (std::string ("buttons"), tl::sprintf ("%x", int (m_mouse_event->buttons ()))));
} else {
attr.push_back (std::make_pair (std::string ("button"), tl::sprintf ("%x", int (m_mouse_event.button ()))));
attr.push_back (std::make_pair (std::string ("button"), tl::sprintf ("%x", int (m_mouse_event->button ()))));
}
attr.push_back (std::make_pair (std::string ("modifiers"), tl::sprintf ("%x", int (m_mouse_event.modifiers ()))));
attr.push_back (std::make_pair (std::string ("modifiers"), tl::sprintf ("%x", int (m_mouse_event->modifiers ()))));
}
const QMouseEvent &event () const
{
return m_mouse_event;
return *m_mouse_event;
}
void move (const QPoint &p)
{
m_mouse_event = QMouseEvent (m_mouse_event.type (),
m_mouse_event.pos () + p,
m_mouse_event.globalPos () + p,
m_mouse_event.button (),
m_mouse_event.buttons (),
m_mouse_event.modifiers ());
m_mouse_event.reset (new QMouseEvent (m_mouse_event->type (),
m_mouse_event->pos () + p,
m_mouse_event->globalPos () + p,
m_mouse_event->button (),
m_mouse_event->buttons (),
m_mouse_event->modifiers ()));
}
bool equals (const LogEventBase &b) const
@ -648,14 +654,14 @@ public:
}
return LogTargetedEvent::equals (b) &&
m_mouse_event.type () == be->m_mouse_event.type () &&
m_mouse_event.pos () == be->m_mouse_event.pos () &&
m_mouse_event.modifiers () == be->m_mouse_event.modifiers () &&
m_mouse_event.buttons () == be->m_mouse_event.buttons ();
m_mouse_event->type () == be->m_mouse_event->type () &&
m_mouse_event->pos () == be->m_mouse_event->pos () &&
m_mouse_event->modifiers () == be->m_mouse_event->modifiers () &&
m_mouse_event->buttons () == be->m_mouse_event->buttons ();
}
private:
QMouseEvent m_mouse_event;
std::unique_ptr<QMouseEvent> m_mouse_event;
};
class LogKeyEvent
@ -663,20 +669,20 @@ class LogKeyEvent
{
public:
LogKeyEvent (const std::string &target, const QKeyEvent &ke, int xml_line = 0)
: LogTargetedEvent (target, xml_line), m_key_event (ke)
: LogTargetedEvent (target, xml_line), m_key_event (new QKeyEvent (ke.type (), ke.key (), ke.modifiers ()))
{
// .. nothing yet ..
}
virtual void issue_event ()
{
QKeyEvent ke (m_key_event);
Player::instance ()->issue_event (target_widget (), &ke);
std::unique_ptr<QKeyEvent> ke (new QKeyEvent (m_key_event->type (), m_key_event->key (), m_key_event->modifiers ()));
Player::instance ()->issue_event (target_widget (), ke.get ());
}
virtual const char *name () const
{
if (m_key_event.type() == QEvent::KeyPress) {
if (m_key_event->type() == QEvent::KeyPress) {
return "key_press";
} else {
return "key_release";
@ -688,13 +694,13 @@ public:
LogTargetedEvent::attributes (attr);
QChar ch;
if (! m_key_event.text ().isEmpty ()) {
ch = m_key_event.text ().at (0);
if (! m_key_event->text ().isEmpty ()) {
ch = m_key_event->text ().at (0);
}
attr.push_back (std::make_pair (std::string ("key"), tl::sprintf ("%x", int (m_key_event.key ()))));
attr.push_back (std::make_pair (std::string ("key"), tl::sprintf ("%x", int (m_key_event->key ()))));
attr.push_back (std::make_pair (std::string ("code"), tl::sprintf ("%x", int (ch.unicode ()))));
attr.push_back (std::make_pair (std::string ("modifiers"), tl::sprintf ("%x", int (m_key_event.modifiers ()))));
attr.push_back (std::make_pair (std::string ("modifiers"), tl::sprintf ("%x", int (m_key_event->modifiers ()))));
}
bool equals (const LogEventBase &b) const
@ -705,12 +711,12 @@ public:
}
return LogTargetedEvent::equals (b) &&
m_key_event.modifiers () == be->m_key_event.modifiers () &&
m_key_event.key () == be->m_key_event.key ();
m_key_event->modifiers () == be->m_key_event->modifiers () &&
m_key_event->key () == be->m_key_event->key ();
}
private:
QKeyEvent m_key_event;
std::unique_ptr<QKeyEvent> m_key_event;
};
class LogActionEvent

View File

@ -30,6 +30,7 @@
#include "gsi.h"
#include <QAction>
#include <QActionGroup>
#include <QMenu>
#include <QMenuBar>
#include <QShortcutEvent>
@ -921,7 +922,7 @@ AbstractMenu::build_detached (const std::string &name, QFrame *mbar)
}
QHBoxLayout *menu_layout = new QHBoxLayout (mbar);
menu_layout->setMargin (0);
menu_layout->setContentsMargins (0, 0, 0, 0);
mbar->setLayout (menu_layout);
AbstractMenuItem *item = find_item_exact ("@@" + name);

View File

@ -96,7 +96,7 @@ BookmarksView::BookmarksView (LayoutView *view, QWidget *parent, const char *nam
mp_view = view;
QVBoxLayout *layout = new QVBoxLayout ();
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
setLayout (layout);
mp_bookmarks = new QListView (this);

View File

@ -479,7 +479,7 @@ BrowseInstancesForm::cell_changed (QTreeWidgetItem *item, QTreeWidgetItem *)
if (lv_cell_instance->topLevelItemCount () > 0) {
QTreeWidgetItem *item = lv_cell_instance->topLevelItem (0);
lv_cell_instance->setItemSelected (item, true);
item->setSelected (true);
lv_cell_instance->setCurrentItem (item);
lv_cell_instance->scrollToItem (item);
}
@ -612,7 +612,11 @@ BrowseInstancesForm::change_cell (db::cell_index_type cell_index, int cv_index)
for (int col = 0; col < 3; ++col) {
all->setFont (col, f);
#if QT_VERSION >= 0x60000
all->setForeground (col, tc);
#else
all->setTextColor (col, tc);
#endif
}
// create the entries.
@ -636,7 +640,7 @@ BrowseInstancesForm::change_cell (db::cell_index_type cell_index, int cv_index)
// make the first the current one
if (sel_item) {
lv_cell->setCurrentItem (sel_item);
lv_cell->setItemSelected (sel_item, true);
sel_item->setSelected (true);
lv_cell->scrollToItem (sel_item);
}
@ -877,7 +881,7 @@ BrowseInstancesForm::adv_cell_inst (bool up)
}
if (ni) {
lv_cell_instance->setCurrentItem (ni);
lv_cell_instance->setItemSelected (ni, true);
ni->setSelected (true);
lv_cell_instance->scrollToItem (ni);
}

View File

@ -297,7 +297,11 @@ public:
for (int col = 0; col < 3; ++col) {
setFont (col, f);
#if QT_VERSION >= 0x60000
setForeground (col, tc);
#else
setTextColor (col, tc);
#endif
}
}
};
@ -627,7 +631,7 @@ BrowseShapesForm::cell_changed (QTreeWidgetItem *item, QTreeWidgetItem *)
lv_shape_instance->addTopLevelItems (items);
if (lv_shape_instance->topLevelItemCount () > 0) {
lv_shape_instance->setItemSelected (lv_shape_instance->topLevelItem (0), true);
lv_shape_instance->topLevelItem (0)->setSelected (true);
lv_shape_instance->setCurrentItem (lv_shape_instance->topLevelItem (0));
}
@ -814,7 +818,7 @@ BrowseShapesForm::update_cell_list ()
if (sel_item) {
lv_cell->setCurrentItem (sel_item);
lv_cell->setItemSelected (sel_item, true);
sel_item->setSelected (true);
lv_cell->scrollToItem (sel_item);
}
}
@ -992,7 +996,7 @@ BrowseShapesForm::adv_cell (bool up)
if (litem) {
QTreeWidgetItem *ni = litem->child (0);
lv_cell->setCurrentItem (ni);
lv_cell->setItemSelected (ni, true);
ni->setSelected (true);
lv_cell->scrollToItem (ni);
}
} else if (current->parent () == litem) {
@ -1008,12 +1012,12 @@ BrowseShapesForm::adv_cell (bool up)
if (litem) {
QTreeWidgetItem *ni = litem->child (litem->childCount () - 1);
lv_cell->setCurrentItem (ni);
lv_cell->setItemSelected (ni, true);
ni->setSelected (true);
lv_cell->scrollToItem (ni);
} else {
// revert to the original
lv_cell->setCurrentItem (current);
lv_cell->setItemSelected (current, true);
current->setSelected (true);
lv_cell->scrollToItem (current);
}
}
@ -1047,7 +1051,7 @@ BrowseShapesForm::adv_shape (bool up)
QTreeWidgetItem *ni = lv_shape_instance->topLevelItem (lv_shape_instance->topLevelItemCount () - 1);
if (ni) {
lv_shape_instance->setCurrentItem (ni);
lv_shape_instance->setItemSelected (ni, true);
ni->setSelected (true);
lv_shape_instance->scrollToItem (ni);
}
}
@ -1089,7 +1093,7 @@ BrowseShapesForm::adv_cell_inst (bool up)
}
if (ni) {
lv_cell_instance->setCurrentItem (ni);
lv_cell_instance->setItemSelected (ni, true);
ni->setSelected (true);
lv_cell_instance->scrollToItem (ni);
}

View File

@ -823,7 +823,7 @@ CellTreeModel::data (const QModelIndex &index, int role) const
return QVariant ();
}
} else if (role == Qt::TextColorRole) {
} else if (role == Qt::ForegroundRole) {
#if 0 // do strikeout rather than making the color darker
if (! mp_view) {

View File

@ -110,7 +110,7 @@ ConfigurationDialog::init (const lay::PluginDeclaration *decl)
for (std::vector <lay::ConfigPage *>::iterator p = m_config_pages.begin (); p != m_config_pages.end (); ++p) {
if ((*p)->layout ()) {
(*p)->layout ()->setMargin (0);
(*p)->layout ()->setContentsMargins (0, 0, 0, 0);
}
(*p)->setup (mp_root);
}

View File

@ -43,7 +43,11 @@ D25TechnologyComponentEditor::D25TechnologyComponentEditor (QWidget *parent)
QResource res (tl::to_qstring (":/syntax/d25_text.xml"));
QByteArray data ((const char *) res.data (), int (res.size ()));
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress (data);
}

View File

@ -1075,7 +1075,11 @@ UserPropertiesForm::UserPropertiesForm (QWidget *parent)
QResource res (tl::to_qstring (":/syntax/ur_text.xml"));
QByteArray data ((const char *) res.data (), int (res.size ()));
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress (data);
}

View File

@ -181,7 +181,11 @@ EditStipplesForm::update ()
name = tl::sprintf ("#%d", std::distance (m_pattern.begin (), i));
}
QListWidgetItem *item = new QListWidgetItem (icon_from_data (i->pattern ()), tl::to_qstring (name), mp_ui->stipple_items);
#if QT_VERSION >= 0x60000
item->setForeground (cdis);
#else
item->setTextColor (cdis);
#endif
}
for (std::vector <lay::DitherPattern::iterator>::const_iterator i = iters.begin (); i != iters.end (); ++i) {
if ((*i)->order_index () > 0) {

View File

@ -37,7 +37,7 @@ EditorOptionsFrame::EditorOptionsFrame (QWidget *parent)
setObjectName (QString::fromUtf8 ("editor_options_frame"));
QVBoxLayout *left_frame_ly = new QVBoxLayout (this);
left_frame_ly->setMargin (0);
left_frame_ly->setContentsMargins (0, 0, 0, 0);
left_frame_ly->setSpacing (0);
}

View File

@ -53,7 +53,7 @@ EditorOptionsPages::EditorOptionsPages (QWidget *parent, const std::vector<lay::
: QFrame (parent), mp_dispatcher (dispatcher)
{
QVBoxLayout *ly1 = new QVBoxLayout (this);
ly1->setMargin (0);
ly1->setContentsMargins (0, 0, 0, 0);
mp_pages = new QTabWidget (this);
mp_pages->setSizePolicy (QSizePolicy (QSizePolicy::Ignored, QSizePolicy::Ignored));

View File

@ -175,7 +175,7 @@ HCPCellTreeWidget::mouseDoubleClickEvent (QMouseEvent *event)
void
HCPCellTreeWidget::mousePressEvent (QMouseEvent *event)
{
if (event->button () == Qt::MidButton) {
if (event->button () == Qt::MiddleButton) {
// eat this event.
} else {
QModelIndex index (indexAt (event->pos ()));
@ -189,7 +189,7 @@ HCPCellTreeWidget::mousePressEvent (QMouseEvent *event)
void
HCPCellTreeWidget::mouseReleaseEvent (QMouseEvent *event)
{
if (event->button () == Qt::MidButton) {
if (event->button () == Qt::MiddleButton) {
QModelIndex index (indexAt (event->pos ()));
if (index.isValid ()) {
emit cell_middle_clicked (index);
@ -238,7 +238,6 @@ HierarchyControlPanel::HierarchyControlPanel (lay::LayoutView *view, QWidget *pa
mp_search_frame->setBackgroundRole (QPalette::Highlight);
QHBoxLayout *sf_ly = new QHBoxLayout (mp_search_frame);
sf_ly->setMargin (0);
sf_ly->setContentsMargins (0, 0, 0, 0);
sf_ly->setSpacing (0);
@ -249,7 +248,7 @@ HierarchyControlPanel::HierarchyControlPanel (lay::LayoutView *view, QWidget *pa
mp_search_close_cb->setBackgroundRole (QPalette::Highlight);
mp_search_close_cb->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
QPalette pl (mp_search_close_cb->palette ());
pl.setColor (QPalette::Foreground, pl.color (QPalette::Active, QPalette::HighlightedText));
pl.setColor (QPalette::WindowText, pl.color (QPalette::Active, QPalette::HighlightedText));
mp_search_close_cb->setPalette (pl);
mp_search_close_cb->setMaximumSize (QSize (mp_search_close_cb->maximumSize ().width (), mp_search_close_cb->sizeHint ().height () - 4));
connect (mp_search_close_cb, SIGNAL (clicked ()), this, SLOT (search_editing_finished ()));

View File

@ -218,7 +218,7 @@ LayerControlPanel::LayerControlPanel (lay::LayoutView *view, db::Manager *manage
setSizePolicy (sp);
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
mp_search_frame = new QFrame (this);
@ -231,7 +231,6 @@ LayerControlPanel::LayerControlPanel (lay::LayoutView *view, db::Manager *manage
mp_search_frame->setBackgroundRole (QPalette::Highlight);
QHBoxLayout *sf_ly = new QHBoxLayout (mp_search_frame);
sf_ly->setMargin (0);
sf_ly->setContentsMargins (0, 0, 0, 0);
sf_ly->setSpacing (0);
@ -242,7 +241,7 @@ LayerControlPanel::LayerControlPanel (lay::LayoutView *view, db::Manager *manage
mp_search_close_cb->setBackgroundRole (QPalette::Highlight);
mp_search_close_cb->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
QPalette pl (mp_search_close_cb->palette ());
pl.setColor (QPalette::Foreground, pl.color (QPalette::Active, QPalette::HighlightedText));
pl.setColor (QPalette::WindowText, pl.color (QPalette::Active, QPalette::HighlightedText));
mp_search_close_cb->setPalette (pl);
mp_search_close_cb->setMaximumSize (QSize (mp_search_close_cb->maximumSize ().width (), mp_search_close_cb->sizeHint ().height () - 4));
connect (mp_search_close_cb, SIGNAL (clicked ()), this, SLOT (search_editing_finished ()));
@ -338,7 +337,7 @@ LayerControlPanel::LayerControlPanel (lay::LayoutView *view, db::Manager *manage
l->addWidget (tb);
QHBoxLayout *ltb = new QHBoxLayout (tb);
ltb->setMargin (0);
ltb->setContentsMargins (0, 0, 0, 0);
ltb->setSpacing (0);
tb->setObjectName (QString::fromUtf8 ("lcp_buttons"));

View File

@ -108,7 +108,7 @@ LCPDitherPalette::LCPDitherPalette (QWidget *parent, const char *name)
int n = 0;
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
for (unsigned int i = 0; i < 4; ++i) {
@ -117,7 +117,7 @@ LCPDitherPalette::LCPDitherPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("dp_f"));
l->addWidget (f);
QHBoxLayout *ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
for (unsigned int j = 0; j < 4; ++j) {
@ -151,7 +151,7 @@ LCPDitherPalette::LCPDitherPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("dp_ll"));
l->addWidget (f);
QHBoxLayout *ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
LCPActiveLabel *b;
@ -292,7 +292,7 @@ LCPVisibilityPalette::LCPVisibilityPalette (QWidget *parent, const char *name)
setObjectName (QString::fromUtf8 (name));
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
QFrame *f;
@ -307,7 +307,7 @@ LCPVisibilityPalette::LCPVisibilityPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("vis_f"));
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (0, f);
@ -331,7 +331,7 @@ LCPVisibilityPalette::LCPVisibilityPalette (QWidget *parent, const char *name)
f = new QFrame (this);
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (2, f);
@ -376,7 +376,7 @@ LCPAnimationPalette::LCPAnimationPalette (QWidget *parent, const char *name)
setObjectName (QString::fromUtf8 (name));
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
QFrame *f;
@ -391,7 +391,7 @@ LCPAnimationPalette::LCPAnimationPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("anim_f"));
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (0, f);
@ -415,7 +415,7 @@ LCPAnimationPalette::LCPAnimationPalette (QWidget *parent, const char *name)
f = new QFrame (this);
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (2, f);
@ -452,7 +452,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
setObjectName (QString::fromUtf8 (name));
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
QFrame *f;
@ -466,7 +466,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
f = new QFrame (this);
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
for (int i = 0; i < 4; ++i) {
@ -489,7 +489,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("ls_ll"));
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
// No style
@ -523,7 +523,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("style_f"));
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (0, f);
@ -561,7 +561,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
f = new QFrame (this);
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (200, f);
@ -583,7 +583,7 @@ LCPStylePalette::LCPStylePalette (QWidget *parent, const char *name)
f = new QFrame (this);
l->addWidget (f);
ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
b = new LCPActiveLabel (100, f);
@ -716,7 +716,7 @@ LCPColorPalette::LCPColorPalette (QWidget *parent, const char *name)
sp.setVerticalStretch (0);
QVBoxLayout *l = new QVBoxLayout (this);
l->setMargin (0);
l->setContentsMargins (0, 0, 0, 0);
l->setSpacing (0);
for (unsigned int i = 0; i < 6; ++i) {
@ -724,7 +724,7 @@ LCPColorPalette::LCPColorPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("color_f"));
l->addWidget (f);
QHBoxLayout *ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
for (unsigned int j = 0; j < 7; ++j) {
@ -754,7 +754,7 @@ LCPColorPalette::LCPColorPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("color_l1"));
l->addWidget (f);
QHBoxLayout *ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
LCPActiveLabel *b;
@ -784,7 +784,7 @@ LCPColorPalette::LCPColorPalette (QWidget *parent, const char *name)
f->setObjectName (QString::fromUtf8 ("color_l2"));
l->addWidget (f);
QHBoxLayout *ll = new QHBoxLayout (f);
ll->setMargin (0);
ll->setContentsMargins (0, 0, 0, 0);
ll->setSpacing (0);
LCPActiveLabel *b;
@ -956,7 +956,7 @@ LayerToolbox::add_panel (QWidget *panel_widget, const char *text)
b->setFocusPolicy (Qt::NoFocus);
b->setBackgroundRole (QPalette::Highlight);
QPalette pl (b->palette ());
pl.setColor (QPalette::Foreground, pl.color (QPalette::Active, QPalette::HighlightedText));
pl.setColor (QPalette::WindowText, pl.color (QPalette::Active, QPalette::HighlightedText));
b->setPalette (pl);
b->setText (tl::to_qstring (text));
b->setMaximumSize (QSize (b->maximumSize ().width (), b->sizeHint ().height () - 4));

View File

@ -851,7 +851,7 @@ LayerTreeModel::data (const QModelIndex &index, int role) const
return QVariant ();
}
} else if (role == Qt::TextColorRole || role == Qt::FontRole) {
} else if (role == Qt::ForegroundRole || role == Qt::FontRole) {
if (index.column () == 1) {

View File

@ -303,7 +303,7 @@ LayoutCanvas::LayoutCanvas (QWidget *parent, lay::LayoutView *view, const char *
mp_redraw_thread = new lay::RedrawThread (this, view);
setBackgroundRole (QPalette::NoRole);
set_colors (palette ().color (QPalette::Normal, QPalette::Background),
set_colors (palette ().color (QPalette::Normal, QPalette::Window),
palette ().color (QPalette::Normal, QPalette::Text),
palette ().color (QPalette::Normal, QPalette::Mid));
setAttribute (Qt::WA_NoSystemBackground);

View File

@ -138,7 +138,11 @@ public:
: mp_layout (layout)
{
QResource res (QString::fromUtf8 (":/st/") + url.path ());
if (res.isCompressed ()) {
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
m_temp = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
m_temp = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -470,7 +470,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
m_current_layer_list = 0;
QVBoxLayout *vbl = new QVBoxLayout (this);
vbl->setMargin (0);
vbl->setContentsMargins (0, 0, 0, 0);
vbl->setSpacing (0);
mp_canvas = new lay::LayoutCanvas (this, this);
@ -490,7 +490,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
hierarchy_frame->setObjectName (QString::fromUtf8 ("left"));
mp_hierarchy_frame = hierarchy_frame;
QVBoxLayout *left_frame_ly = new QVBoxLayout (hierarchy_frame);
left_frame_ly->setMargin (0);
left_frame_ly->setContentsMargins (0, 0, 0, 0);
left_frame_ly->setSpacing (0);
mp_hierarchy_panel = new lay::HierarchyControlPanel (this, hierarchy_frame, "hcp");
@ -504,7 +504,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
levels_frame->setObjectName (QString::fromUtf8 ("lvl_frame"));
left_frame_ly->addWidget (levels_frame);
QHBoxLayout *levels_frame_ly = new QHBoxLayout (levels_frame);
levels_frame_ly->setMargin (1);
levels_frame_ly->setContentsMargins (1, 1, 1, 1);
QLabel *level_l1 = new QLabel (tl::to_qstring (" " + tl::to_string (QObject::tr ("Levels"))), levels_frame);
levels_frame_ly->addWidget (level_l1);
mp_min_hier_spbx = new QSpinBox (levels_frame);
@ -537,7 +537,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
bookmarks_frame->setObjectName (QString::fromUtf8 ("bookmarks_frame"));
mp_bookmarks_frame = bookmarks_frame;
QVBoxLayout *left_frame_ly = new QVBoxLayout (bookmarks_frame);
left_frame_ly->setMargin (0);
left_frame_ly->setContentsMargins (0, 0, 0, 0);
left_frame_ly->setSpacing (0);
mp_bookmarks_view = new lay::BookmarksView (this, bookmarks_frame, "bookmarks");
@ -552,7 +552,7 @@ LayoutView::init (db::Manager *mgr, QWidget * /*parent*/)
mp_libraries_frame = new QFrame (0);
mp_libraries_frame->setObjectName (QString::fromUtf8 ("libs_frame"));
QVBoxLayout *left_frame_ly = new QVBoxLayout (mp_libraries_frame);
left_frame_ly->setMargin (0);
left_frame_ly->setContentsMargins (0, 0, 0, 0);
left_frame_ly->setSpacing (0);
mp_libraries_view = new lay::LibrariesView (this, mp_libraries_frame, "libs");

View File

@ -165,7 +165,7 @@ LibraryTreeWidget::mouseDoubleClickEvent (QMouseEvent *event)
void
LibraryTreeWidget::mousePressEvent (QMouseEvent *event)
{
if (event->button () == Qt::MidButton) {
if (event->button () == Qt::MiddleButton) {
// eat this event.
} else {
QModelIndex index (indexAt (event->pos ()));
@ -179,7 +179,7 @@ LibraryTreeWidget::mousePressEvent (QMouseEvent *event)
void
LibraryTreeWidget::mouseReleaseEvent (QMouseEvent *event)
{
if (event->button () == Qt::MidButton) {
if (event->button () == Qt::MiddleButton) {
QModelIndex index (indexAt (event->pos ()));
if (index.isValid ()) {
emit cell_middle_clicked (index);
@ -225,7 +225,6 @@ LibrariesView::LibrariesView (lay::LayoutView *view, QWidget *parent, const char
mp_search_frame->setBackgroundRole (QPalette::Highlight);
QHBoxLayout *sf_ly = new QHBoxLayout (mp_search_frame);
sf_ly->setMargin (0);
sf_ly->setContentsMargins (0, 0, 0, 0);
sf_ly->setSpacing (0);
@ -236,7 +235,7 @@ LibrariesView::LibrariesView (lay::LayoutView *view, QWidget *parent, const char
mp_search_close_cb->setBackgroundRole (QPalette::Highlight);
mp_search_close_cb->setSizePolicy (QSizePolicy (QSizePolicy::Fixed, QSizePolicy::Preferred));
QPalette pl (mp_search_close_cb->palette ());
pl.setColor (QPalette::Foreground, pl.color (QPalette::Active, QPalette::HighlightedText));
pl.setColor (QPalette::WindowText, pl.color (QPalette::Active, QPalette::HighlightedText));
mp_search_close_cb->setPalette (pl);
mp_search_close_cb->setMaximumSize (QSize (mp_search_close_cb->maximumSize ().width (), mp_search_close_cb->sizeHint ().height () - 4));
connect (mp_search_close_cb, SIGNAL (clicked ()), this, SLOT (search_editing_finished ()));

View File

@ -326,7 +326,7 @@ SpecificLoadLayoutOptionsDialog::SpecificLoadLayoutOptionsDialog (QWidget *paren
QVBoxLayout *layout = new QVBoxLayout (mp_ui->content_frame);
layout->addWidget (mp_editor);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
mp_ui->content_frame->setLayout (layout);
mp_editor->show ();

View File

@ -61,11 +61,11 @@ void
SelectCellViewForm::set_selection (int sel)
{
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
cvs_lb->setItemSelected (cvs_lb->item (i), false);
cvs_lb->item (i)->setSelected (false);
}
if (sel >= 0 && sel < int (cvs_lb->count ())) {
cvs_lb->setCurrentItem (cvs_lb->item (sel));
cvs_lb->setItemSelected (cvs_lb->item (sel), true);
cvs_lb->item (sel)->setSelected (true);
}
}
@ -86,14 +86,14 @@ SelectCellViewForm::tell_cellview (const lay::CellView &cv)
{
cvs_lb->addItem (tl::to_qstring (cv->name ()));
cvs_lb->setCurrentItem (0);
cvs_lb->setItemSelected (cvs_lb->item (0), true);
cvs_lb->item (0)->setSelected (true);
}
bool
SelectCellViewForm::all_selected () const
{
for (int i = 0; i < int (cvs_lb->count ()); ++i) {
if (! cvs_lb->isItemSelected (cvs_lb->item (i))) {
if (! cvs_lb->item (i)->isSelected ()) {
return false;
}
}

View File

@ -1359,7 +1359,11 @@ void MacroCollection::scan (const std::string &path)
if (res.size () > 0) {
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());

View File

@ -50,7 +50,7 @@ GerberImportDialogFileColumnEditorWidget::GerberImportDialogFileColumnEditorWidg
{
QHBoxLayout *layout = new QHBoxLayout (this);
layout->setSpacing (0);
layout->setMargin (0);
layout->setContentsMargins (0, 0, 0, 0);
setLayout (layout);
setFocusPolicy (Qt::ClickFocus);

View File

@ -176,12 +176,11 @@ InputStream::InputStream (const std::string &abstract_path)
QByteArray data;
#if QT_VERSION >= 0x60000
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
if (res.compressionAlgorithm () == QResource::ZlibCompression) {
#else
if (res.isCompressed ()) {
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
if (res.isCompressed ()) {
#endif
data = qUncompress ((const unsigned char *)res.data (), (int)res.size ());
} else {
data = QByteArray ((const char *)res.data (), (int)res.size ());
}