forked from dragondjf/QFramer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add template qss and add qssbuilder.py and deploy.py
- Loading branch information
dingjiangfeng
committed
Jul 28, 2014
1 parent
0e6621c
commit 4706857
Showing
48 changed files
with
1,790 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mingw32-make.exe clean | ||
qmake.exe QFramer.pro -r -spec win32-g++ | ||
mingw32-make.exe | ||
C:\\Qt\\Qt5.3.1\\Tools\\mingw482_32\\bin\\mingw32-make.exe clean | ||
C:\\Qt\\Qt5.3.1\\5.3\\mingw482_32\\bin\\qmake.exe QCFramer.pro -r -spec win32-g++ | ||
C:\\Qt\\Qt5.3.1\\Tools\\mingw482_32\\bin\\mingw32-make.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
import copy | ||
import shutil | ||
import subprocess | ||
try: | ||
import xml.etree.cElementTree as ET | ||
except ImportError: | ||
import xml.etree.ElementTree as ET | ||
|
||
distWinPath = os.sep.join([os.getcwd(), 'distwin']) | ||
|
||
def delete_file_folder(src): | ||
'''delete files and folders''' | ||
if os.path.isfile(src): | ||
try: | ||
os.remove(src) | ||
except: | ||
pass | ||
elif os.path.isdir(src): | ||
for item in os.listdir(src): | ||
itemsrc = os.path.join(src, item) | ||
delete_file_folder(itemsrc) | ||
try: | ||
os.rmdir(src) | ||
except Exception, e: | ||
print e | ||
|
||
if __name__ == '__main__': | ||
buildPaths = [] | ||
tree = ET.parse('QCFramer.pro.user') | ||
root = tree.getroot() | ||
for child in root: | ||
for cchild in child: | ||
for ccchild in cchild: | ||
for cccchild in ccchild: | ||
if cccchild.attrib['key'] == "ProjectExplorer.BuildConfiguration.BuildDirectory": | ||
buildPaths.append(cccchild.text) | ||
delete_file_folder(distWinPath) | ||
for item in ['distwin']: | ||
os.mkdir(os.sep.join([os.getcwd(), item])) | ||
exePath = os.sep.join([buildPaths[1], 'release', 'QCFramer.exe']) | ||
shutil.copyfile(exePath, os.sep.join([distWinPath, 'QCFramer.exe'])) | ||
os.chdir(distWinPath) | ||
subprocess.call(["windeployqt.exe", "QCFramer.exe"]) |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- coding: utf-8 -*- | ||
import os | ||
import sys | ||
import copy | ||
|
||
qssFolder = os.sep.join([os.getcwd(), 'skin', 'qss']) | ||
qssTemplatePath = os.sep.join([qssFolder, 'template.qss']) | ||
|
||
|
||
theme = { | ||
'main_gradient_color': "green", | ||
'main_background_color': "gray", | ||
'main_hover_color': "red", | ||
'main_select_color': "white", | ||
'combox_background_color': "black" | ||
} | ||
|
||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) >= 2: | ||
newQssFileName = sys.argv[1] | ||
else: | ||
newQssFileName = "test.qss" | ||
|
||
qssOutFileName = os.sep.join([qssFolder, newQssFileName]) | ||
|
||
with open(qssTemplatePath) as f: | ||
qssContent = f.read() | ||
for key, value in theme.items(): | ||
qssContent = qssContent.replace(key, value) | ||
|
||
with open(qssOutFileName, 'w') as f: | ||
f.write(qssContent) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.