本文整理汇总了C++中orientationChanged函数的典型用法代码示例。如果您正苦于以下问题:C++ orientationChanged函数的具体用法?C++ orientationChanged怎么用?C++ orientationChanged使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了orientationChanged函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QLabel
void BitcoinGUI::createToolBars()
{
/*
mainIcon = new QLabel (this);
//mainIcon->setPixmap(QPixmap(":images/gns-vertical"));
mainIcon->show();
mainToolbar = addToolBar(tr("Tabs toolbar"));
mainToolbar->setObjectName("main");
mainToolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
mainToolbar->addWidget(mainIcon);
*/
//mainIcon = new QLabel (this);
//mainIcon->show();
mainToolbar = addToolBar(tr("Tabs toolbar"));
mainToolbar->setObjectName("main");
mainToolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
mainToolbar->addAction(overviewAction);
mainToolbar->addAction(sendCoinsAction);
mainToolbar->addAction(receiveCoinsAction);
mainToolbar->addAction(historyAction);
mainToolbar->addAction(addressBookAction);
mainToolbar->setContextMenuPolicy(Qt::NoContextMenu);
secondaryToolbar = addToolBar(tr("Actions toolbar"));
secondaryToolbar->setObjectName("actions");
secondaryToolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
secondaryToolbar->addAction(exportAction);
secondaryToolbar->setContextMenuPolicy(Qt::NoContextMenu);
connect(mainToolbar, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(mainToolbarOrientation(Qt::Orientation)));
connect(secondaryToolbar, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(secondaryToolbarOrientation(Qt::Orientation)));
mainToolbarOrientation(mainToolbar->orientation());
secondaryToolbarOrientation(secondaryToolbar->orientation());
}
示例2: defined
void Utility::onReadingChanged()
{
#if defined(Q_WS_MAEMO_5) || defined(Q_WS_MAEMO_6) || defined(Q_OS_SYMBIAN)
QOrientationReading* reading = m_sensor->reading();
switch(reading->orientation())
{
case QOrientationReading::TopUp:
m_state = "Landscape";
emit orientationChanged();
break;
case QOrientationReading::TopDown:
m_state = "LandscapeInverted";
emit orientationChanged();
break;
case QOrientationReading::LeftUp:
m_state = "Portrait";
emit orientationChanged();
break;
case QOrientationReading::RightUp:
m_state = "PortraitInverted";
emit orientationChanged();
default:
break;
}
#endif
}
示例3: QLabel
void BitcoinGUI::createToolBars()
{
mainIcon = new QLabel (this);
mainIcon->setPixmap(QPixmap(":images/vertical"));
mainIcon->show();
mainToolbar = addToolBar(tr("Tabs toolbar"));
mainToolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
mainToolbar->addWidget(mainIcon);
mainToolbar->addAction(overviewAction);
mainToolbar->addAction(sendCoinsAction);
mainToolbar->addAction(receiveCoinsAction);
mainToolbar->addAction(historyAction);
mainToolbar->addAction(addressBookAction);
mainToolbar->addAction(messageAction);
mainToolbar->addAction(statisticsAction);
mainToolbar->addAction(blockAction);
secondaryToolbar = addToolBar(tr("Actions toolbar"));
secondaryToolbar->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
secondaryToolbar->addAction(exportAction);
connect(mainToolbar, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(mainToolbarOrientation(Qt::Orientation)));
connect(secondaryToolbar, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(secondaryToolbarOrientation(Qt::Orientation)));
mainToolbarOrientation(mainToolbar->orientation());
secondaryToolbarOrientation(secondaryToolbar->orientation());
}
示例4: HbScrollArea
/*!
\brief Constructor
Configures scroll area settings and resets internal stares of widget.
Gets the width of device.
\param parent The parent of scroll area widget
*/
CalenDayContentScrollArea::CalenDayContentScrollArea(QGraphicsItem *parent) :
HbScrollArea(parent), mPanDayDirection(ECalenPanNotSet), mIsMoving(false),
mMoveDirection(ECalenScrollNoDayChange), mDisallowedDirection(ECalenScrollNoDayChange)
{
#ifdef CALENDAYVIEW_PANNING_ENABLED
grabGesture(Qt::PanGesture);
ungrabGesture(Qt::SwipeGesture);
#else
grabGesture(Qt::SwipeGesture);
ungrabGesture(Qt::PanGesture);
#endif
// Get the width of content area and orientation of screen
mContentWidth = CalenDayUtils::instance()->contentWidth();
mOrientation = CalenDayUtils::instance()->orientation();
// Fix the width of scroll area
setMinimumWidth(mContentWidth);
setMaximumWidth(mContentWidth);
// Connect to main window's orientationChanged SIGNAL to handle orientation
// switching
connect(CalenDayUtils::instance()->mainWindow(),
SIGNAL(orientationChanged(Qt::Orientation)), this,
SLOT(orientationChanged(Qt::Orientation)));
}
示例5: OstTraceFunctionEntry0
/*!
Displays the to-do viewer and populates the to-do entry attributes.
\param entry Agenda entry from which attributes have to be read.
*/
void AgendaEventView::execute(AgendaEntry entry,
AgendaEventViewer::Actions action)
{
OstTraceFunctionEntry0( AGENDAEVENTVIEW_EXECUTE_ENTRY );
mOriginalAgendaEntry = entry;
mAgendaEntry = entry;
// For later reference
mParentId = mOwner->mAgendaUtil->parentEntry(mAgendaEntry).id();
// Add the viewer data reading from the agenda entry.
addViewerData();
// Remove unnecessary widget from event viewer.
removeWidget();
// Add the menu items to event viewer.
addMenuItem();
// Add the toolbar items to event viewer
addToolBarItem(action);
// Connect for the entry updation and addtion signal to refresh the view
// when the same is edited in editor.
connect(mOwner->mAgendaUtil, SIGNAL(entryUpdated(ulong)),
this, SLOT(handleEntryUpdation(ulong)));
connect(mOwner->mAgendaUtil, SIGNAL(entryAdded(ulong)),
this, SLOT(handleEntryUpdation(ulong)));
// Connect for entry deletion signal to close the event viewer.
connect(mOwner->mAgendaUtil, SIGNAL(entryDeleted(ulong)), this,
SLOT(handleEntryDeletion(ulong)));
// Add the view to the main window.
HbMainWindow *window = hbInstance->allMainWindows().first();
if (!window) {
// Might be some non-ui based app called us
// so create mainwindow now
mMainWindow = new HbMainWindow();
mMainWindow->addView(mViewer);
mMainWindow->setCurrentView(mViewer);
connect(mMainWindow,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation)));
} else {
window->addView(mViewer);
window->setCurrentView(mViewer);
connect(window,SIGNAL(orientationChanged(Qt::Orientation)),this,SLOT(changedOrientation(Qt::Orientation)));
}
// Add softkey after adding view on window
mBackAction = new HbAction(Hb::BackNaviAction);
mViewer->setNavigationAction(mBackAction);
connect(mBackAction, SIGNAL(triggered()), this, SLOT(close()));
OstTraceFunctionExit0( AGENDAEVENTVIEW_EXECUTE_EXIT );
}
示例6: QObject
HsGui::HsGui(QObject *parent):
QObject(parent),mImpl(new HsGuiImpl)
{
mImpl->mIdleView = 0;
mImpl->mIdleWidget = 0;
mImpl->mNavigationAction = 0;
mImpl->mPageChangeAnimation = 0;
mImpl->mPageCrawlingAnimation = 0;
mImpl->mWindow = hbInstance->allMainWindows().first();
connect(mImpl->mWindow, SIGNAL(orientationChanged(Qt::Orientation)),
SIGNAL(orientationChanged(Qt::Orientation)));
}
示例7: QOrientationSensor
void ScreenProvider::setRotate(bool value)
{
if(value) {
orientationSensor_ = new QOrientationSensor(this);
connect(orientationSensor_, SIGNAL(readingChanged()), this, SLOT(orientationChanged()));
orientationSensor_->start();
} else {
orientationSensor_->stop();
disconnect(orientationSensor_, SIGNAL(readingChanged()), this, SLOT(orientationChanged()));
delete orientationSensor_;
orientationSensor_ = 0;
orientation_ = QOrientationReading::TopUp;
}
}
示例8: QMainWindow
PmChart::PmChart() : QMainWindow(NULL)
{
my.dialogsSetup = false;
setIconSize(QSize(22, 22));
setupUi(this);
my.statusBar = new StatusBar;
setStatusBar(my.statusBar);
connect(my.statusBar->timeFrame(), SIGNAL(clicked()),
this, SLOT(editSamples()));
connect(my.statusBar->timeButton(), SIGNAL(clicked()),
this, SLOT(optionsShowTimeControl()));
my.timeAxisRightAlign = toolBar->height();
toolBar->setAllowedAreas(Qt::RightToolBarArea | Qt::TopToolBarArea);
connect(toolBar, SIGNAL(orientationChanged(Qt::Orientation)),
this, SLOT(updateToolbarOrientation(Qt::Orientation)));
updateToolbarLocation();
setupEnabledActionsList();
if (!globalSettings.initialToolbar && !outfile)
toolBar->hide();
toolbarAction->setChecked(true);
my.toolbarHidden = !globalSettings.initialToolbar;
my.consoleHidden = true;
if (!pmDebug)
consoleAction->setVisible(false);
consoleAction->setChecked(false);
if (outfile)
QTimer::singleShot(0, this, SLOT(exportFile()));
else
QTimer::singleShot(PmChart::defaultTimeout(), this, SLOT(timeout()));
}
示例9: QDialog
TravelInfoDialog::TravelInfoDialog(Travel *travel, QWidget *parent) :
QDialog(parent),
ui(new Ui::TravelInfoDialog)
{
ui->setupUi(this);
#ifdef Q_WS_MAEMO_5
setAttribute(Qt::WA_Maemo5AutoOrientation, true);
setAttribute(Qt::WA_Maemo5StackedWindow);
#endif
#ifdef Q_OS_SYMBIAN
// We need to add a back button
QAction *backSoftKeyAction = new QAction(tr("Back"), this);
backSoftKeyAction->setSoftKeyRole(QAction::NegativeSoftKey);
connect(backSoftKeyAction,SIGNAL(triggered()),SLOT(close())); // when the back button is pressed, just close this window
addAction(backSoftKeyAction);
#endif
ui->tblResults->setItemDelegate(new TravelStageListDelegate(this, this));
ui->tblResults->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
ui->tblResults->setModel(new TravelStageListModel(this, travel->travelStages));
ui->tblResults->resizeRowsToContents();
ui->tblResults->setFixedHeight(ui->tblResults->verticalHeader()->length() + 60);
connect(QApplication::desktop(), SIGNAL(resized(int)), this, SLOT(orientationChanged()));
orientationChanged(); // call this just in case we're in portrait mode from before
}
示例10: QDialog
QgsLayoutAddPagesDialog::QgsLayoutAddPagesDialog( QWidget *parent, Qt::WindowFlags flags )
: QDialog( parent, flags )
{
setupUi( this );
mPageOrientationComboBox->addItem( tr( "Portrait" ), QgsLayoutItemPage::Portrait );
mPageOrientationComboBox->addItem( tr( "Landscape" ), QgsLayoutItemPage::Landscape );
mPageOrientationComboBox->setCurrentIndex( 1 );
const auto constEntries = QgsApplication::pageSizeRegistry()->entries();
for ( const QgsPageSize &size : constEntries )
{
mPageSizeComboBox->addItem( size.displayName, size.name );
}
mPageSizeComboBox->addItem( tr( "Custom" ) );
mPageSizeComboBox->setCurrentIndex( mPageSizeComboBox->findData( QStringLiteral( "A4" ) ) );
pageSizeChanged( mPageSizeComboBox->currentIndex() );
orientationChanged( 1 );
mSizeUnitsComboBox->linkToWidget( mWidthSpin );
mSizeUnitsComboBox->linkToWidget( mHeightSpin );
mLockAspectRatio->setWidthSpinBox( mWidthSpin );
mLockAspectRatio->setHeightSpinBox( mHeightSpin );
connect( mPositionComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::positionChanged );
mExistingPageSpinBox->setEnabled( false );
connect( mPageSizeComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::pageSizeChanged );
connect( mPageOrientationComboBox, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsLayoutAddPagesDialog::orientationChanged );
connect( mWidthSpin, static_cast< void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutAddPagesDialog::setToCustomSize );
connect( mHeightSpin, static_cast< void ( QDoubleSpinBox::* )( double )>( &QDoubleSpinBox::valueChanged ), this, &QgsLayoutAddPagesDialog::setToCustomSize );
}
示例11: codeChanged
void LatexDocument::setOrientation(Orientation o)
{
_orientation = o;
/// @todo wording
emit codeChanged();
emit orientationChanged();
}
示例12: OstTraceFunctionEntry1
/*!
Loads the page with all the widgets
@return HbWidget* Returns the view widget
*/
HbWidget* WpsPageStepFour::initializePage()
{
OstTraceFunctionEntry1(WPSPAGESTEPFOUR_INITIALIZEPAGE_ENTRY, this);
if (!mWidget) {
bool ok;
mLoader = new HbDocumentLoader(mWizard->mainWindow());
mLoader->load(":/docml/occ_wps_04.docml", &ok);
Q_ASSERT(ok);
// Initialize orientation
loadDocmlSection(mWizard->mainWindow()->orientation());
mWidget = qobject_cast<HbWidget*> (mLoader->findWidget("occ_wps_04"));
Q_ASSERT(mWidget);
bool connectOk = connect(
mWizard->mainWindow(),
SIGNAL(orientationChanged(Qt::Orientation)),
this,
SLOT(loadDocmlSection(Qt::Orientation)));
Q_ASSERT(connectOk);
}
OstTraceFunctionExit1(WPSPAGESTEPFOUR_INITIALIZEPAGE_EXIT, this);
return mWidget;
}
示例13: connect
void CntFavoritesView::activate( const CntViewParameters aArgs )
{
if (mView->navigationAction() != mSoftkey)
mView->setNavigationAction(mSoftkey);
HbMainWindow* window = mView->mainWindow();
connect(window, SIGNAL(orientationChanged(Qt::Orientation)), this, SLOT(setOrientation(Qt::Orientation)));
setOrientation(window->orientation());
mContact = new QContact(aArgs.value(ESelectedGroupContact).value<QContact>());
mViewManager = &mEngine->viewManager();
HbPushButton *addButton = static_cast<HbPushButton*>(mDocumentLoader.findWidget(QString("cnt_button_add")));
connect(addButton, SIGNAL(clicked()), this, SLOT(openSelectionPopup()));
connect(addButton, SIGNAL(longPress(QPointF)), this, SLOT(openSelectionPopup()));
// If no contacts are present, then disable the button
QContactDetailFilter filter;
filter.setDetailDefinitionName(QContactType::DefinitionName, QContactType::FieldType);
filter.setValue(QLatin1String(QContactType::TypeContact));
QList<QContactLocalId> contactIds = getContactManager()->contactIds(filter);
if (contactIds.isEmpty())
{
addButton->setEnabled(false);
}
}
示例14: Q_UNUSED
bool BbGuiHelper::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
{
Q_UNUSED(result);
Q_UNUSED(eventType);
bps_event_t * const event = static_cast<bps_event_t *>(message);
if (event && bps_event_get_domain(event) == navigator_get_domain()) {
const int code = bps_event_get_code(event);
if (code == NAVIGATOR_ORIENTATION) {
const int newOrientation = navigator_event_get_orientation_angle(event);
if (newOrientation != m_currentOrientation) {
m_currentOrientation = newOrientation;
emit orientationChanged();
}
} else if (code == NAVIGATOR_WINDOW_STATE) {
const bool appActive =
(navigator_event_get_window_state(event) == NAVIGATOR_WINDOW_FULLSCREEN);
if (m_applicationActive != appActive) {
m_applicationActive = appActive;
emit applicationActiveChanged();
}
}
}
return false;
}
示例15: OstTraceFunctionEntry0
/*!
See WlanWizardPage.
*/
HbWidget* EapWizardPageCertUser::initializePage()
{
OstTraceFunctionEntry0( EAPWIZARDPAGECERTUSER_INITIALIZEPAGE_ENTRY );
if (!mWidget) {
bool ok;
mDocumentLoader.reset(new HbDocumentLoader(mWizard->wizardHelper()->mainWindow()));
mDocumentLoader->load(":/docml/occ_eap_wizard_06.docml", &ok);
Q_ASSERT(ok);
loadDocmlSection(mWizard->wizardHelper()->mainWindow()->orientation());
mWidget = qobject_cast<HbWidget*> (mDocumentLoader->findWidget("occ_eap_wizard_06"));
Q_ASSERT(mWidget);
mCertList = qobject_cast<HbRadioButtonList*> (mDocumentLoader->findWidget("list"));
Q_ASSERT(mCertList);
mErrorLabel = qobject_cast<HbLabel*> (mDocumentLoader->findWidget("errorLabel"));
Q_ASSERT(mErrorLabel);
mErrorLabel->setPlainText(hbTrId("txt_occ_dialog_no_certificates_installed_wizard_c"));
ok = connect(
mWizard->wizardHelper()->mainWindow(),
SIGNAL(orientationChanged(Qt::Orientation)),
this,
SLOT(loadDocmlSection(Qt::Orientation)));
Q_ASSERT(ok);
ok = connect(
mCertList, SIGNAL(itemSelected(int)),
this, SLOT(itemSelected(int)));
Q_ASSERT(ok);
}