标签:style blog http color os io ar 2014 问题
我想做一个基于oschina的跨平台的笔记软件(做得好就分享给大家,做的不好就自己收藏….,oschina openapi方面已经熟悉了一下,但是Qt还不是很熟悉,因为还是学习中…),下面讲我在用其他的笔记软件常常遇到以下几个问题:
- 不跨平台,因为很多像我这种伪程序猿都会在window和linux或者mac之间切换,像onenote就只能在windows上运行, 还有印象笔记的linux客户端也不甚理想。不过近期发现的
为知笔记
的确是个不错的选择- 作为一个笔记软件,我觉得要具有一些比如像
桌面便签
,日历提醒
等一些人性化的功能,暂时觉得只有为之笔记
的windows客户端能得到这个要求- 其次,我们也有许多笔记可以跟大家一起分享,这些笔记软件虽然具有分享功能,但是一般人都没用到,因为他没有一个公认的平台。如果是基于oschina的话,我们就可以通过公开的博客来进行分享。另外oschina也可以设置私人博客,这对于一些私人笔记也是可以很好的保护。
- 所以我觉得这个想法貌似还是可行
- 因为侧重点在笔记,所以这个东西前期肯定会忽略一些oschina上的新闻、咨询、动弹什么的,后期的话,就要看具体情况慢慢加入
目标的基本功能大致:
- 跨平台
- 具有写博客(公开),写日记(私人),日常任务计划(体现为便签)
- 具有自己的编辑器(总不能一个编辑器都没有,然后去写东西。其次,这样界面风格好统一)(最好有预览功能)
- 具有类似闹钟这种提醒的功能。
- 界面尽量美观,能设置几种不同的风格
# -*- coding:utf8 -*- from PyQt4 import QtCore, QtGui from PyQt4.QtCore import * from PyQt4.QtGui import * import mainQss class mainUi(QWidget): def __init__(self, parent=None): QWidget.__init__(self, parent) #self.shadow = QGraphicsDropShadowEffect(self) #self.shadow.setBlurRadius(15) #self.shadow.setColor(QColor("blue")) #self.shadow.setOffset(20, 20) #self.setGraphicsEffect(self.shadow) self.setWindowFlags(Qt.FramelessWindowHint) self.layout = QHBoxLayout(self) self.leftwidget = QWidget() self.centerwidget = QWidget() self.rightwidget = QWidget() self.leftwidget.setMaximumWidth(300) self.leftwidget.setMinimumWidth(200) self.leftwidget.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Minimum) # growflag self.centerwidget.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) # growflag self.rightwidget.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Expanding) # growflag self.centerwidget.setMinimumWidth(550) self.rightwidget.setMinimumWidth(250) self.rightwidget.setMaximumWidth(300) self.leftwidget.setStyleSheet(mainQss.threeWidget) self.centerwidget.setStyleSheet(mainQss.threeWidget) self.rightwidget.setStyleSheet(mainQss.threeWidget) headLabel = QLabel(self.rightwidget) headLabel.setStyleSheet(mainQss.headLabel) headLabel.setGeometry(25, 50, 80, 80) blogButton = QPushButton(u‘我的博客‘,self.rightwidget) blogButton.setStyleSheet(mainQss.textButton) blogButton.setGeometry(25, 180, 150, 30) blogWriteButton = QPushButton(self.rightwidget) blogWriteButton.setStyleSheet(mainQss.writeButton) blogWriteButton.setGeometry(180, 182, 24, 24) noteButton = QPushButton(u‘日常笔记‘,self.rightwidget) noteButton.setStyleSheet(mainQss.textButton) noteButton.setGeometry(25, 220, 150, 30) noteWriteButton = QPushButton(self.rightwidget) noteWriteButton.setStyleSheet(mainQss.writeButton) noteWriteButton.setGeometry(180, 222, 24, 24) taskButton = QPushButton(u‘今日任务‘,self.rightwidget) taskButton.setStyleSheet(mainQss.textButton) taskButton.setGeometry(25, 260, 150, 30) taskWriteButton = QPushButton(self.rightwidget) taskWriteButton.setStyleSheet(mainQss.writeButton) taskWriteButton.setGeometry(180, 262, 24, 24) self.btnClose = QPushButton(self.leftwidget) self.btnMini = QPushButton(self.leftwidget) self.btnMax = QPushButton(self.leftwidget) self.btnClose.setGeometry(5, 5, 24, 24) self.btnMini.setGeometry(64, 5, 24, 24) self.btnMax.setGeometry(35, 5, 24, 24) self.btnClose.setStyleSheet(mainQss.btn_close) self.btnMini.setStyleSheet(mainQss.btn_mini) self.btnMax.setStyleSheet(mainQss.btn_max) self.leftLayout = QVBoxLayout() self.centerLayout = QVBoxLayout() self.rightLayout = QVBoxLayout() self.leftLayout.addWidget(self.leftwidget) self.centerLayout.addWidget(self.centerwidget) self.rightLayout.addWidget(self.rightwidget) self.layout.addLayout(self.leftLayout) self.layout.addLayout(self.centerLayout) self.layout.addLayout(self.rightLayout) self.maxToNor = False self.layout.setContentsMargins(0,0,0,0) self.layout.setSpacing(0) self.setLayout(self.layout) self.setWindowOpacity(0.95) self.setSizePolicy(QSizePolicy.Minimum, QSizePolicy.Ignored) self.resize(1000, 600) self.connect(self.btnClose, SIGNAL("clicked()"), QtGui.qApp, SLOT("quit()")) self.connect(self.btnMini, SIGNAL("clicked()"),self.showMinimized) self.connect(self.btnMax, SIGNAL("clicked()"),self.showMaxNor) def showMaxNor(self): if self.maxToNor: self.showNormal() self.maxToNor = False else: self.showMaximized() self.maxToNor = True def mousePressEvent(self, event): if self.isMaximized(): return if event.button() == Qt.LeftButton: self.dragPos = event.globalPos() - self.pos() event.accept() def mouseMoveEvent(self, QMouseEvent): if self.isMaximized(): return if QMouseEvent.buttons() and Qt.LeftButton: self.move(QMouseEvent.globalPos() - self.dragPos) QMouseEvent.accept() def mouseReleaseEvent(self, QMouseEvent): pass if __name__ == "__main__": import sys app = QApplication(sys.argv) mu = mainUi()
# -*- coding:utf8 -*- btn_close = ‘‘‘ QPushButton{ background-image: url(./img/close.png); border-radius: 1px; } QPushButton:hover{ background-image: url(./img/closeHover.png); } ‘‘‘ btn_mini = ‘‘‘ QPushButton{ background-image: url(./img/mini.png); border-radius: 1px; } QPushButton:Hover{ background-image: url(./img/miniHover.png) } ‘‘‘ btn_max = ‘‘‘ QPushButton{ background-image: url(./img/max.png); border-radius: 1px; } QPushButton:Hover{ background-image: url(./img/maxHover.png) } ‘‘‘ headLabel = ‘‘‘ QLabel{ background-color: #FFCCCC; border-radius: 4px; } ‘‘‘ textButton = ‘‘‘ QPushButton{ text-align: left; color: white; font: 20px "Times New Roman"; border-radius: 4px; } QPushButton:Hover{ color: #D6432D; } ‘‘‘ writeButton = ‘‘‘ QPushButton{ background-image: url(./img/blogWrite.png); border-radius: 4px; } QPushButton:Hover{ background-image: url(./img/blogWriteHover.png); } ‘‘‘ threeWidget = ‘‘‘ QWidget{ background-color: #222222; border-radius: 0px; } ‘‘‘
pyqt 学习基础 实践2 基于oschina笔记软件的初步界面
标签:style blog http color os io ar 2014 问题
原文地址:http://my.oschina.net/zjuysw/blog/307433