Tomboy Notes di Unity Sebagai Ganti KNotes di KDE

Bismillahirrahmanirrahim.

Setelah masalah driver VGA saya terselesaikan kemarin, saya pakai Unity sampai hari ini. Mengapa? Karena drop shadow-nya yang keren itu. Sekarang, saya butuh pengganti KNotes di Unity. Saya sudah mencoba instal beberapa paket notes tetapi yang saya pilih akhirnya Tomboy. Hampir sama dengan KNotes, ia bisa bertengger di system tray dan bisa menampilkan pilihan-pilihan notes yang sudah dibuat dalam context menu. Itu yang saya cari.

Selection_017

Selection_018

Selection_019

Mem-backup History dan Bookmarks Punya Chromium di Linux

Bismillahirrahmanirrahim.

Ternyata, untuk mem-backup history, download history, bookmarks, bahkan extensions sekaligus, Anda tidak perlu menggunakan utility aneh-aneh. Cukup salin saja folder Defaults dari ~/.config/chromium/ Anda. Hancurkan saja Chromium Anda sehancur-hancurnya. Setelah folder ini dikembalikan pada tempatnya dan dikembalikan namanya jadi Default, maka Chromium akan kembali seperti sediakala sebelum Anda rusak. Bahkan ekstensinya pun semua bisa digunakan kembali.

chromium

chromium1

chromium2

Openbox, tint2, dan conky

Bismillahirrahmanirahim.

  1. Window Manager: Openbox
  2. Panel Taskbar: tint2
  3. Terminal: rxvt-unicode
  4. Panel Atas: conky
  5. Wallpaper: feh

openbox-tint2-conky1

openbox-tint2-conky7

openbox-tint2-conky8

otodidak-openbox-wallpaper

~/.config/tint2/text_only_3.tint2rc

openbox-tint2-conky5

# Tint2 config file
# Generated by tintwizard (http://code.google.com/p/tintwizard/)
# For information on manually configuring tint2 see http://code.google.com/p/tint2/wiki/Configure

# Background definitions
# ID 1
rounded = 1
border_width = 0
#background_color = #FF0000 100
background_color = #282828 100
border_color = #000000 0

# ID 2
rounded = 1
border_width = 0
background_color = #F6B655 86
border_color = #CCCCCC 40

# Panel
panel_monitor = all
panel_position = bottom center horizontal
panel_size = 100% 18
panel_margin = 0 0
panel_padding = 0 0 0
panel_dock = 0
wm_menu = 1
panel_layer = top
panel_background_id = 1

# Panel Autohide
autohide = 0
autohide_show_timeout = 0.0
autohide_hide_timeout = 0.0
autohide_height = 22
strut_policy = minimum

# Taskbar
taskbar_mode = single_desktop
taskbar_padding = 0 0 0
taskbar_background_id = 0
#taskbar_active_background_id = 0

# Tasks
urgent_nb_of_blink = 7
task_icon = 0
task_text = 1
task_centered = 1
task_maximum_size = 200 32
task_padding = 5 0
task_background_id = 0
task_active_background_id = 2
task_urgent_background_id = 2
task_iconified_background_id = 0

# Task Icons
task_icon_asb = 100 0 0
task_active_icon_asb = 100 0 0
task_urgent_icon_asb = 100 0 0
task_iconified_icon_asb = 100 0 0

# Fonts
task_font = sans 7.5
task_font_color = #FFFFFF 60
task_active_font_color = #000000 100
task_urgent_font_color = #000000 100
task_iconified_font_color = #FFFFFF 60
font_shadow = 0

# System Tray
systray = 1
systray_padding = 3 0 3
systray_sort = ascending
systray_background_id = 0
systray_icon_size = 14
systray_icon_asb = 100 -90 -15

# Clock
time1_format = %H:%M
time1_font = sans 13
clock_font_color = #FFFFFF 86
clock_padding = 2 0
clock_background_id = 0

