Commit 488e2a65 authored by Christoffer Ackelman's avatar Christoffer Ackelman

QT: Removed old debug prints.

parent c25dd394
......@@ -85,7 +85,7 @@ int main(int argc, char* argv[])
viewer = new PnViewerQt("Profinet Viewer", dev_name, &sts);
} catch (co_error& e) {
printf("** Exception: %s\n", e.what().c_str());
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
// Create help window
......
......@@ -46,7 +46,6 @@
void tbl_close_cb(void* tbl)
{
debug_print("Shutting down...\n");
exit(0);
}
......@@ -77,7 +76,6 @@ int main(int argc, char* argv[])
sevcli_init(&sts, &sevcli);
if (EVEN(sts)) {
printf("Sev client init error %u\n", sts);
debug_print("Shutting down...\n");
exit(0);
}
......@@ -88,7 +86,6 @@ int main(int argc, char* argv[])
sevcli_get_itemlist(&sts, sevcli, &items, &itemcnt);
if (EVEN(sts)) {
printf("Sev client get itemlist error %u\n", sts);
debug_print("Shutting down...\n");
exit(0);
}
......
......@@ -57,7 +57,6 @@ void XttTblQt::message(char severity, const char* message)
void XttTblQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("XttTblQtWidget::closeEvent\n");
if (tbl->close_cb) {
(tbl->close_cb)(tbl);
} else {
......
......@@ -47,7 +47,6 @@ TblNavQt::TblNavQt(void* xn_parent_ctx, QWidget* xn_parent_wid,
pwr_tStatus* status)
: TblNav(xn_parent_ctx, xn_itemlist, xn_item_cnt, status)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget
= scrolledbrowwidgetqt_new(TblNav::init_brow_cb, this, &brow_widget);
......
......@@ -81,7 +81,6 @@ int main(int argc, char* argv[])
setDebug(1);
if (argc >= 2 && streq(argv[1], "-m")) {
wb_erep::printMethods();
debug_print("Shutting down...\n");
exit(0);
}
......@@ -321,8 +320,3 @@ WbQt::WbQt(int argc, char* argv[]) : mainwindow(0)
QTimer::singleShot(100, wow->object, SLOT(DisplayWarranty()));
}
}
WbQt::~WbQt()
{
debug_print("Shutting down...\n");
}
......@@ -47,8 +47,8 @@ public:
QWidget* mainwindow;
WbQt(int argc, char* argv[]);
~WbQt() {}
virtual ~WbQt();
Wtt* wtt_new(const char* name, const char* iconname, ldh_tWBContext wbctx,
pwr_tVolumeId volid, ldh_tVolume volctx, wnav_sStartMenu* root_menu,
pwr_tStatus* status);
......
......@@ -46,7 +46,6 @@ WbBckWNavQt::WbBckWNavQt(void* l_parent_ctx, QWidget* l_parent_wid,
ldh_tSession l_ldhses, wb_bck_list* l_list, int l_editmode, QWidget** w)
: WbBckWNav(l_parent_ctx, l_ldhses, l_list, l_editmode)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget
= scrolledbrowwidgetqt_new(WbBckWNav::init_brow_cb, this, &brow_widget);
......@@ -56,7 +55,6 @@ WbBckWNavQt::WbBckWNavQt(void* l_parent_ctx, QWidget* l_parent_wid,
WbBckWNavQt::~WbBckWNavQt()
{
debug_print("WbBckWNavQt::~WbBckWNavQt\n");
delete brow;
form_widget->close();
}
......
......@@ -46,7 +46,6 @@ WbExpWNavQt::WbExpWNavQt(void* l_parent_ctx, QWidget* l_parent_wid,
ldh_tSession l_ldhses, int l_type, int l_editmode, QWidget** w)
: WbExpWNav(l_parent_ctx, l_ldhses, l_type, l_editmode)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget
= scrolledbrowwidgetqt_new(WbExpWNav::init_brow_cb, this, &brow_widget);
......@@ -56,7 +55,6 @@ WbExpWNavQt::WbExpWNavQt(void* l_parent_ctx, QWidget* l_parent_wid,
WbExpWNavQt::~WbExpWNavQt()
{
debug_print("WbExpWNavQt::~WbExpWNavQt\n");
delete brow;
form_widget->close();
}
......
......@@ -158,7 +158,6 @@ void WGeQt::set_size(int width, int height)
void WGeQt::set_subwindow_release()
{
subwindow_release = 1;
debug_print("Shutting down...\n");
QApplication::exit();
}
......@@ -171,7 +170,6 @@ void WGeQtWidget::closeEvent(QCloseEvent* event)
{
if (ge->modal) {
ge->terminated = 1;
debug_print("Shutting down...\n");
QApplication::exit();
} else {
delete ge;
......
......@@ -2324,7 +2324,6 @@ WttQt::~WttQt()
delete toplevel;
if (!close_cb) {
debug_print("Shutting down...\n");
exit(0);
}
}
......
......@@ -99,7 +99,6 @@ void WCrrQt::print()
void WCrrQtWidget::closeEvent(QCloseEvent* event)
{
debug_print("WCrrQtWidget::closeEvent\n");
if (crr->close_cb) {
(crr->close_cb)(crr->parent_ctx, crr);
} else {
......@@ -118,7 +117,6 @@ WCrrQt::WCrrQt(QWidget* xa_parent_wid, void* xa_parent_ctx,
int* xa_sts)
: WCrr(xa_parent_ctx, xa_ldhses, xa_objar, xa_advanced_user, xa_sts)
{
debug_print("\n");
int sts;
char* namep;
int size;
......
......@@ -51,7 +51,6 @@ void close_cb(void* ctx, void* xhelp)
{
((CoXHelpQt*)xhelp)->toplevel->close();
delete help;
debug_print("Shutting down...\n");
exit(0);
}
......
......@@ -66,7 +66,7 @@ static void rtmon_close_cb(void* ctx)
{
delete rtmon;
delete xhelp;
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
int main(int argc, char* argv[])
......@@ -80,7 +80,7 @@ int main(int argc, char* argv[])
fprintf(stderr, "%s ", argv[i]);
if (streq(argv[i], "-h")) {
usage();
debug_print("\nShutting down...\n"); exit(0);
exit(0);
} else if (streq(argv[i], "--display") && i + 1 < argc) {
strncpy(display, argv[i + 1], sizeof(display));
}
......
......@@ -66,7 +66,7 @@ static void statusmon_close(void* ctx)
{
delete nl;
delete xhelp;
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
int main(int argc, char* argv[])
......@@ -82,14 +82,14 @@ int main(int argc, char* argv[])
fprintf(stderr, "%s ", argv[i]);
if (streq(argv[i], "-h")) {
usage();
debug_print("Shutting down...\n"); exit(0);
exit(0);
} else if (streq(argv[i], "-l") && i + 1 < argc) {
strncpy(language, argv[i + 1], sizeof(language));
Lng::set(language);
} else if (streq(argv[i], "-m")) {
if (argc == i) {
usage();
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
if (streq(argv[i + 1], "1")) {
mode = nodelist_eMode_Status1;
......@@ -103,7 +103,7 @@ int main(int argc, char* argv[])
mode = nodelist_eMode_Status5;
} else {
usage();
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
i++;
} else if (streq(argv[i], "-e")) {
......
......@@ -93,7 +93,7 @@ int main(int argc, char* argv[])
switch (argv[i][1]) {
case 'h':
XttCmd::usage();
debug_print("Shutting down...\n"); exit(0);
exit(0);
case 'q':
// Quiet
quiet = 1;
......@@ -121,7 +121,7 @@ int main(int argc, char* argv[])
sts = gdh_Init("rt_xtt_cmd");
if (EVEN(sts)) {
printf("Unable to connect to database\n");
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
QApplication app(argc, argv);
......
......@@ -96,7 +96,7 @@ int main(int argc, char* argv[])
if (streq(argv[i], "-l")) {
if (i + 1 >= argc) {
usage();
debug_print("Shutting down...\n"); exit(0);
exit(0);
}
Lng::set(argv[i + 1]);
i++;
......
......@@ -45,7 +45,6 @@ CoLogWNavQt::CoLogWNavQt(
void* l_parent_ctx, QWidget* l_parent_wid, int l_show_item, QWidget** w)
: CoLogWNav(l_parent_ctx, l_show_item)
{
debug_print("creating a scrolledbrowwidgetqt\n");
form_widget
= scrolledbrowwidgetqt_new(CoLogWNav::init_brow_cb, this, &brow_widget);
......@@ -55,7 +54,6 @@ CoLogWNavQt::CoLogWNavQt(
CoLogWNavQt::~CoLogWNavQt()
{
debug_print("CoLogWNavQt::~CoLogWNavQt\n");
delete brow;
form_widget->close();
}
......
......@@ -749,7 +749,6 @@ CoWowModalDialogQt::CoWowModalDialogQt(QWidget* parent, const char* title,
void CoWowModalDialogQt::destroy(bool destroyWindow, bool destroySubWindows)
{
debug_print("Not shutting down...\n");
setResult(wow_eModalDialogReturn_Deleted);
QDialog::destroy(destroyWindow, destroySubWindows);
}
......
......@@ -253,7 +253,6 @@ FlowDrawQt::FlowDrawQt(QWidget* x_toplevel, void** flow_ctx,
int FlowDrawQt::init_nav(QWidget* nav_widget, void* flow_ctx)
{
// debug_print("init_nav\n");
assert(dynamic_cast<QtScrollWidgetFlow*>(nav_widget) != NULL);
nav_window = dynamic_cast<QtScrollWidgetFlow*>(nav_widget);
nav_window_canvas = &(((QtScrollWidgetFlow*)nav_window)->image);
......@@ -288,8 +287,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
switch (event->type()) {
case QEvent::KeyPress: {
QKeyEvent* keyEvent = ((QKeyEvent*)event);
// debug_print("event_handler: KeyPress key=%s\n",
// QKeySequence(keyEvent->key()).toString().toAscii().data());
switch (keyEvent->key()) {
case Qt::Key_Return:
......@@ -353,9 +350,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
}
case QEvent::MouseButtonPress: {
QMouseEvent* mouseEvent = ((QMouseEvent*)event);
/* debug_print("event_handler: MouseButtonPress button=%d, x=%d, y=%d,
globalX=%d, globalY=%d\n", mouseEvent->button(), mouseEvent->x(),
mouseEvent->y(), mouseEvent->globalX(), mouseEvent->globalY()); */
switch (mouseEvent->button()) {
case Qt::LeftButton:
ctx->event_handler(
......@@ -430,7 +424,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
event_timer(ctx, mouseEvent, target);
return 1;
} else {
// debug_print("event_handler: MouseButtonPress from timer\n");
/* Press event, callback from timer */
button_pressed = 0;
button_clicked_and_pressed = 0;
......@@ -489,8 +482,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
}
case QEvent::MouseButtonRelease: {
QMouseEvent* mouseEvent = ((QMouseEvent*)event);
// debug_print("event_handler: MouseButtonRelease button=%d\n",
// mouseEvent->button());
button1_pressed = 0;
button2_pressed = 0;
button3_pressed = 0;
......@@ -734,7 +725,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
case QEvent::FocusOut:
break;
case QEvent::Wheel: {
// debug_print("event_handler: Wheel\n");
QWheelEvent* wheelEvent = ((QWheelEvent*)event);
if (wheelEvent->delta() > 0) {
sts = ctx->event_handler(flow_eEvent_ScrollUp, 0, 0, 0, 0);
......@@ -750,8 +740,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
switch (event->type()) {
case QEvent::MouseButtonPress: {
QMouseEvent* mouseEvent = ((QMouseEvent*)event);
// debug_print("event_handler: MouseButtonPress button=%d\n",
// mouseEvent->button());
switch (mouseEvent->button()) {
case Qt::LeftButton: // Button1
button1_pressed = 1;
......@@ -773,8 +761,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
}
case QEvent::MouseButtonRelease: {
QMouseEvent* mouseEvent = ((QMouseEvent*)event);
// debug_print("event_handler: MouseButtonRelease button=%d\n",
// mouseEvent->button());
switch (mouseEvent->button()) {
case Qt::LeftButton: // Button1
button1_pressed = 0;
......@@ -804,7 +790,6 @@ int FlowDrawQt::event_handler(FlowCtx* ctx, QEvent* event, QWidget* target)
break;
}
case QEvent::MouseMove: {
// debug_print("event_handler: MouseMove\n");
QPoint pos = QCursor::pos();
if (button1_pressed || button2_pressed || button3_pressed) {
sts = ctx->event_handler_nav(
......@@ -857,10 +842,8 @@ int FlowDrawQt::rect_helper(FlowCtx* ctx, int painter_type, int size, int x,
unique_ptr<QPainter> painter = get_painter(painter_type, size, nav);
if (fill) {
// debug_print("fillRect [%d, %d, %d, %d] painter_type=%d, with color %s\n", x, y, width, height, painter_type, qPrintable(painter->brush().color().name()));
painter->fillRect(x, y, width, height, painter->brush());
} else {
// debug_print("drawRect [%d, %d, %d, %d] pen %s brush %s\n", x, y, width, height, qPrintable(painter->pen().color().name()), qPrintable(painter->brush().color().name()));
painter->setBrush(Qt::NoBrush);
painter->drawRect(x, y, width, height);
}
......@@ -926,14 +909,10 @@ int FlowDrawQt::triangle_helper(FlowCtx* ctx, int painter_type, int size, int x,
poly[3] = QPoint(x, y + height);
if (fill) {
// debug_print("fillTriangle (%d, %d) (%d, %d) (%d, %d)\n", x, y + height, x
// + width / 2, y, x + width, y + height);
QPainterPath path;
path.addPolygon(poly);
painter->fillPath(path, painter->brush());
} else {
// debug_print("drawTriangle (%d, %d) (%d, %d) (%d, %d)\n", x, y + height, x
// + width / 2, y, x + width, y + height);
painter->setBrush(Qt::NoBrush);
painter->drawPolygon(poly);
}
......@@ -1008,7 +987,6 @@ int FlowDrawQt::arrow_helper(FlowCtx* ctx, int painter_type, int size, int x1,
QPainterPath path;
path.addPolygon(poly);
// debug_print("arrow (%d, %d) (%d, %d) (%d, %d)\n", x1, y1, x2, y2, x3, y3);
painter->fillPath(path, painter->brush());
return 1;
......@@ -1063,7 +1041,6 @@ int FlowDrawQt::arc_helper(FlowCtx* ctx, int painter_type, int size, int x,
unique_ptr<QPainter> painter = get_painter(painter_type, size, nav);
painter->setBrush(Qt::NoBrush);
// debug_print("arc [%d, %d, %d, %d], %d, %d\n", x, y, width, height, angle1, angle2);
painter->drawArc(x, y, width, height, angle1 * 16, angle2 * 16);
return 1;
......@@ -1122,7 +1099,6 @@ int FlowDrawQt::line_helper(FlowCtx* ctx, int painter_type, int size, int x1,
}
unique_ptr<QPainter> painter = get_painter(painter_type, size, nav);
// debug_print("line (%d, %d) (%d, %d)\n", x1, y1, x2, y2);
painter->drawLine(x1, y1, x2, y2);
return 1;
......@@ -1191,12 +1167,10 @@ int FlowDrawQt::text_pango_helper(FlowCtx* ctx, int x, int y, char* text,
int height = rect.height();
if (erase_rect > 0) {
// debug_print("eraseRect [%d,%d,%d,%d]\n", x, ROUND(y - 0.8 * height), rect.width() + 1, ROUND(height * (erase_rect / 10.0)));
painter->eraseRect(x, ROUND(y - 0.8 * height), rect.width() + 1, ROUND(height * (erase_rect / 10.0)));
}
if (erase_rect < 12) {
// debug_print("drawText %s at [%d,%d,%d,%d]\n", text, x, ROUND(y - 0.8 * height), rect.width(), height);
painter->drawText(x, ROUND(y - 0.8 * height), rect.width(), height, Qt::TextDontClip, str, &rect);
}
......@@ -1264,7 +1238,6 @@ int FlowDrawQt::nav_text_helper(FlowCtx* ctx, flow_eDrawType painter_type,
}
unique_ptr<QPainter> painter = get_painter(painter_type, size, true);
// debug_print("drawText %s at (%d, %d)\n", text, x, y);
painter->drawText(x, y, QString::fromLocal8Bit(text, len));
return 1;
......@@ -1360,9 +1333,6 @@ int FlowDrawQt::pixmap_inverse(FlowCtx* ctx, int x, int y,
{
unique_ptr<QPainter> painter = get_painter(flow_eDrawType_LineErase, idx);
// debug_print("pixmap_inverse fillRect [%d, %d, %d, %d] with color %s\n", x,
// y, pdata->width, pdata->height,
// painter->brush().color().name().toAscii().data());
painter->fillRect(x, y, pdata->width, pdata->height, painter->brush());
}
......@@ -1372,9 +1342,6 @@ int FlowDrawQt::pixmap_inverse(FlowCtx* ctx, int x, int y,
painter->setClipRegion(clipRegion.translated(x, y));
painter->setClipping(true);
// debug_print("pixmap_inverse fillRect [%d, %d, %d, %d] with color %s using
// mask\n", x, y, pdata->width, pdata->height,
// painter->brush().color().name().toAscii().data());
painter->fillRect(x, y, pdata->width, pdata->height, painter->brush());
return 1;
......@@ -1390,8 +1357,6 @@ int FlowDrawQt::pixmap_erase(FlowCtx* ctx, int x, int y,
}
unique_ptr<QPainter> painter = get_painter(painter_type, idx);
// debug_print("pixmap_erase [%d, %d, %d, %d]\n", x, y, pdata->width,
// pdata->height);
painter->eraseRect(x, y, pdata->width, pdata->height);
return 1;
......@@ -1411,8 +1376,6 @@ int FlowDrawQt::nav_pixmap(FlowCtx* ctx, int x, int y,
pms = (draw_sPixmap*)pixmaps;
unique_ptr<QPainter> painter = get_painter(painter_type, idx);
// debug_print("nav_pixmap [%d, %d, %d, %d]\n", x, y, pdata->width,
// pdata->height);
painter->drawPixmap(x, y, pdata->width, pdata->height, pms->pixmap[idx]);
return 1;
......@@ -1428,8 +1391,6 @@ int FlowDrawQt::nav_pixmap_erase(FlowCtx* ctx, int x, int y,
}
unique_ptr<QPainter> painter = get_painter(painter_type, idx);
// debug_print("nav_pixmap_erase [%d, %d, %d, %d]\n", x, y, pdata->width,
// pdata->height);
painter->eraseRect(x, y, pdata->width, pdata->height);
return 1;
......@@ -1467,7 +1428,6 @@ int FlowDrawQt::image(FlowCtx* ctx, int x, int y, int width, int height,
painter->setClipping(true);
}
// debug_print("image [%d, %d, %d, %d]\n", x, y, width, height);
painter->drawImage(QRect(x, y, width, height), *((QImage*)image));
return 1;
......@@ -1482,7 +1442,6 @@ void FlowDrawQt::clear(FlowCtx* ctx)
unique_ptr<QPainter> painter = new QPainter(window_canvas);
painter->setBackground(QBrush(background));
// debug_print("clear color=%s\n", painter->background().color().name().toAscii().data());
painter->eraseRect(window_canvas->rect());
}
......@@ -1495,7 +1454,6 @@ void FlowDrawQt::nav_clear(FlowCtx* ctx)
unique_ptr<QPainter> painter = new QPainter(nav_window_canvas);
painter->setBackground(QBrush(background));
// debug_print("nav_clear color=%s\n\n", painter->background().color().name().toAscii().data());
painter->eraseRect(nav_window_canvas->rect());
}
......@@ -1507,8 +1465,6 @@ void FlowDrawQt::get_window_size(FlowCtx* ctx, int* width, int* height)
void FlowDrawQt::get_nav_window_size(FlowCtx* ctx, int* width, int* height)
{
// debug_print("get_nav_window_size, nav_window == NULL ? %d\n", (nav_window
// == NULL));
*width = nav_window->width();
*height = nav_window->height();
}
......@@ -1654,8 +1610,6 @@ void FlowDrawQt::copy_area(FlowCtx* ctx, int x, int y)
return;
}
// debug_print("copy_area: x=%d, y=%d\n", x, y);
QPixmap screenShot = QPixmap::grabWidget(window);
unique_ptr<QPainter> painter = get_painter(flow_eDrawType_Line, 3);
if (x >= 0 && y >= 0) {
......@@ -1711,13 +1665,11 @@ void FlowDrawQt::clear_area(
unique_ptr<QPainter> painter = new QPainter(window_canvas);
painter->setBackground(QBrush(background));
// debug_print("clear_area [%d, %d, %d, %d], color=%s\n", ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, painter->background().color().name().toAscii().data());
painter->eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
}
void FlowDrawQt::set_inputfocus(FlowCtx* ctx)
{
// debug_print("set_inputfocus\n");
window->setFocus(Qt::OtherFocusReason);
}
......@@ -1730,8 +1682,6 @@ void FlowDrawQt::set_white_background(FlowCtx* ctx)
{
background = flow_allocate_color(this, "white");
// debug_print("set_white_background\n");
QPalette pal;
pal.setColor(QPalette::Background, background);
toplevel->setAutoFillBackground(true);
......@@ -1757,7 +1707,6 @@ void FlowDrawQt::image_scale(float scale, flow_tImImage orig_im,
if (*im) {
delete ((QImage*)*im);
}
// debug_print("image_scale\n");
*im = new QImage(((QImage*)orig_im)->scaled(width, height));
}
......@@ -1771,8 +1720,6 @@ int FlowDrawQt::image_load(const char* imagefile, float scale, float nav_scale,
strcpy(filename, imagefile);
// debug_print("image_load %s\n", imagefile);
// Look for file in $pwrp_exe, $pwr_doc/en_us/orm and $pwr_exe
for (int i = 0; i < 3; i++) {
switch (i) {
......
......@@ -906,10 +906,8 @@ int GlowDrawQt::rect_helper(GlowWind* wind, int painter_type, int size, int x,
}
if (fill) {
// debug_print("fillRect [%d, %d, %d, %d] painter_type=%d, with color %s\n", x, y, width, height, painter_type, qPrintable(painter->brush().color().name()));
painter->fillRect(x, y, width, height, painter->brush());
} else {
// debug_print("drawRect [%d, %d, %d, %d]\n", x, y, width, height);
painter->setBrush(Qt::NoBrush);
painter->drawRect(x, y, width, height);
}
......@@ -955,7 +953,6 @@ int GlowDrawQt::arrow_helper(GlowWind* wind, int painter_type, int size, int x1,
QPainterPath path;
path.addPolygon(poly);
// debug_print("arrow (%d, %d) (%d, %d) (%d, %d)\n", x1, y1, x2, y2, x3, y3);
painter->fillPath(path, painter->brush());
return 1;
......@@ -1008,10 +1005,8 @@ int GlowDrawQt::arc_helper(GlowWind* wind, int painter_type, int size, int x,
}
if (fill) {
// debug_print("pie [%d, %d, %d, %d], %d, %d\n", x, y, width, height, angle1, angle2);
painter->drawPie(x, y, width, height, angle1 * 16, angle2 * 16);
} else {
// debug_print("arc [%d, %d, %d, %d], %d, %d\n", x, y, width, height, angle1, angle2);
painter->setBrush(Qt::NoBrush);
painter->drawArc(x, y, width, height, angle1 * 16, angle2 * 16);
}
......@@ -1142,7 +1137,6 @@ int GlowDrawQt::line_helper(GlowWind* wind, int painter_type, int size, int x1,
painter->setPen(pen);
}
// debug_print("line (%d, %d) (%d, %d)\n", x1, y1, x2, y2);
painter->drawLine(x1, y1, x2, y2);
return 1;
......@@ -1207,7 +1201,6 @@ int GlowDrawQt::polyline_helper(GlowWind* wind, int painter_type, int size,
int cnt;
unique_ptr<QPoint[]> qpoints = points_to_qt_points_curve(wind, points, point_cnt, &cnt);
painter->setBrush(Qt::NoBrush);
// debug_print("polyline painter_type=%d, fill=%d, point_cnt=%d\n", painter_type, fill, point_cnt);
painter->drawPolyline(qpoints.get(), cnt);
}
......@@ -1278,7 +1271,6 @@ int GlowDrawQt::text(GlowWind* wind, int x, int y, char* text, int len,
QRect rect
= painter->fontMetrics().boundingRect(QString::fromLocal8Bit(text, len));
// debug_print("text %s on %d,%d\n", text, x, y);
painter->drawText(x, y, rect.width(), rect.height(), Qt::TextDontClip,
QString::fromLocal8Bit(text, len));
......@@ -1310,7 +1302,6 @@ int GlowDrawQt::text_cursor(GlowWind* wind, int x, int y, char* text, int len,
set_clip(w, painter);
}
// debug_print("cursor %d,%d to %d,%d\n", x + width, y + descent, x + width, y - height + descent);
painter->drawLine(x + width, y + descent, x + width, y - height + descent);
return 1;
......@@ -1352,7 +1343,6 @@ int GlowDrawQt::text_erase(GlowWind* wind, int x, int y, char* text, int len,
QRect rect
= painter->fontMetrics().boundingRect(QString::fromLocal8Bit(text, len));
// debug_print("textErase %s on %d,%d\n", text, x, y);
painter->drawText(x, y, rect.width(), rect.height(), Qt::TextDontClip,
QString::fromLocal8Bit(text, len));
......@@ -1410,7 +1400,6 @@ int GlowDrawQt::image_helper(GlowWind* wind, int x, int y, int width,
set_clip(w, painter);
}
// debug_print("image [%d, %d, %d, %d]\n", x, y, width, height);
if (d) {
painter->drawImage(QPoint(x, y), *((QImage*)image));
} else {
......@@ -1637,8 +1626,6 @@ void GlowDrawQt::copy_area(GlowWind* wind, int x, int y)
window_height = ctx->navw.window_height;
}
// debug_print("copy_area [%d, %d, %d, %d]\n", x, y, window_width, window_height);
unique_ptr<QPainter> painterBuffer
= get_painter(w->buffer, this, glow_eDrawType_Line, 3);
if (x >= 0 && y >= 0) {
......@@ -1691,8 +1678,6 @@ void GlowDrawQt::clear_area(
unique_ptr<QPainter> painter = new QPainter(w->buffer);
painter->setBackground(QBrush(background));
// debug_print("clear_area [%d, %d, %d, %d], color=%s\n", ll_x, ll_y, ur_x - ll_x, ur_y - ll_y, qPrintable(painter->background().color().name()));
painter->eraseRect(ll_x, ll_y, ur_x - ll_x, ur_y - ll_y);
}
......@@ -1780,8 +1765,6 @@ void GlowDrawQt::set_background(GlowWind* wind, glow_eDrawType drawtype,
delete w->background_pixmap;
}
// debug_print("set_background\n");
w->background_pixmap = new QPixmap(QPixmap::fromImage(*((QImage*)image)));
w->background_pixmap_width = pixmap_width;
w->background_pixmap_height = pixmap_height;
......@@ -2256,8 +2239,6 @@ void GlowDrawQt::image_copy(glow_tImImage orig_image, glow_tImImage* image)
delete ((QImage*)*image);
}
// debug_print("image_copy\n");
*image = new QImage(((QImage*)orig_image)->copy());
}
......@@ -2269,8 +2250,6 @@ void GlowDrawQt::image_rotate(
QTransform trans;
trans.rotate(drot);
// debug_print("image_rotate\n");
QImage* im = new QImage(((QImage*)*image)->transformed(trans));
delete ((QImage*)*image);
*image = (glow_tImImage)im;
......@@ -2278,8 +2257,6 @@ void GlowDrawQt::image_rotate(
void GlowDrawQt::image_flip_vertical(glow_tImImage* image)
{
// debug_print("image_flip_vertical\n");
QImage* im = new QImage(((QImage*)*image)->mirrored());
delete ((QImage*)*image);
*image = (glow_tImImage)im;
......@@ -2287,8 +2264,6 @@ void GlowDrawQt::image_flip_vertical(glow_tImImage* image)
void GlowDrawQt::image_flip_horizontal(glow_tImImage* image)
{
// debug_print("image_flip_horizontal\n");
QImage* im = new QImage(((QImage*)*image)->mirrored(true, false));
delete ((QImage*)*image);
*image = (glow_tImImage)im;
......@@ -2298,8 +2273,6 @@ int GlowDrawQt::image_scale(int width, int height, glow_tImImage orig_im,
glow_tImImage* im, glow_tImData* im_data, glow_tPixmap* im_pixmap,
glow_tPixmap* im_mask)
{
// debug_print("image_scale\n");
if (width == ((QImage*)*im)->width() && height == ((QImage*)*im)->height()) {
return 0;
}
......@@ -2372,8 +2345,6 @@ void GlowDrawQt::image_pixel_iter(glow_tImImage orig_image,
int rgb_width;
int rowstride;
// debug_print("image_pixel_iter\n");
if (orig_image) {
if (image && *image != orig_image) {
delete ((QImage*)*image);
......@@ -2984,7 +2955,6 @@ int GlowDrawQt::text_qt(GlowWind* wind, int x, int y, char* text, int len,
px = x;
py = (int)(y - (1.0 - FONT_DESCENT) * height);
}
// debug_print("textQt %s on %d,%d with color %s, painter_type=%d, color=%d\n", text, px, py, qPrintable(painter->pen().color().name()), painter_type, color);
painter->drawText(px, py, rect.width(), rect.height(), Qt::TextDontClip, str);
return 1;
......@@ -3053,7 +3023,6 @@ int GlowDrawQt::text_erase_qt(GlowWind* wind, int x, int y, char* text, int len,
set_clip(w, painter);
}
// debug_print("textEraseQt %s on %d,%d\n", text, px, py);
painter->fillRect(px, py, pw, ph, painter->brush());
return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment