C++ (Cpp) connect Beispiele

C++ (Cpp) connect - 30 Beispiele gefunden. Dies sind die am besten bewerteten C++ (Cpp) Beispiele für die connect, die aus Open Source-Projekten extrahiert wurden. Sie können Beispiele bewerten, um die Qualität der Beispiele zu verbessern.
Beispiel #1
0
VideoItem::VideoItem(Video *vid, ShowFunction *func)
    : ShowItem(func)
    , m_video(vid)
    , m_fullscreenAction(NULL)
{
    Q_ASSERT(vid != NULL);

    if (func->color().isValid())
        setColor(func->color());
    else
        setColor(ShowFunction::defaultColor(Function::Video));

    if (func->duration() == 0)
        func->setDuration(m_video->totalDuration());

    calculateWidth();
    connect(m_video, SIGNAL(changed(quint32)),
            this, SLOT(slotVideoChanged(quint32)));
    connect(m_video, SIGNAL(totalTimeChanged(qint64)),
            this, SLOT(slotVideoDurationChanged(qint64)));

    m_fullscreenAction = new QAction(tr("Fullscreen"), this);
    m_fullscreenAction->setCheckable(true);
    if (m_video->fullscreen() == true)
        m_fullscreenAction->setChecked(true);
    connect(m_fullscreenAction, SIGNAL(toggled(bool)),
            this, SLOT(slotFullscreenToggled(bool)));
}
Beispiel #2
0
void PathEnterWidget::setup()
{
    mpLineEdit->setAcceptDrops( false );
    connect( mpLineEdit, SIGNAL(textChanged(QString)),
             this, SIGNAL(textChanged(QString)) );
    connect( mpLineEdit, SIGNAL(textEdited(QString)),
             this, SIGNAL(textEdited(QString)) );
    connect( mpLineEdit, SIGNAL(returnPressed()),
             this, SIGNAL(returnPressed()) );

    QPushButton *button = new QPushButton( "...", this );
    button->setMaximumWidth( button->height() );
    connect( button, SIGNAL(clicked()),
             this, SLOT(browse()) );
    connect( mpLineEdit, SIGNAL(returnPressed()),
             this, SLOT(sendFileName()) );

    QCompleter *completer = new QCompleter( this );
    completer->setModel( mpDirModel );
    mpDirModel->setFilter( QDir::AllDirs | QDir::NoDotAndDotDot );
    mpDirModel->setSorting( QDir::Name );
    mpLineEdit->setCompleter( completer );

    QBoxLayout *layout = new QHBoxLayout( this );
    layout->setContentsMargins( 0, 0, 0, 0 );
    layout->addWidget( mpLineEdit );
    layout->addWidget( button );
    setLayout( layout );

    setAcceptDrops( true );
}
Beispiel #3
0
void QgsAttributeTableView::setModel( QgsAttributeTableFilterModel* filterModel )
{
    if ( mFilterModel )
    {
        // Cleanup old model stuff if present
        disconnect( mFilterModel, SIGNAL( filterAboutToBeInvalidated() ), this, SLOT( onFilterAboutToBeInvalidated() ) );
        disconnect( mFilterModel, SIGNAL( filterInvalidated() ), this, SLOT( onFilterInvalidated() ) );
    }

    mFilterModel = filterModel;
    QTableView::setModel( filterModel );

    connect( mFilterModel, SIGNAL( destroyed() ), this, SLOT( modelDeleted() ) );

    delete mFeatureSelectionModel;
    mFeatureSelectionModel = 0;

    if ( filterModel )
    {
        if ( !mFeatureSelectionManager )
        {
            mFeatureSelectionManager = new QgsVectorLayerSelectionManager( mFilterModel->layer(), mFilterModel );
        }

        mFeatureSelectionModel = new QgsFeatureSelectionModel( mFilterModel, mFilterModel, mFeatureSelectionManager, mFilterModel );
        setSelectionModel( mFeatureSelectionModel );
        mTableDelegate->setFeatureSelectionModel( mFeatureSelectionModel );
        connect( mFeatureSelectionModel, SIGNAL( requestRepaint( QModelIndexList ) ), this, SLOT( repaintRequested( QModelIndexList ) ) );
        connect( mFeatureSelectionModel, SIGNAL( requestRepaint() ), this, SLOT( repaintRequested() ) );
    }
}
Beispiel #4
0
ProfileWizard::ProfileWizard(TKeyhoteeApplication& mainApp) :
    QWizard(nullptr),
    _mainApp(mainApp)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setOption(HaveHelpButton, true);

    QWizardPage* intro_page = new QWizardPage(this);
    intro_page->setTitle(tr("Welcome to Keyhotee") );
    _profile_intro_ui = new Ui::IntroPage();
    _profile_intro_ui->setupUi(intro_page);

