cutter/src/utils/Helpers.h

50 lines
1.3 KiB
C
Raw Normal View History

#ifndef QHELPERS_H
#define QHELPERS_H
2017-04-13 15:04:30 +00:00
#include <QString>
#include <QColor>
#include <QSizePolicy>
2017-04-13 15:04:30 +00:00
class QPlainTextEdit;
class QTextEdit;
class QString;
2017-04-13 15:04:30 +00:00
class QTreeWidget;
class QTreeWidgetItem;
class QAbstractItemView;
class QAbstractButton;
class QWidget;
namespace qhelpers
{
void adjustColumns(QTreeWidget *tw, int columnCount = 0, int padding = 0);
2017-04-13 15:04:30 +00:00
QTreeWidgetItem *appendRow(QTreeWidget *tw, const QString &str, const QString &str2 = QString(),
const QString &str3 = QString(), const QString &str4 = QString(), const QString &str5 = QString());
2017-04-13 15:04:30 +00:00
void setVerticalScrollMode(QAbstractItemView *tw);
void setCheckedWithoutSignals(QAbstractButton *button, bool checked);
struct SizePolicyMinMax
{
QSizePolicy sizePolicy;
int min;
int max;
void restoreWidth(QWidget *widget);
void restoreHeight(QWidget *widget);
};
SizePolicyMinMax forceWidth(QWidget *widget, int width);
SizePolicyMinMax forceHeight(QWidget *widget, int height);
int getMaxFullyDisplayedLines(QPlainTextEdit *plainTextEdit);
2017-12-03 16:26:01 +00:00
QByteArray applyColorToSvg(const QByteArray &data, QColor color);
QByteArray applyColorToSvg(const QString &filename, QColor color);
}
#endif // HELPERS_H