# Tooltips
tooltip = 0
tooltip_padding = 2 2
tooltip_show_timeout = 0.5
tooltip_hide_timeout = 1.2
tooltip_background_id = 1
tooltip_font = Sans 9
tooltip_font_color = #FFFFFF 100

# Mouse
mouse_middle = none
mouse_right = none
mouse_scroll_up = toggle
mouse_scroll_down = iconify

# Battery
battery = 1
battery_low_status = 7
battery_low_cmd = notify-send "battery low"
battery_hide = 90
bat1_font = sans 7
bat2_font = sans 6
battery_font_color = #FFFFFF 100
battery_padding = 2 0
battery_background_id = 0

#spesial
wm_menu = 1

# End of config

~/.conkyrc

openbox-tint2-conky4

#avoid flicker
double_buffer yes

#own window to run simultanious 2 or more conkys
own_window  yes
own_window_transparent no
own_window_type normal
own_window_hints undecorate,sticky,skip_taskbar,skip_pager 

#borders
draw_borders no
border_margin 3

#shades
draw_shades no

#position
gap_x 150
gap_y 4
alignment top_left

#behaviour
update_interval 1

#colour
#default_color  8f8f8f
default_color orange
#default_shade_color 000000
own_window_colour 262729

#font
use_xft yes
xftfont ubuntu-narrow:size=7

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

#to prevent window from moving
use_spacer none
minimum_size 1024 0

#mpd
#mpd_host localhost
#mpd_port 6600

TEXT
${alignc} DATE: ${color e0e0e0}${time %d/%m/%y}${color}  TIME: ${color e0e0e0}${time %H:%M}${color}  |  \
KERNEL: ${color e0e0e0}$kernel${color}  \
UPTIME: ${color e0e0e0}${uptime_short}${color}  |  \
CPU: ${color e0e0e0}${cpu}%${color} ${color e0e0e0}${cpubar 5, 50}${color}   \
RAM: ${color e0e0e0}${memperc}%${color} ${color e0e0e0}${membar 5, 50}${color}   \
SWAP: ${color e0e0e0}${swapperc}%${color}   ${color e0e0e0}${membar 5, 50}${color}   \
DISK: ${color e0e0e0}${fs_used_perc /}%${color}  ${color e0e0e0}${fs_bar 5, 50 /}${color}    |  \
${if_existing /proc/net/route wlan0}SIGNAL: ${color e0e0e0}${wireless_link_qual wlan0}%${color}   ${color e0e0e0}${wireless_link_bar 5, 50 wlan0}${color}   \
UP: ${color e0e0e0}${upspeedf wlan0} KB/s${color}  \
DOWN: ${color e0e0e0}${downspeedf wlan0} KB/s${color}${else}${if_existing /proc/net/route eth0}UP: ${color e0e0e0}${upspeedf eth0} KB/s${color}  \
Down: ${color e0e0e0}${downspeed eth0} KB/s \
${color}${endif}${else}Network Unavailable${endif}${alignc}

~/.Xdefaults

openbox-tint2-conky6

URxvt.termName: rxvt
URxvt.transparent: true
URxvt.inheritPixmap: False
URxvt.imLocale: pl_PL.UTF-8
URxvt.scrollBar: false
URxvt.saveLines: 100500
URxvt.urlLauncher: firefox
URxvt.cursorBlink: true
URxvt.geometry: 80x10
URxvt.fading: 25%
urxvt.font: xft: Dejavu Sans Mono:autohint=true:antialias=true:size=7
urxvt.boldFont: xft:Ubuntu:bold:pixelsize=7
URxvt*background: #303030
urxvt.depth: 32
urxvt.background: rgba:0000/0000/0000/bbbb
URxvt.foreground: grey80
URxvt.tintColor: #262626
URxvt.borderLess: true
URxvt.borderColor: #888888

