コード例 #1
0
UIGChooser::UIGChooser(QWidget *pParent)
    : QWidget(pParent)
    , m_pMainLayout(0)
    , m_pChooserModel(0)
    , m_pChooserView(0)
    , m_pStatusBar(0)
{
    /* Prepare palette: */
    preparePalette();

    /* Prepare layout: */
    prepareLayout();

    /* Prepare model: */
    prepareModel();

    /* Prepare view: */
    prepareView();

    /* Prepare connections: */
    prepareConnections();

    /* Load: */
    load();
}
コード例 #2
0
void MMessageBoxViewPrivate::updateLayout()
{
    clearLayout();
    prepareLayout();

    if (centralWidget) {
        contentsLayout->insertItem(0, centralWidget);
    }

    if (textLabel) {
        contentsLayout->insertItem(0, textLabel);
        contentsLayout->setAlignment(textLabel, Qt::AlignCenter);
    }

    if (titleLabel) {
        contentsLayout->insertItem(0, titleLabel);
        contentsLayout->setAlignment(titleLabel, Qt::AlignCenter);
    }

    if (iconImage) {
        contentsLayout->insertItem(0, iconImage);
        contentsLayout->setAlignment(iconImage, Qt::AlignCenter);
    }

    if (!QGraphicsLayout::instantInvalidatePropagation()) {
        /* Update the geometry of the parents immediately. This simply makes the layout have the correct sizehint
         * immediately instead of one frame later, removing a single frame of 'flicker'.
         */
        QGraphicsLayoutItem *item = contents;
        do {
            item->updateGeometry();
        } while( (item = item->parentLayoutItem()) );
    }
}
コード例 #3
0
ファイル: layout.cpp プロジェクト: kthxbyte/QT2-Linaro
void GridLayout::doLayout()
{
    bool needMove, needReparent;
    if ( !prepareLayout( needMove, needReparent ) )
	return;

    QDesignerGridLayout *layout = (QDesignerGridLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::Grid );

    if ( !grid )
	buildGrid();

    QWidget* w;
    int r, c, rs, cs;
    for ( w = widgets.first(); w; w = widgets.next() ) {
	if ( grid->locateWidget( w, r, c, rs, cs) ) {
	    if ( needReparent && w->parent() != layoutBase )
		w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE );
	    if ( rs * cs == 1 ) {
		layout->addWidget( w, r, c, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 );
	    } else {
		layout->addMultiCellWidget( w, r, r+rs-1, c, c+cs-1, w->inherits( "Spacer" ) ? ( (Spacer*)w )->alignment() : 0 );
	    }
	    w->show();
	} else {
	    qWarning("ooops, widget '%s' does not fit in layout", w->name() );
	}
    }
    finishLayout( needMove, layout );
}
コード例 #4
0
ファイル: UIGDetailsGroup.cpp プロジェクト: mmadia/vbox-haiku
UIGDetailsGroup::UIGDetailsGroup()
    : UIGDetailsItem(0)
    , m_pMainLayout(0)
    , m_pLayout(0)
    , m_pStep(0)
    , m_iStep(0)
{
    /* Prepare layout: */
    prepareLayout();

    /* Prepare connections: */
    connect(this, SIGNAL(sigStartFirstStep(QString)), this, SLOT(sltFirstStep(QString)), Qt::QueuedConnection);
}
コード例 #5
0
ファイル: profiler.cpp プロジェクト: asehati/WebPro
Profiler::Profiler(QObject *parent)
        :QObject(parent)
{
    done = false ;
    imageNum = jsNum = cssNum = otherNum = 0;
    prevReqEnds = currentReqEnds = 0;
//    counter = 0;

    myNetAccess = new MyNetworkAccessManager(this);

    diskCache = new QNetworkDiskCache(this);
    diskCache->setCacheDirectory("batch");
    diskCache->clear();
    myNetAccess->setCache(diskCache);

    webpage.setNetworkAccessManager(myNetAccess);

    webpage.settings()->setIconDatabasePath(""); //disable icon database for favicons associated with websites

    QObject::connect(myNetAccess, SIGNAL(finished(QNetworkReply *)),
                     this, SLOT(replyFinished(QNetworkReply *)));

    QObject::connect(&webpage, SIGNAL(loadFinished(bool)),
                     this, SLOT(pageLoadFinished(bool)));    

    urlSet.clear();

    dataDirectory = "/home/asehati/Desktop/build-GraphFetcher-Desktop-Debug";
    dataDirectory.append("/profiles/");

    statFile.setFileName("hitStatics.txt");
    statFile.open(QIODevice::Append);

    statOut.setDevice(&statFile);
    statOut.setRealNumberNotation(QTextStream::FixedNotation);
    statOut.setRealNumberPrecision(6);

#ifdef COUNTSTATISTICS
    countFile.setFileName("CountStatics.txt");
    countFile.open(QIODevice::Append);

    countOut.setDevice(&countFile);
#endif
    prepareLayout();
}
コード例 #6
0
ファイル: layout.cpp プロジェクト: kthxbyte/QT2-Linaro
void VerticalLayout::doLayout()
{
    bool needMove, needReparent;
    if ( !prepareLayout( needMove, needReparent ) )
	return;

    QVBoxLayout *layout = (QVBoxLayout*)WidgetFactory::createLayout( layoutBase, 0, WidgetFactory::VBox );

    for ( QWidget *w = widgets.first(); w; w = widgets.next() ) {
	if ( needReparent && w->parent() != layoutBase )
	    w->reparent( layoutBase, 0, QPoint( 0, 0 ), FALSE );
 	if ( qstrcmp( w->className(), "Spacer" ) == 0 )
 	    layout->addWidget( w, 0, ( (Spacer*)w )->alignment() );
 	else
	    layout->addWidget( w );
	w->show();
    }

    finishLayout( needMove, layout );
}
コード例 #7
0
ファイル: ConflictDialog.cpp プロジェクト: calincru/marble
void ConflictDialog::open()
{
    if( m_mergeItem == 0 ) {
        return;
    }

    switch( m_resolveAction ) {
    case ConflictDialog::AskUser:
        prepareLayout();
        QDialog::open();
        break;
    case ConflictDialog::PreferLocal:
        m_mergeItem->setResolution( MergeItem::A );
        emit resolveConflict( m_mergeItem );
        break;
    case ConflictDialog::PreferCloud:
        m_mergeItem->setResolution( MergeItem::B );
        emit resolveConflict( m_mergeItem );
        break;
    }
}
コード例 #8
0
UIGRuntimeInformation::UIGRuntimeInformation(QWidget *pParent)
    : QWidget(pParent)
    , m_pMainLayout(0)
    , m_pDetailsModel(0)
    , m_pDetailsView(0)
{
    /* Prepare palette: */
    preparePalette();

    /* Prepare layout: */
    prepareLayout();

    /* Prepare model: */
    prepareModel();

    /* Prepare view: */
    prepareView();

    /* Prepare connections: */
    prepareConnections();
}