-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathguiutils.cpp
More file actions
executable file
·98 lines (81 loc) · 1.92 KB
/
Copy pathguiutils.cpp
File metadata and controls
executable file
·98 lines (81 loc) · 1.92 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#include "guiutils.h"
#include <QApplication>
#include <QLineEdit>
#include <QAbstractButton>
#include <QWidget>
#include <QIcon>
#include <QPushButton>
#include <QToolButton>
#include "selectobject.h"
namespace TS
{
const bool USE_FLAT_BUTTON_WITH_IMAGE = false;
QFont GetFixedFont()
{
QFont fixFont = QApplication::font();
fixFont.setFamily( "Courier New" );
return fixFont;
}
QIcon GetEditIcon()
{
return QIcon( ":/images/edit.png" );
}
QIcon GetAddIcon()
{
return QIcon( ":/images/add.png" );
}
QIcon GetCopyIcon()
{
return QIcon( ":/images/copy.png" );
}
QIcon GetRemoveIcon()
{
return QIcon( ":/images/remove.png" );
}
QIcon GetInitIcon()
{
return QIcon( ":/images/init.png" );
}
void SetIOAreaIcon( QAbstractButton* pab )
{
QToolButton* ptb = qobject_cast< QToolButton* >( pab );
if( ptb )
{
//ptb->setFlat( USE_FLAT_BUTTON_WITH_IMAGE );
ptb->setText( "" );
ptb->setIcon( QIcon( ":/images/ioarea.png" ) );
}
}
void SetKreatorLogo( QWidget* pw )
{
pw->setWindowIcon( QIcon( ":/images/klogo.png" ) );
}
void SetLeftArrow( QAbstractButton* pab )
{
QPushButton* ppb = qobject_cast< QPushButton* >( pab );
if( ppb )
{
ppb->setFlat( USE_FLAT_BUTTON_WITH_IMAGE );
ppb->setText( "" );
ppb->setIcon( QIcon( ":/images/leftarrow.png" ) );
}
}
void SetRightArrow( QAbstractButton* pab )
{
QPushButton* ppb = qobject_cast< QPushButton* >( pab );
if( ppb )
{
ppb->setFlat( USE_FLAT_BUTTON_WITH_IMAGE );
ppb->setText( "" );
ppb->setIcon( QIcon( ":/images/rightarrow.png" ) );
}
}
bool SelectSpell( QLineEdit* ple, QWidget* parent )
{
int spell_id = SelectObject::spell( ple->text().toInt(), parent );
if( spell_id == ple->text().toInt() )
return false;
ple->setText( QString::number( spell_id ) );
return true;
}
} // namespace TS