//  _nym_page = new NymPage(this);
    _profile_edit = new ProfileEditPage(this);

    connect(this, &ProfileWizard::helpRequested, this, &ProfileWizard::showHelp);
    connect(this, &ProfileWizard::accepted, this, &ProfileWizard::createProfile);

    setPage(Page_Intro, intro_page);
    setPage(Page_Profile, _profile_edit);
//  setPage(Page_FirstNym, _nym_page);

    setStartId(Page_Intro);

#ifndef Q_WS_MAC
    setWizardStyle(ModernStyle);
#else
    setWizardStyle(MacStyle);
#endif
}
Beispiel #5
0
QgsDualView::QgsDualView( QWidget* parent )
    : QStackedWidget( parent )
    , mEditorContext()
    , mMasterModel( 0 )
    , mFilterModel( 0 )
    , mFeatureListModel( 0 )
    , mAttributeForm( 0 )
    , mLayerCache( 0 )
    , mProgressDlg( 0 )
    , mFeatureSelectionManager( 0 )
{
    setupUi( this );

    mPreviewActionMapper = new QSignalMapper( this );

    mPreviewColumnsMenu = new QMenu( this );
    mActionPreviewColumnsMenu->setMenu( mPreviewColumnsMenu );

    // Set preview icon
    mActionExpressionPreview->setIcon( QgsApplication::getThemeIcon( "/mIconExpressionPreview.svg" ) );

    // Connect layer list preview signals
    connect( mActionExpressionPreview, SIGNAL( triggered() ), SLOT( previewExpressionBuilder() ) );
    connect( mPreviewActionMapper, SIGNAL( mapped( QObject* ) ), SLOT( previewColumnChanged( QObject* ) ) );
    connect( mFeatureList, SIGNAL( displayExpressionChanged( QString ) ), this, SLOT( previewExpressionChanged( QString ) ) );
}
Beispiel #6
0
/*
 *  Constructs a dspSummarizedSalesHistoryByShippingZone as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
dspSummarizedSalesHistoryByShippingZone::dspSummarizedSalesHistoryByShippingZone(QWidget* parent, const char* name, Qt::WFlags fl)
    : XMainWindow(parent, name, fl)
{
    setupUi(this);

    (void)statusBar();

    // signals and slots connections
    connect(_print, SIGNAL(clicked()), this, SLOT(sPrint()));
    connect(_close, SIGNAL(clicked()), this, SLOT(close()));
    connect(_query, SIGNAL(clicked()), this, SLOT(sFillList()));
    connect(_selectedShippingZone, SIGNAL(toggled(bool)), _shipZone, SLOT(setEnabled(bool)));

    _productCategory->setType(ProductCategory);

    _shipZone->populate( "SELECT shipzone_id, (shipzone_name || '-' || shipzone_descrip) "
                         "FROM shipzone "
                         "ORDER BY shipzone_name;" );

    _sohist->addColumn(tr("Zone"),        _itemColumn,  Qt::AlignCenter );
    _sohist->addColumn(tr("Customer"),    200,          Qt::AlignLeft   );
    _sohist->addColumn(tr("Item Number"), _itemColumn,  Qt::AlignLeft   );
    _sohist->addColumn(tr("Description"), -1,           Qt::AlignLeft   );
    _sohist->addColumn(tr("Shipped"),     _qtyColumn,   Qt::AlignRight  );
    _sohist->addColumn(tr("Ext. Price"),  _moneyColumn, Qt::AlignRight  );
}