2017-03-29 10:18:37 +00:00
|
|
|
#ifndef QHELPERS_H
|
|
|
|
#define QHELPERS_H
|
|
|
|
|
2017-04-13 15:04:30 +00:00
|
|
|
#include <QString>
|
2017-11-03 17:22:54 +00:00
|
|
|
#include <QSizePolicy>
|
2017-04-13 15:04:30 +00:00
|
|
|
|
2017-04-05 08:56:59 +00:00
|
|
|
class QPlainTextEdit;
|
|
|
|
class QTextEdit;
|
2017-04-18 10:03:47 +00:00
|
|
|
class QString;
|
2017-04-13 15:04:30 +00:00
|
|
|
class QTreeWidget;
|
2017-04-28 13:09:40 +00:00
|
|
|
class QTreeWidgetItem;
|
|
|
|
class QAbstractItemView;
|
2017-10-01 14:36:40 +00:00
|
|
|
class QAbstractButton;
|
2017-11-03 17:22:54 +00:00
|
|
|
class QWidget;
|
2017-03-29 10:18:37 +00:00
|
|
|
|
2017-04-05 08:56:59 +00:00
|
|
|
namespace qhelpers
|
2017-03-29 10:18:37 +00:00
|
|
|
{
|
|
|
|
void normalizeFont(QPlainTextEdit *edit);
|
|
|
|
void normalizeEditFont(QTextEdit *edit);
|
2017-04-18 10:03:47 +00:00
|
|
|
|
2017-04-13 16:18:56 +00:00
|
|
|
void adjustColumns(QTreeWidget *tw, int columnCount = 0, int padding = 0);
|
2017-04-13 15:04:30 +00:00
|
|
|
|
2017-04-28 13:09:40 +00:00
|
|
|
QTreeWidgetItem *appendRow(QTreeWidget *tw, const QString &str, const QString &str2 = QString(),
|
2017-04-28 13:38:01 +00:00
|
|
|
const QString &str3 = QString(), const QString &str4 = QString(), const QString &str5 = QString());
|
2017-04-13 15:04:30 +00:00
|
|
|
|
2017-04-28 13:09:40 +00:00
|
|
|
void setVerticalScrollMode(QAbstractItemView *tw);
|
2017-10-01 14:36:40 +00:00
|
|
|
|
|
|
|
void setCheckedWithoutSignals(QAbstractButton *button, bool checked);
|
2017-11-03 17:22:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
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);
|
2017-11-15 21:56:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
int getMaxFullyDisplayedLines(QPlainTextEdit *plainTextEdit);
|
2017-04-05 08:56:59 +00:00
|
|
|
}
|
2017-03-29 10:18:37 +00:00
|
|
|
|
|
|
|
#endif // HELPERS_H
|