⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filepanelc.cpp

📁 爱可视605看PDF程式源代码, 基于APDF
💻 CPP
字号:
#include "filepanelc.h"#include "ndirview.h"#include "panelswitcher.h"#include <qlayout.h>#include <stdio.h>FilePanelC::FilePanelC(NDirSource *src, PanelSwitcher *ps, const char *name)	: QObject(ps, name)	, m_ps(ps) {	setPanel(1, src->folder());}void FilePanelC::setPanel(int index, const QString &path) {	QWidget *w= m_ps->panelAt(index);	NFolderView *folderv= NULL;	if(w == NULL) {		CachingWidget *cw= new CachingWidget(m_ps->viewport());		QLayout *l= new QVBoxLayout(cw);		m_ps->addPanel(cw, index);		NDirSource *fs= new NDirSource(this, "dirsrc");		folderv= new NDirView(fs, cw, "folder view");		cw->setFocusProxy(folderv);		l->add(folderv);		folderv->show();		disconnect(folderv, SIGNAL(changeFolder(const QString&)), fs,   SLOT(setFolder(const QString&)));		connect(   folderv, SIGNAL(changeFolder(const QString&)), this, SLOT(onChangeFolder(const QString&)));	} else {		folderv= (NFolderView*) w->child("folder view", "NFolderView");	}	if(folderv != NULL)		folderv->source()->setFolder(path);	m_ps->showPanel(index);}void FilePanelC::onChangeFolder(const QString &path) {	NFolderView *curv= (NFolderView*) m_ps->visiblePanel()->child("folder view", "NFolderView");	if(curv != NULL) {		QString curp= curv->source()->folder();			if(path == curp) {			setPanel(m_ps->visibleIndex(), path);		} else if(path.startsWith(curp)) {			setPanel(m_ps->visibleIndex() + 1, path);			} else if(curp.startsWith(path) ) {			setPanel(QMAX(0, m_ps->visibleIndex() - 1), path);			}	}}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -