"Fossies" - the Fresh Open Source Software Archive

Member "cutter-1.8.2/src/common/Helpers.h" (20 May 2019, 1572 Bytes) of package /linux/privat/cutter-1.8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Helpers.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.8.1_vs_1.8.2.

    1 #ifndef QHELPERS_H
    2 #define QHELPERS_H
    3 
    4 #include <QString>
    5 #include <QColor>
    6 #include <QSizePolicy>
    7 #include <functional>
    8 
    9 class QIcon;
   10 class QPlainTextEdit;
   11 class QTextEdit;
   12 class QString;
   13 class QTreeWidget;
   14 class QTreeWidgetItem;
   15 class QAbstractItemView;
   16 class QAbstractButton;
   17 class QWidget;
   18 class QTreeView;
   19 
   20 namespace qhelpers {
   21 QString formatBytecount(const long bytecount);
   22 void adjustColumns(QTreeView *tv, int columnCount, int padding);
   23 void adjustColumns(QTreeWidget *tw, int padding);
   24 bool selectFirstItem(QTreeWidget* tw);
   25 QTreeWidgetItem *appendRow(QTreeWidget *tw, const QString &str, const QString &str2 = QString(),
   26                            const QString &str3 = QString(), const QString &str4 = QString(), const QString &str5 = QString());
   27 
   28 void setVerticalScrollMode(QAbstractItemView *tw);
   29 
   30 void setCheckedWithoutSignals(QAbstractButton *button, bool checked);
   31 
   32 
   33 struct SizePolicyMinMax {
   34     QSizePolicy sizePolicy;
   35     int min;
   36     int max;
   37 
   38     void restoreWidth(QWidget *widget);
   39     void restoreHeight(QWidget *widget);
   40 };
   41 
   42 SizePolicyMinMax forceWidth(QWidget *widget, int width);
   43 SizePolicyMinMax forceHeight(QWidget *widget, int height);
   44 
   45 int getMaxFullyDisplayedLines(QTextEdit *textEdit);
   46 int getMaxFullyDisplayedLines(QPlainTextEdit *plainTextEdit);
   47 
   48 QByteArray applyColorToSvg(const QByteArray &data, QColor color);
   49 QByteArray applyColorToSvg(const QString &filename, QColor color);
   50 
   51 void setThemeIcons(QList<QPair<void*, QString>> supportedIconsNames, std::function<void(void *, const QIcon &)> setter);
   52 
   53 } // qhelpers
   54 
   55 #endif // HELPERS_H