Exemplo n.º 1
0
void QtDesignerChild::setFileBuffer( const QString& content )
{
    createNewForm();
    mHostWidget->formWindow()->setFileName( filePath() );
    mHostWidget->formWindow()->setContents( content );
    mHostWidget->formWindow()->setDirty( true );
    formChanged();
    QTimer::singleShot( 500, this, SLOT( formFileBufferChanged() ) );
}
Exemplo n.º 2
0
QtDesignerChild::QtDesignerChild( QtDesignerManager* manager )
    : pAbstractChild()
{
    Q_ASSERT( manager );
    mDesignerManager = manager;
    mHostWidget = 0;

    setWindowIcon( pIconManager::icon( "designer.png", ":/icons" ) );
    
    createNewForm();
}
Exemplo n.º 3
0
bool QtDesignerChild::openFile( const QString& fileName, const QString& codec )
{
    Q_UNUSED( codec );

    if ( QFile::exists( fileName ) )
    {
        // set content
        QFile file( fileName );

        if ( !file.open( QIODevice::ReadOnly ) )
        {
            return false;
        }

        createNewForm();
        
        setFilePath( fileName );
        mHostWidget->formWindow()->setFileName( fileName );
        mHostWidget->formWindow()->setContents( &file );

        if ( mHostWidget->formWindow()->mainContainer() )
        {
            // set clean
            mHostWidget->formWindow()->setDirty( false );

            setWindowModified( false );

            emit fileOpened();
            return true;
        }
        else
        {
            setFilePath( QString::null );
            mHostWidget->formWindow()->setFileName( QString::null );
        }
    }

    return false;
}
Exemplo n.º 4
0
void QtDesignerChild::closeFile()
{
    createNewForm();
    setFilePath( QString::null );
    emit fileClosed();
}
Exemplo n.º 5
0
void newForm::on_buttonBox_clicked(QAbstractButton *button)                         // обработка нажатия кнопок
{
    if (ui->buttonBox->standardButton(button) == QDialogButtonBox::Ok){             // кнопка Ок
        emit createNewForm(ui->spinBox->value(), ui->spinBox_2->value(), ui->lineEdit->text());
    }
}