Created
June 30, 2017 22:03
-
-
Save oglops/d24a6217f2c763657a8e5ef83df6f503 to your computer and use it in GitHub Desktop.
qwebview visited link color not changing ?
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
<html> | |
<head> | |
<title></title> | |
<meta content=""> | |
<style></style> | |
</head> | |
<body> | |
page 1 | |
<a href="2.html"> open page 2</a> | |
</body> | |
</html> |
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
<html> | |
<head> | |
<title></title> | |
<meta content=""> | |
<style></style> | |
</head> | |
<body> | |
page 2 | |
<a href="1.html"> open page 1</a> | |
</body> | |
</html> |
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
a:link { | |
color: #ff0000; | |
text-decoration: underline; | |
} | |
/*not working*/ | |
a:visited { | |
color: #00ff00; | |
text-decoration: underline; | |
} | |
a:hover { | |
color: #0000ff; | |
text-decoration: none; | |
} | |
a:active { | |
color: #ff00ff; | |
text-decoration: underline; | |
} |
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
from PyQt4.QtGui import * | |
from PyQt4.QtCore import * | |
from PyQt4.QtWebKit import * | |
cssFile = 'test.css' | |
app = QApplication([]) | |
win = QWidget() | |
win.setWindowTitle('QWebView test') | |
sheet = QUrl.fromLocalFile(cssFile) | |
QWebSettings.globalSettings().setUserStyleSheetUrl(sheet) | |
layout = QVBoxLayout() | |
win.setLayout(layout) | |
view = QWebView() | |
view.load(QUrl('file:///1.html')) | |
layout.addWidget(view) | |
win.show() | |
app.exec_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment