Qt-Advanced-Stylesheets icon indicating copy to clipboard operation
Qt-Advanced-Stylesheets copied to clipboard

There seems to be an issue with `Getting started` in readme.md

Open zyjdmmm opened this issue 1 year ago • 0 comments

I successfully applied the theme using the following methods:

	acss::QtAdvancedStylesheet AdvancedStyleSheet;

	QString AppDir = qApp->applicationDirPath();
	QString themeDir = QString("%1/theme").arg(AppDir);


	QString StylesDir = QString("%1/styles").arg(themeDir);
	qDebug() << themeDir << "  " << StylesDir;


	AdvancedStyleSheet.setStylesDirPath(StylesDir);
	AdvancedStyleSheet.setOutputDirPath(themeDir + "/output");
	AdvancedStyleSheet.setCurrentStyle("qt_material");
	AdvancedStyleSheet.setDefaultTheme();
	AdvancedStyleSheet.updateStylesheet();
	setWindowIcon(AdvancedStyleSheet.styleIcon());
	qApp->setStyleSheet(AdvancedStyleSheet.styleSheet());

But the method in Getting started is like this,it didn't work:

QString AppDir = qApp->applicationDirPath();
QtAdvancedStylesheet AdvancedStylesheet;

// first set the directory that contains all your styles
AdvancedStylesheet.setStylesDirPath(AppDir + "/../../styles");

// now set the output folder where the processed styles are stored. The
// style manager will create a sub directory for each style
AdvancedStylesheet.setOutputDirPath(AppDir + "/output");

// set the current style and select a theme. After these two calls, the output
// folder will contains the generated resoruces and stylesheet.
AdvancedStylesheet.setCurrentStyle("qt_material");
AdvancedStylesheet.setCurrentTheme("dark_teal");

// now you can set the generated stylesheet
qApp->setStyleSheet(StyleManager.styleSheet());

zyjdmmm avatar May 13 '23 10:05 zyjdmmm