*foreground: rgba:0000/0000/0000/dddd
*background: rgb:10/10/10
!black
*color0: rgb:20/20/20
*color8: rgb:75/77/73
!red
*color1: rgb:cc/00/00
*color9: rgb:ef/29/29
!green
*color2: rgb:4e/9a/06
*color10: rgb:8a/e2/34
!brown/yellow
*color3: rgb:c4/a0/00
*color11: rgb:fc/e9/4f
!blue
*color4: rgb:34/65/a4
*color12: rgb:72/9f/cf
!magenta
*color5: rgb:75/50/7b
*color13: rgb:ad/7f/a8
!cyan
*color6: rgb:06/98/9a
*color14: rgb:34/e2/e2
!white
*color7: rgb:d3/d7/cf
*color15: rgb:ee/ee/ec

Akhirnya, Realtime Data Plotting di Linux dengan Qt + QCustomPlot!

Bismillahirrahmanirrahim.

Ini adalah posting bleeding edge untuk posting Pemrograman Qt di blog utama nanti. Saya senang sekali. Dua tahun lalu saya merasa bingung dengan pengganti di Linux untuk TeeChart di Windows. Saat ini, alhamdulillah saya peroleh ganti yang free software sekaligus gratis dan di Linux pula. Nama pustaka plotting ini adalah QCustomPlot. Pustaka ini sangatlah sederhana, hanya butuh 2 berkas (satu .cpp dan satu .h) ditambahkan ke dalam proyek Qt Creator dan plotting sudah bisa dilakukan. Pustaka ini juga menyediakan contoh-contoh yang banyak untuk berbagai macam grafik (baik realtime ataupun tidak). Lihatlah hasil plot berikut.

resized_output

Asal Muasal

Saya sengaja mencari pustaka pengganti TeeChart, yakni pustaka plotting yang mampu membuat grafik dinamis realtime. Pustaka itu harus bisa digunakan di Linux. Pustaka itu harus cross platform, dalam arti tidak hanya bisa dipakai di Microsoft Visual Studio saja. Pustaka itu harus memiliki binding C++ (bukan Python). Dan pustaka itu haruslah memiliki sintaks plotting yang pendek dan sederhana. Awalnya, saya menemukan Qwt dan telah saya tuliskan artikelnya di sini. Namun, saya merasa Qwt itu kompleks dan sangat panjang. Akhirnya kemarin saya mencoba QCustomPlot dan memodifikasi kode sumber contohnya. Alhamdulillah, yang saya inginkan selama ini akhirnya saya temukan.

Komentar

Karena ini asalnya adalah karya orang lain, maka wajar jika banyak komentar berbahasa Inggris masih tersisa di sini. Saya juga tidak menghapus bagian lisensinya. Saya harap saya bisa mengolahnya jadi posting saya sendiri nanti. Gambar GIF di atas saya produksi dari screencast (MP4) yang saya konversikan ke GIF dengan ffmpeg.

Kode

mainwindow.h

/***************************************************************************
**                                                                        **
**  QCustomPlot, an easy to use, modern plotting widget for Qt            **
**  Copyright (C) 2011, 2012, 2013, 2014 Emanuel Eichhammer               **
**                                                                        **
**  This program is free software: you can redistribute it and/or modify  **
**  it under the terms of the GNU General Public License as published by  **
**  the Free Software Foundation, either version 3 of the License, or     **
**  (at your option) any later version.                                   **
**                                                                        **
**  This program is distributed in the hope that it will be useful,       **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of        **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         **
**  GNU General Public License for more details.                          **
**                                                                        **
**  You should have received a copy of the GNU General Public License     **
**  along with this program.  If not, see http://www.gnu.org/licenses/.   **
**                                                                        **
****************************************************************************
**           Author: Emanuel Eichhammer                                   **
**  Website/Contact: http://www.qcustomplot.com/                          **
**             Date: 07.04.14                                             **
**          Version: 1.2.1                                                **
****************************************************************************/

