Page Menu
Home
Phabricator (Chris)
Search
Configure Global Search
Log In
Files
F621534
main.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
main.cpp
View Options
#include
"MainWindow.h"
#include
<QApplication>
#include
"MySettings.h"
#include
"main.h"
#include
<string>
#include
<QMessageBox>
#include
<QDir>
#include
<QDebug>
#include
<QProxyStyle>
#include
"LegacyWindowsStyleTreeControl.h"
QString
application_data_dir
;
class
MyStyle
:
public
QProxyStyle
{
private
:
LegacyWindowsStyleTreeControl
legacy_windows_
;
public
:
MyStyle
()
:
QProxyStyle
(
0
)
{
}
void
drawPrimitive
(
PrimitiveElement
element
,
const
QStyleOption
*
option
,
QPainter
*
painter
,
const
QWidget
*
widget
=
0
)
const
{
if
(
element
==
QStyle
::
PE_IndicatorBranch
)
{
if
(
legacy_windows_
.
drawPrimitive
(
element
,
option
,
painter
,
widget
))
{
return
;
}
}
QProxyStyle
::
drawPrimitive
(
element
,
option
,
painter
,
widget
);
}
};
//void test();
int
main
(
int
argc
,
char
*
argv
[])
{
QApplication
a
(
argc
,
argv
);
QStyle
*
style
=
new
MyStyle
();
QApplication
::
setStyle
(
style
);
bool
f_open_here
=
false
;
for
(
int
i
=
1
;
i
<
argc
;
i
++
)
{
std
::
string
arg
=
argv
[
i
];
if
(
arg
==
"--open-here"
)
{
f_open_here
=
true
;
}
}
a
.
setOrganizationName
(
ORGANIZTION_NAME
);
a
.
setApplicationName
(
APPLICATION_NAME
);
application_data_dir
=
makeApplicationDataDir
();
if
(
application_data_dir
.
isEmpty
())
{
QMessageBox
::
warning
(
0
,
qApp
->
applicationName
(),
"Preparation of data storage folder failed."
);
return
1
;
}
MainWindow
w
;
w
.
setWindowIcon
(
QIcon
(
":/image/guitar.png"
));
w
.
show
();
if
(
f_open_here
)
{
QString
dir
=
QDir
::
current
().
absolutePath
();
w
.
autoOpenRepository
(
dir
);
}
return
a
.
exec
();
}
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Sat, Nov 14, 7:14 PM (10 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
132054
Default Alt Text
main.cpp (1 KB)
Attached To
Mode
R77 Guitar
Attached
Detach File
Event Timeline