import os
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from subprocess import Popen, PIPE, STDOUT
import subprocess
global loc
global des
def main():
w = MyWindow()
w.show()
sys.exit(app.exec_())
def __init__(self, *args):
#Window Main Settings
MainWindow = self.setWindowTitle('Data')# Name
self.
centralwidget = QWidget(MainWindow
) # Create Widget self.
gridLayout = QGridLayout(self.
centralwidget) # Create Grid Layout self.gridLayout.setSpacing(2)
self.gridLayout.setMargin(2)
self.setStyleSheet("""
*
{
background-color: rgb(65,65,65);
color : rgb(210,210,210);
}
QMenuBar::item
{
background-color: rbg(100,0,100);
}
QMenuBar::item:selected
{
background-color: rbg(0,0,255);
}
QMenuBar::item:pressed
{
background-color: rgb(100,100,100);
}
""")
#Create Menu and status info
self.
menubar = QMenuBar(MainWindow
) # Create Menu Bar self.
menubar.
setGeometry(QRect(0,
0,
800,
21)) # Menubar Settings self.setMenuBar(self.menubar)
self.
statusbar = QStatusBar(MainWindow
) # Create Status Bar self.setStatusBar(self.statusbar)
#Create Labels
self.
l_dirLoc = QLabel('Location Dir',self
) #Create Buttons
#Create Q Line Edits
self.
q_fileType = QLineEdit('Type File',self.
centralwidget) #Create List Views
#Create Check Box
self.
bx_Display = QCheckBox('Display Data',self
)
#Create Text Edit
#Menubar Action
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(qApp.quit)
menubar = self.menuBar()
file_menu = menubar.addMenu('&File')
file_menu.addAction(exitAction)
#Layout Order
self.gridLayout.addWidget(self.l_dirLoc)
self.gridLayout.addWidget(self.pb_getDir)
self.gridLayout.addWidget(self.q_fileType)
self.gridLayout.addWidget(self.lv_list)
self.gridLayout.addWidget(self.bx_Display)
self.gridLayout.addWidget(self.te_dbrList)
self.setCentralWidget(self.centralwidget)
if __name__ == "__main__":
main()
import os
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from subprocess import Popen, PIPE, STDOUT
import subprocess
global loc
global des
def main():
app = QApplication(sys.argv)
w = MyWindow()
w.show()
sys.exit(app.exec_())
class MyWindow(QMainWindow):
def __init__(self, *args):
QMainWindow.__init__(self, *args)
#Window Main Settings
MainWindow = self.setWindowTitle('Data')# Name
self.centralwidget = QWidget(MainWindow) # Create Widget
self.gridLayout = QGridLayout(self.centralwidget) # Create Grid Layout
self.gridLayout.setSpacing(2)
self.gridLayout.setMargin(2)
self.setStyleSheet("""
*
{
background-color: rgb(65,65,65);
color : rgb(210,210,210);
}
QMenuBar::item
{
background-color: rbg(100,0,100);
}
QMenuBar::item:selected
{
background-color: rbg(0,0,255);
}
QMenuBar::item:pressed
{
background-color: rgb(100,100,100);
}
""")
#Create Menu and status info
self.menubar = QMenuBar(MainWindow) # Create Menu Bar
self.menubar.setGeometry(QRect(0, 0, 800, 21)) # Menubar Settings
self.setMenuBar(self.menubar)
self.statusbar = QStatusBar(MainWindow) # Create Status Bar
self.setStatusBar(self.statusbar)
#Create Labels
self.l_dirLoc = QLabel('Location Dir',self)
#Create Buttons
self.pb_getDir = QPushButton('...',self.centralwidget)
#Create Q Line Edits
self.q_fileType = QLineEdit('Type File',self.centralwidget)
#Create List Views
self.lv_list = QListView(self.centralwidget)
#Create Check Box
self.bx_Display = QCheckBox('Display Data',self)
#Create Text Edit
self.te_dbrList = QTextEdit('',self)
#Menubar Action
exitAction = QAction(QIcon('exit.png'), '&Exit', self)
exitAction.setShortcut('Ctrl+Q')
exitAction.setStatusTip('Exit application')
exitAction.triggered.connect(qApp.quit)
menubar = self.menuBar()
file_menu = menubar.addMenu('&File')
file_menu.addAction(exitAction)
#Layout Order
self.gridLayout.addWidget(self.l_dirLoc)
self.gridLayout.addWidget(self.pb_getDir)
self.gridLayout.addWidget(self.q_fileType)
self.gridLayout.addWidget(self.lv_list)
self.gridLayout.addWidget(self.bx_Display)
self.gridLayout.addWidget(self.te_dbrList)
self.gridLayout.addItem(QSpacerItem(0,0, QSizePolicy.Minimum, QSizePolicy.Expanding))
self.setCentralWidget(self.centralwidget)
if __name__ == "__main__":
main()
To copy to clipboard, switch view to plain text mode
Bookmarks