/************************************************************************************************************
**                                                                                                         **
**  This is the example code for QCustomPlot.                                                              **
**                                                                                                         **
**  It demonstrates basic and some advanced capabilities of the widget. The interesting code is inside     **
**  the "setup(...)Demo" functions of MainWindow.                                                          **
**                                                                                                         **
**  In order to see a demo in action, call the respective "setup(...)Demo" function inside the             **
**  MainWindow constructor. Alternatively you may call setupDemo(i) where i is the index of the demo       **
**  you want (for those, see MainWindow constructor comments). All other functions here are merely a       **
**  way to easily create screenshots of all demos for the website. I.e. a timer is set to successively     **
**  setup all the demos and make a screenshot of the window area and save it in the ./screenshots          **
**  directory.                                                                                             **
**                                                                                                         **
*************************************************************************************************************/

#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include "qcustomplot.h" // the header file of QCustomPlot. Don't forget to add it to your project, if you use an IDE, so it gets compiled.
#include <QtGui>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
  Q_OBJECT

public:
  explicit MainWindow(QWidget *parent = 0);
  ~MainWindow();

  void setupDemo(int demoIndex);
  void setupQuadraticDemo(QCustomPlot *customPlot);
  void setupSimpleDemo(QCustomPlot *customPlot);
  void setupSincScatterDemo(QCustomPlot *customPlot);
  void setupScatterStyleDemo(QCustomPlot *customPlot);
  void setupLineStyleDemo(QCustomPlot *customPlot);
  void setupScatterPixmapDemo(QCustomPlot *customPlot);
  void setupDateDemo(QCustomPlot *customPlot);
  void setupTextureBrushDemo(QCustomPlot *customPlot);
  void setupMultiAxisDemo(QCustomPlot *customPlot);
  void setupLogarithmicDemo(QCustomPlot *customPlot);
  void setupRealtimeDataDemo(QCustomPlot *customPlot);
  void setupParametricCurveDemo(QCustomPlot *customPlot);
  void setupBarChartDemo(QCustomPlot *customPlot);
  void setupStatisticalDemo(QCustomPlot *customPlot);
  void setupSimpleItemDemo(QCustomPlot *customPlot);
  void setupItemDemo(QCustomPlot *customPlot);
  void setupStyledDemo(QCustomPlot *customPlot);
  void setupAdvancedAxesDemo(QCustomPlot *customPlot);
  void setupColorMapDemo(QCustomPlot *customPlot);

  void setupPlayground(QCustomPlot *customPlot);

private slots:
  void realtimeDataSlot();
  void bracketDataSlot();
  void screenShot();
  void allScreenShots();
  void jajalenIki();

private:
  Ui::MainWindow *ui;
  QCustomPlot *customPlot;      // iki pancen kudu ditulis
  QVBoxLayout *verticalLayout;
  QWidget     *widgetUtama;
  QStatusBar  *statusBar;

  QString demoName;
  QTimer dataTimer;
  QCPItemTracer *itemDemoPhaseTracer;
  int currentDemoIndex;
};

#endif // MAINWINDOW_H

mainwindow.cpp

/***************************************************************************
**                                                                        **
**  QCustomPlot, an easy to use, modern plotting widget for Qt            **
**  Copyright (C) 2011, 2012, 2013, 2014 Emanuel Eichhammer               **
**                                                                        **
**  This program is free software: you can redistribute it and/or modify  **
**  it under the terms of the GNU General Public License as published by  **
**  the Free Software Foundation, either version 3 of the License, or     **
**  (at your option) any later version.                                   **
**                                                                        **
**  This program is distributed in the hope that it will be useful,       **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of        **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         **
**  GNU General Public License for more details.                          **
**                                                                        **
**  You should have received a copy of the GNU General Public License     **
**  along with this program.  If not, see http://www.gnu.org/licenses/.   **
**                                                                        **
****************************************************************************
**           Author: Emanuel Eichhammer                                   **
**  Website/Contact: http://www.qcustomplot.com/                          **
**             Date: 07.04.14                                             **
**          Version: 1.2.1                                                **
****************************************************************************/

