-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (27 loc) · 778 Bytes
/
main.cpp
File metadata and controls
34 lines (27 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "mainwindow.h"
#include <QApplication>
#include <QProxyStyle>
class MyProxyStyle : public QProxyStyle {
public:
explicit MyProxyStyle(const QString& name)
: QProxyStyle(name),
m_clear_icon(":/clear.png") {
}
public:
virtual QIcon standardIcon(StandardPixmap standard_icon,
const QStyleOption* option,
const QWidget* widget) const override {
if (standard_icon == SP_LineEditClearButton) return m_clear_icon;
return QProxyStyle::standardIcon(standard_icon, option, widget);
}
private:
QIcon m_clear_icon;
};
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
qApp->setStyle(new MyProxyStyle("fusion"));
MainWindow w;
w.show();
return a.exec();
}