#ifndef UTILS_H #define UTILS_H #include #include #include #include #include #include #include #include #include #include #define N_SEACOLORS 138 class FlatButton: public QLabel { Q_OBJECT public: FlatButton(const QString &label, QWidget *parent, const char *name=0); signals: void clicked(); void mousePressed(); protected: void mousePressEvent(QMouseEvent *e); void mouseReleaseEvent(QMouseEvent *e); private: int x, y; }; void ShrinkButton(QPushButton *b); void SetEraseColor(QWidget *widget, QWidget *from, bool inclBgr = false); double DoubleTime(void); QPen thisPen(long i, int w = 0); const QPixmap *thisPixmap(long i, int w = 0); long Convert2ColorIndex(const QString &color); bool Convert2ColorName(long i, QString &result); // my own textedit, making paragraphs for newlines, but with single line spacing class MyTextEdit: public QTextEdit { Q_OBJECT public: MyTextEdit(QWidget * parent, const char *name=0); void appendHtml(QString text); void appendText(QString text); void setBuffered(bool arg); private: bool buffered; QString linebuffer; QStringList buffer; }; char *strtoupper(const char *str); #endif