本文整理汇总了Python中io.FileIO.addAction方法的典型用法代码示例。如果您正苦于以下问题:Python FileIO.addAction方法的具体用法?Python FileIO.addAction怎么用?Python FileIO.addAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.FileIO
的用法示例。
在下文中一共展示了FileIO.addAction方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from io import FileIO [as 别名]
# 或者: from io.FileIO import addAction [as 别名]
def __init__(self):
QMainWindow.__init__(self)
self.resize(800,600)
self.setWindowTitle('PDF Merger')
about = QAction('About', self)
self.connect(about, SIGNAL('triggered()'), self.show_about)
exit = QAction('Exit', self)
exit.setShortcut('Ctrl+Q')
self.connect(exit, SIGNAL('triggered()'), SLOT('close()'))
self.statusBar()
menubar = self.menuBar()
file = menubar.addMenu('File')
file.addAction(about)
file.addAction(exit)
self.main_widget = QWidget(self)
self.setCentralWidget(self.main_widget)
self.up_down_widget = QWidget(self)
self.options_widget = QWidget(self)
input_files_label = QLabel("Input PDFs\nThis is the order in which the files will be merged too")
self.files_list = QListWidget()
self.files_list.setSelectionMode(QAbstractItemView.ExtendedSelection)
add_button = QPushButton("Add PDF(s) to merge...")
add_button.clicked.connect(self.clicked_add)
up_button = QPushButton("Up")
up_button.clicked.connect(self.move_file_up)
down_button = QPushButton("Down")
down_button.clicked.connect(self.move_file_down)
remove_button = QPushButton("Remove PDF")
remove_button.clicked.connect(self.remove_file)
select_path_label = QLabel("Output PDF")
self.dest_path_edit = QLineEdit()
self.dest_path_edit.setReadOnly(True)
select_path = QPushButton("Select...")
select_path.clicked.connect(self.select_save_path)
start = QPushButton("Start")
start.clicked.connect(self.merge_pdf)
up_down_vbox = QVBoxLayout(self.up_down_widget)
up_down_vbox.addWidget(up_button)
up_down_vbox.addWidget(down_button)
up_down_vbox.addWidget(remove_button)
self.up_down_widget.setLayout(up_down_vbox)
group_input = QGroupBox()
grid_input = QGridLayout()
grid_input.addWidget(add_button, 0, 0)
grid_input.addWidget(input_files_label, 1, 0)
grid_input.addWidget(self.files_list, 2, 0)
grid_input.addWidget(self.up_down_widget, 2, 1)
group_input.setLayout(grid_input)
group_output = QGroupBox()
grid_output = QGridLayout()
grid_output.addWidget(select_path_label, 0, 0)
grid_output.addWidget(self.dest_path_edit, 1, 0)
grid_output.addWidget(select_path, 1, 1)
group_output.setLayout(grid_output)
vbox_options = QVBoxLayout(self.options_widget)
vbox_options.addWidget(group_input)
vbox_options.addWidget(group_output)
vbox_options.addWidget(start)
self.options_widget.setLayout(vbox_options)
splitter_filelist = QSplitter()
splitter_filelist.setOrientation(Qt.Vertical)
splitter_filelist.addWidget(self.options_widget)
vbox_main = QVBoxLayout(self.main_widget)
vbox_main.addWidget(splitter_filelist)
vbox_main.setContentsMargins(0,0,0,0)