Originally Posted by
elcuco
to each widget? or globally to the whole application?
QApplication is the top class ...
after the command ....
QApplication::setStyle(arthurStylexxxxx);
the style is visible....
i save to qsetting and edit at mainwindow...
on main..... load the style and all other xxx
int main(int argc, char *argv[]) {
#if defined Q_WS_MAC
localedirfile
= QString("%1/locale/edit_%2.qm").
arg(WORK_CACHEDIR
).
arg(UserLanguage
());
#endif
#if defined Q_WS_WIN
#endif
#if defined Q_WS_X11
localedirfile
= QString("%1/locale/edit_%2.qm").
arg(WORK_CACHEDIR
).
arg(UserLanguage
());
#endif
translator.load(localedirfile);
a.installTranslator(&translator);
if (!NetworkEnable()) {
QMessageBox::warning(0,
"NetworkInterface",
"Check Your Network! SQL DB get data........");
return 0;
}
Preload *splash = new Preload(1400,LICENCE); /* animated painter dialog widget loading msec */
splash->exec();
Gui_Main::self()->setWindowTitle( _PROGRAM_TITLE_ );
if (soko.size() > 0 ) {
if (soko == "NorwegianWood") {
a.setStyle(new NorwegianWoodStyle);
} else if (soko == "ArthurStyle") {
#ifdef QT_OPENGL_SUPPORT
QStyle *arthurStyle
= new ArthurStyle
();
QList<QWidget *> widgets = qFindChildren<QWidget *>(Gui_Main::self());
w->setStyle(arthurStyle);
}
a.setStyle(arthurStyle);
#endif
} else if (soko == "QWindowsVistaStyle") {
#if defined Q_WS_WIN
a.setStyle(new QWindowsVistaStyle);
#endif
} else {
}
///////////a.setPalette(QApplication::style()->standardPalette());
}
argument_1
= QString::fromLatin1(argv
[1]);
if (argument_1.contains(".chre")) {
Gui_Main
::self()->setOpen
(QUrl(argument_1
));
}
Gui_Main::self()->show();
///////// splash self close /////
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
};
int main(int argc, char *argv[]) {
QApplication a( argc, argv );
QCoreApplication::setOrganizationName(_ORGANIZATION_NAME_);
QCoreApplication::setOrganizationDomain(_PROGRAM_NAME_DOMAINE_);
QCoreApplication::setApplicationName(_PROGRAM_NAME_);
QString localedirfile;
#if defined Q_WS_MAC
localedirfile = QString("%1/locale/edit_%2.qm").arg(WORK_CACHEDIR).arg(UserLanguage());
#endif
#if defined Q_WS_WIN
localedirfile = QString("%1/locale/edit_%2.qm").arg(QCoreApplication::applicationDirPath()).arg(UserLanguage());
#endif
#if defined Q_WS_X11
localedirfile = QString("%1/locale/edit_%2.qm").arg(WORK_CACHEDIR).arg(UserLanguage());
#endif
QTranslator translator;
translator.load(localedirfile);
a.installTranslator(&translator);
if (!NetworkEnable()) {
QMessageBox::warning(0,"NetworkInterface","Check Your Network! SQL DB get data........");
return 0;
}
Preload *splash = new Preload(1400,LICENCE); /* animated painter dialog widget loading msec */
splash->exec();
QSettings setter;
QString soko = QString(setter.value("WinStyle").toString());
Gui_Main::self()->setWindowTitle( _PROGRAM_TITLE_ );
if (soko.size() > 0 ) {
if (soko == "NorwegianWood") {
a.setStyle(new NorwegianWoodStyle);
} else if (soko == "ArthurStyle") {
#ifdef QT_OPENGL_SUPPORT
QStyle *arthurStyle = new ArthurStyle();
QList<QWidget *> widgets = qFindChildren<QWidget *>(Gui_Main::self());
foreach (QWidget *w, widgets) {
w->setStyle(arthurStyle);
}
a.setStyle(arthurStyle);
#endif
} else if (soko == "QWindowsVistaStyle") {
#if defined Q_WS_WIN
a.setStyle(new QWindowsVistaStyle);
#endif
} else {
a.setStyle(QStyleFactory::create(soko));
}
///////////a.setPalette(QApplication::style()->standardPalette());
}
QString argument_1;
argument_1 = QString::fromLatin1(argv[1]);
if (argument_1.contains(".chre")) {
Gui_Main::self()->setOpen(QUrl(argument_1));
}
Gui_Main::self()->show();
///////// splash self close /////
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
return a.exec();
};
To copy to clipboard, switch view to plain text mode
Bookmarks