/************************************************************************************************************
**                                                                                                         **
**  This is the example code for QCustomPlot.                                                              **
**                                                                                                         **
**  It demonstrates basic and some advanced capabilities of the widget. The interesting code is inside     **
**  the "setup(...)Demo" functions of MainWindow.                                                          **
**                                                                                                         **
**  In order to see a demo in action, call the respective "setup(...)Demo" function inside the             **
**  MainWindow constructor. Alternatively you may call setupDemo(i) where i is the index of the demo       **
**  you want (for those, see MainWindow constructor comments). All other functions here are merely a       **
**  way to easily create screenshots of all demos for the website. I.e. a timer is set to successively     **
**  setup all the demos and make a screenshot of the window area and save it in the ./screenshots          **
**  directory.                                                                                             **
**                                                                                                         **
*************************************************************************************************************/

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QDesktopWidget>
#include <QScreen>
#include <QMessageBox>
#include <QMetaEnum>

MainWindow::MainWindow(QWidget *parent) :
  QMainWindow(parent),
  ui(new Ui::MainWindow)
{
  customPlot         =   new     QCustomPlot();
  statusBar          =   new     QStatusBar(this);

  // sebaris kode ini adalah pemasangan status bar kepada QMainWindow
  // ini lebih baik daripada bersusah payah membuat layout lalu memasang sendiri status bar secara manual
  // namun hasilnya status bar tampak terlalu luas dan tidak bisa dikecilkan
  // justru sebaris kode sederhana ini melakukan pemasangan dengan sempurna
  // ditulis pada Thursday, July 03, 2014 11:47 PM
  this->setStatusBar(statusBar);

  // ternyata memang saya harus membuat satu fungsi terpisah dari konstruktor MainWindow
  // biarlah customPlot dideklarasikan ulang di dalam MainWindow, sedangkan objek lain dideklarasikan di dalam fungsi jajalenIki
  // ditulis pada Thursday, July 03, 2014 11:48 PM
  jajalenIki();
}

void MainWindow::jajalenIki()
{
    QGridLayout   *verticalLayout     =   new     QGridLayout;
    QWidget       *widgetUtama        =   new     QWidget;

    customPlot->setGeometry(1,1,300,100);
//    statusBar->setGeometry(0,0,300,10);

    verticalLayout->addWidget(customPlot, 1,1,4,3);
//    verticalLayout->addWidget(statusBar, 5,1,1,1);

    widgetUtama->setLayout(verticalLayout);
    this->setCentralWidget(widgetUtama);
    setGeometry(400, 250, 542, 390);

    setupDemo(10);
}

void MainWindow::setupDemo(int demoIndex)
{
  switch (demoIndex)
  {
    case 10: setupRealtimeDataDemo(this->customPlot); break;
  }

  setWindowTitle("QCustomPlot: "+demoName);
//  statusBar->clearMessage();
  currentDemoIndex = demoIndex;
  this->customPlot->replot();
}

// 10

void MainWindow::setupRealtimeDataDemo(QCustomPlot *customPlot)
{
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
  QMessageBox::critical(this, "", "You're using Qt < 4.7, the realtime data demo needs functions that are available with Qt 4.7 to work properly");
#endif
  demoName = "Real Time Data Demo";

  // include this section to fully disable antialiasing for higher performance:
  /*
  customPlot->setNotAntialiasedElements(QCP::aeAll);
  QFont font;
  font.setStyleStrategy(QFont::NoAntialias);
  customPlot->xAxis->setTickLabelFont(font);
  customPlot->yAxis->setTickLabelFont(font);
  customPlot->legend->setFont(font);
  */
  customPlot->addGraph(); // blue line
  customPlot->graph(0)->setPen(QPen(Qt::magenta));
  customPlot->graph(0)->setBrush(QBrush(QColor(240, 255, 200)));
  customPlot->graph(0)->setAntialiasedFill(false);
  customPlot->addGraph(); // red line
  customPlot->graph(1)->setPen(QPen(Qt::gray));
  customPlot->graph(0)->setChannelFillGraph(customPlot->graph(1));

  customPlot->addGraph(); // blue dot
  customPlot->graph(2)->setPen(QPen(Qt::cyan));
  customPlot->graph(2)->setLineStyle(QCPGraph::lsNone);
  customPlot->graph(2)->setScatterStyle(QCPScatterStyle::ssDisc);
  customPlot->addGraph(); // red dot
  customPlot->graph(3)->setPen(QPen(Qt::yellow));
  customPlot->graph(3)->setLineStyle(QCPGraph::lsNone);
  customPlot->graph(3)->setScatterStyle(QCPScatterStyle::ssDisc);

  customPlot->xAxis->setTickLabelType(QCPAxis::ltDateTime);
  customPlot->xAxis->setDateTimeFormat("hh:mm:ss");
  customPlot->xAxis->setAutoTickStep(true);
  customPlot->xAxis->setTickStep(2);
  customPlot->axisRect()->setupFullAxesBox();

  // make left and bottom axes transfer their ranges to right and top axes:
  connect(customPlot->xAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->xAxis2, SLOT(setRange(QCPRange)));
  connect(customPlot->yAxis, SIGNAL(rangeChanged(QCPRange)), customPlot->yAxis2, SLOT(setRange(QCPRange)));

  // setup a timer that repeatedly calls MainWindow::realtimeDataSlot:
  connect(&dataTimer, SIGNAL(timeout()), this, SLOT(realtimeDataSlot()));
  dataTimer.start(0); // Interval 0 means to refresh as fast as possible
}

