понеділок, 6 жовтня 2014 р.

Introducing QLogTimeliner

I have a made another helper app QLogTimeliner

From time to time I need to analyse our application logs. We have very big logs 10-20Mb in average. Concurrent events spread all over the file. Most of the time it is impossible to guess what is going on due to lot of different normal and abnormal errors.  Hard to find when app changes it's state.


So I've made this:


It is simple app which visualise events from log file on a timeline. Much like network tool in Google Chrome and Firebug do.
As each application has it's own log format developer should define set of rules using action script.
The only purpose of this script is to translate input log string to array of events with timestamp and other attributes.

[
  { 
    timestamp: "10.10.2014",
     series: "events in row 5",
     line: "original log line",
     relation: "events which are part of `duration` has an id of this process"
     position: "Restriction for placement this event in duration" // [Begin, End, Mid]
  }, 
 ...
]

Application only groups this events in to series'es  and merges individual events into durations.




вівторок, 18 вересня 2012 р.

Перепрофілювання

У зв’язку з тим що поточні проекти не дають можливості повноцінно займатися С++ та Qt буду писати про роботів.

понеділок, 5 вересня 2011 р.

Як швидко зобразити видимість прозорого кольору у вашому Qt image viewer


Необхідність вигадати цей велосипед виникла коли я вирішив додати блиску для власної утиліти що спрощує процес вирізання окремих текстур з cut images.
Виявляється алгоритм побудови такого зображення є дуже простим.


void ImageWidget::paintEvent( QPaintEvent * event )
{
    QPainter painter(this);

    const QRect area = event->rect();
    const int square = 8;
    int x = (area.left()%square)*square;
    int y = (area.top()%square)*square;
    while (y < area.bottom()) {
        x = 0;
        while (x < area.right()) {
            const QColor fill = ((x+y)/square)%2?Qt::gray:Qt::lightGray;
            painter.fillRect(x, y, square, square, fill);

            x += square;
        }
        y += square;
    }
}

По моєму вийшло досить лаконічно і дуже непогано.

Попередження: в реальних проектах де потрібно дотримуватися мінливих вимог дизайнерів краще використати QPainter::fillRect( ,QBrush(QPixmap));