Ejemplo n.º 1
0
/**
 * 处理内容:窗体控件的创建
 * @param void
 * @return void
 */
void MainWnd::createWidget()
{
    // 创建标题栏
    m_pTitleBar = new TitleBar(this);
    connect(m_pTitleBar,SIGNAL(menuClicked()),SLOT(showMenu()));
    connect(m_pTitleBar,SIGNAL(minClicked()),SLOT(showMin()));
    connect(m_pTitleBar,SIGNAL(maxClicked()),SLOT(showMax()));
    connect(m_pTitleBar,SIGNAL(closeClicked()),SLOT(showClose()));

    // 创建对工具栏
    m_pToolBar = new ToolBar(this);

    // 创建内容区域
    m_pContentWidget = new Html5Viewer(this);
    m_pContentWidget->setOrientation(Html5Viewer::ScreenOrientationAuto);

    //m_pContentWidget->showExpanded();
    //m_pContentWidget->loadFile(QLatin1String("QtStyleSheetsReference.html"));

    QString strURL = SysSettings::Instance()->value(QString::fromLocal8Bit("url/turl"),QVariant()).toString();
    m_pContentWidget->loadUrl(QUrl(strURL));

    // 创建状态栏
    m_pStatuBar = new StatusBar(this);

//    // 右键菜单
//    connect(this,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(menuRight(const QPoint&)));
}
Ejemplo n.º 2
0
void ODocumentFileView::reread() {
    if (!m_selector)
        return;

    m_selector->setNewVisible( showNew() );
    m_selector->setCloseVisible( showClose() );
    m_selector->filter = currentMimeType().join(";");
    m_selector->reread();
}
Ejemplo n.º 3
0
QWidget* ODocumentFileView::widget( QWidget* parent ) {
    if (!m_selector ) {
        m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() );
        QObject::connect(m_selector, SIGNAL(fileSelected(const DocLnk&) ),
                         selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) );
        QObject::connect(m_selector, SIGNAL(closeMe() ),
                         selector(), SIGNAL(closeMe() ) );
        QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk&) ),
                         selector(), SIGNAL(newSelected(const DocLnk&) ) );
    }

    return m_selector;
}