// fungsi khusus realtimeDataSlot
// inilah sumber data sinus dan cosinus untuk plotter

void MainWindow::realtimeDataSlot()
{
  // calculate two new data points:
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
  double key = 0;
#else
  double key = QDateTime::currentDateTime().toMSecsSinceEpoch()/1000.0;
#endif
  static double lastPointKey = 0;
  if (key-lastPointKey > 0.01) // at most add point every 10 ms
  {
    double value0 = qSin(key); //sin(key*1.6+cos(key*1.7)*2)*10 + sin(key*1.2+0.56)*20 + 26;
    double value1 = qCos(key); //sin(key*1.3+cos(key*1.2)*1.2)*7 + sin(key*0.9+0.26)*24 + 26;
    // add data to lines:
    this->customPlot->graph(0)->addData(key, value0);
    this->customPlot->graph(1)->addData(key, value1);
    // set data of dots:
    this->customPlot->graph(2)->clearData();
    this->customPlot->graph(2)->addData(key, value0);
    this->customPlot->graph(3)->clearData();
    this->customPlot->graph(3)->addData(key, value1);
    // remove data of lines that's outside visible range:
    this->customPlot->graph(0)->removeDataBefore(key-8);
    this->customPlot->graph(1)->removeDataBefore(key-8);
    // rescale value (vertical) axis to fit the current data:
    this->customPlot->graph(0)->rescaleValueAxis();
    this->customPlot->graph(1)->rescaleValueAxis(true);
    lastPointKey = key;
  }
  // make key axis range scroll with the data (at a constant range size of 8):
  this->customPlot->xAxis->setRange(key+0.25, 8, Qt::AlignRight);
  this->customPlot->replot();

  // calculate frames per second:
  static double lastFpsKey;
  static int frameCount;
  ++frameCount;
  if (key-lastFpsKey > 2) // average fps over 2 seconds
  {
    this->statusBar->showMessage(
          QString("%1 FPS, Total Data points: %2")
          .arg(frameCount/(key-lastFpsKey), 0, 'f', 0)
          .arg(this->customPlot->graph(0)->data()->count()+this->customPlot->graph(1)->data()->count())
          , 0);
    lastFpsKey = key;
    frameCount = 0;
  }
}


// fungsi khusus bracketDataSlot

void MainWindow::bracketDataSlot()
{
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
  double secs = 0;
#else
  double secs = QDateTime::currentDateTime().toMSecsSinceEpoch()/1000.0;
#endif

  // update data to make phase move:
  int n = 500;
  double phase = secs*5;
  double k = 3;
  QVector<double> x(n), y(n);
  for (int i=0; i<n; ++i)
  {
    x[i] = i/(double)(n-1)*34 - 17;
    y[i] = qExp(-x[i]*x[i]/20.0)*qSin(k*x[i]+phase);
  }
  this->customPlot->graph()->setData(x, y);

  itemDemoPhaseTracer->setGraphKey((8*M_PI+fmod(M_PI*1.5-phase, 6*M_PI))/k);

  this->customPlot->replot();

  // calculate frames per second:
  double key = secs;
  static double lastFpsKey;
  static int frameCount;
  ++frameCount;
  if (key-lastFpsKey > 2) // average fps over 2 seconds
  {
    this->statusBar->showMessage(
          QString("%1 FPS, Total Data points: %2")
          .arg(frameCount/(key-lastFpsKey), 0, 'f', 0)
          .arg(this->customPlot->graph(0)->data()->count())
          , 0);
    lastFpsKey = key;
    frameCount = 0;
  }
}

MainWindow::~MainWindow()
{
  delete ui;
}

// fungsi khusus screenShot

void MainWindow::screenShot()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
  QPixmap pm = QPixmap::grabWindow(qApp->desktop()->winId(), this->x()+2, this->y()+2, this->frameGeometry().width()-4, this->frameGeometry().height()-4);
#else
  QPixmap pm = qApp->primaryScreen()->grabWindow(qApp->desktop()->winId(), this->x()+2, this->y()+2, this->frameGeometry().width()-4, this->frameGeometry().height()-4);
#endif
  QString fileName = demoName.toLower()+".png";
  fileName.replace(" ", "");
  pm.save("./screenshots/"+fileName);
  qApp->quit();
}

// fungsi khusus allScreenShots

void MainWindow::allScreenShots()
{
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
  QPixmap pm = QPixmap::grabWindow(qApp->desktop()->winId(), this->x()+2, this->y()+2, this->frameGeometry().width()-4, this->frameGeometry().height()-4);
#else
  QPixmap pm = qApp->primaryScreen()->grabWindow(qApp->desktop()->winId(), this->x()+2, this->y()+2, this->frameGeometry().width()-4, this->frameGeometry().height()-4);
#endif
  QString fileName = demoName.toLower()+".png";
  fileName.replace(" ", "");
  pm.save("./screenshots/"+fileName);

  if (currentDemoIndex < 18)
  {
    if (dataTimer.isActive())
      dataTimer.stop();
    dataTimer.disconnect();
    delete this->customPlot;
    this->customPlot = new QCustomPlot(ui->centralWidget);
    this->verticalLayout->addWidget(this->customPlot);
    setupDemo(currentDemoIndex+1);
    // setup delay for demos that need time to develop proper look:
    int delay = 250;
    if (currentDemoIndex == 10) // Next is Realtime data demo
      delay = 12000;
    else if (currentDemoIndex == 15) // Next is Item demo
      delay = 5000;
    QTimer::singleShot(delay, this, SLOT(allScreenShots()));
  } else
  {
    qApp->quit();
  }
}

Qt Creator dan Kode

opencv-32

KDevelop, IDE Canggih di Linux

Bismillahirrahmanirrahim.

Saya mengenal KDevelop sejak saya mengenal KDE. Saya telah suka kepadanya walau saat itu saya belum mengenal pemrograman. Saat ini, KDevelop menarik perhatian saya kembali dengan fitur autocomplete-nya. KDevelop mampu membaca dan mem-parse header yang digunakan dalam 1 kode untuk memberikan saran autocomplete. Ini sangat membantu saya. Jadi, fitur autocomplete KDevelop beda dengan Kate (yang hanya melakukan autocomplete berdasar string yang sudah tertulis di dalam 1 kode). Fitur autocomplete canggih ini dimiliki oleh Qt Creator, tetapi karena saya ingin yang selain Qt Creator, akhirnya saya cari fitur ini untuk Kate. Karena saya menemukannya tetapi saya gagal memasangnya, maka saya kembali ke teman lama saya. Ya, KDevelop. Ini skrinsot-skrinsotnya.

opencv-23

opencv-24

opencv-26 opencv-25