本文整理汇总了C++中QTabWidget::currentWidget方法的典型用法代码示例。如果您正苦于以下问题:C++ QTabWidget::currentWidget方法的具体用法?C++ QTabWidget::currentWidget怎么用?C++ QTabWidget::currentWidget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTabWidget
的用法示例。
在下文中一共展示了QTabWidget::currentWidget方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: currentTab
TabbableWidget* YaTabBarBase::currentTab() const
{
QTabWidget* tabWidget = dynamic_cast<QTabWidget*>(parentWidget());
Q_ASSERT(tabWidget);
TabbableWidget* dlg = tabWidget ? dynamic_cast<TabbableWidget*>(tabWidget->currentWidget()) : 0;
return dlg;
}
示例2:
QWidget *QTabWidgetProto::currentWidget() const
{
QTabWidget *item = qscriptvalue_cast<QTabWidget*>(thisObject());
if (item)
return item->currentWidget();
return 0;
}
示例3: mouseReleaseEvent
void PluginCameraCalibration::mouseReleaseEvent ( QMouseEvent * event, pixelloc loc )
{
(void)loc;
QTabWidget* tabw = (QTabWidget*) ccw->parentWidget()->parentWidget();
if (tabw->currentWidget() == ccw)
{
doing_drag =false;
event->accept();
}
else
event->ignore();
}
示例4: mouseMoveEvent
void PluginCameraCalibration::mouseMoveEvent ( QMouseEvent * event, pixelloc loc )
{
QTabWidget* tabw = (QTabWidget*) ccw->parentWidget()->parentWidget();
if (doing_drag && tabw->currentWidget() == ccw && (event->buttons() & Qt::LeftButton)!=0)
{
if (loc.x < 0) loc.x=0;
if (loc.y < 0) loc.y=0;
if (video_width > 0 && loc.x >= video_width) loc.x=video_width-1;
if (video_height > 0 && loc.y >= video_height) loc.y=video_height-1;
drag_x->setDouble(loc.x);
drag_y->setDouble(loc.y);
event->accept();
}
else
event->ignore();
}
示例5: palette
classeMinuterieRouge::classeMinuterieRouge(QWidget* boite) : boiteRouge(boite)
{
QWidget *page = boiteRouge->parentWidget();
if(page != 0 && page->parentWidget() != 0) {
QTabWidget *onglet = qobject_cast
<QTabWidget*>(page->parentWidget()->parentWidget());
if(onglet != 0 && onglet->currentWidget() != page)
onglet->setCurrentWidget(page);
}
QPalette palette(boiteRouge->palette());
palette.setColor(QPalette::Base, QColor::fromRgb(0xff6666));
boiteRouge->setPalette(palette);
setSingleShot(true);
start(500);
}
示例6: mousePressEvent
void PluginCameraCalibration::mousePressEvent ( QMouseEvent * event, pixelloc loc )
{
QTabWidget* tabw = (QTabWidget*) ccw->parentWidget()->parentWidget();
double drag_threshold = 20; //in px
if (tabw->currentWidget() == ccw && (event->buttons() & Qt::LeftButton)!=0) {
drag_x = 0;
drag_y = 0;
double x_diff = camera_parameters.additional_calibration_information->left_corner_image_x->getDouble() - loc.x;
double y_diff = camera_parameters.additional_calibration_information->left_corner_image_y->getDouble() - loc.y;
if (sqrt(x_diff*x_diff + y_diff*y_diff) < drag_threshold)
{
drag_x = camera_parameters.additional_calibration_information->left_corner_image_x;
drag_y = camera_parameters.additional_calibration_information->left_corner_image_y;
}
x_diff = camera_parameters.additional_calibration_information->right_corner_image_x->getDouble() - loc.x;
y_diff = camera_parameters.additional_calibration_information->right_corner_image_y->getDouble() - loc.y;
if (sqrt(x_diff*x_diff + y_diff*y_diff) < drag_threshold)
{
drag_x = camera_parameters.additional_calibration_information->right_corner_image_x;
drag_y = camera_parameters.additional_calibration_information->right_corner_image_y;
}
x_diff = camera_parameters.additional_calibration_information->left_centerline_image_x->getDouble() - loc.x;
y_diff = camera_parameters.additional_calibration_information->left_centerline_image_y->getDouble() - loc.y;
if (sqrt(x_diff*x_diff + y_diff*y_diff) < drag_threshold)
{
drag_x = camera_parameters.additional_calibration_information->left_centerline_image_x;
drag_y = camera_parameters.additional_calibration_information->left_centerline_image_y;
}
x_diff = camera_parameters.additional_calibration_information->right_centerline_image_x->getDouble() - loc.x;
y_diff = camera_parameters.additional_calibration_information->right_centerline_image_y->getDouble() - loc.y;
if (sqrt(x_diff*x_diff + y_diff*y_diff) < drag_threshold)
{
drag_x = camera_parameters.additional_calibration_information->right_centerline_image_x;
drag_y = camera_parameters.additional_calibration_information->right_centerline_image_y;
}
if (drag_x != 0 && drag_y != 0)
{
event->accept();
doing_drag = true;
}
else
event->ignore();
} else {
event->ignore();
}
}
示例7: kDebug
ViewBase *SplitterView::findView( const QPoint &pos ) const
{
for ( int i = 0; i < m_splitter->count(); ++i ) {
ViewBase *w = dynamic_cast<ViewBase*>( m_splitter->widget( i ) );
if ( w && w->frameGeometry().contains( pos ) ) {
kDebug(planDbg())<<pos<<" in "<<w->frameGeometry();
return w;
}
QTabWidget *tw = dynamic_cast<QTabWidget*>( m_splitter->widget( i ) );
if (tw && tw->frameGeometry().contains( pos ) ) {
w = dynamic_cast<ViewBase*>( tw->currentWidget() );
if ( w ) {
kDebug(planDbg())<<pos<<" in "<<w->frameGeometry();
return w;
}
}
}
return const_cast<SplitterView*>( this );
}
示例8: currentWidget
ColorMapWidget* GUI::currentWidget()
{
QTabWidget* tw = reinterpret_cast<QTabWidget*>(_category_widget->currentWidget());
return reinterpret_cast<ColorMapWidget*>(tw->currentWidget());
}
示例9: drv_tabwidget
int drv_tabwidget(int drvid, void *a0, void* a1, void* a2, void* a3, void* a4, void* a5, void* a6, void* a7, void* a8, void* a9)
{
handle_head* head = (handle_head*)a0;
QTabWidget *self = (QTabWidget*)head->native;
switch (drvid) {
case TABWIDGET_INIT: {
drvNewObj(a0,new QTabWidget);
break;
}
case TABWIDGET_ADDTAB: {
self->addTab(drvGetWidget(a1),drvGetString(a2));
break;
}
case TABWIDGET_CLEAR: {
self->clear();
break;
}
case TABWIDGET_COUNT: {
drvSetInt(a1,self->count());
break;
}
case TABWIDGET_CURRENTINDEX: {
drvSetInt(a1,self->currentIndex());
break;
}
case TABWIDGET_CURRENTWIDGET: {
drvSetHandle(a1,self->currentWidget());
break;
}
case TABWIDGET_SETCURRENTINDEX: {
self->setCurrentIndex(drvGetInt(a1));
break;
}
case TABWIDGET_SETCURRENTWIDGET: {
self->setCurrentWidget(drvGetWidget(a1));
break;
}
case TABWIDGET_INDEXOF: {
drvSetInt(a2,self->indexOf(drvGetWidget(a1)));
break;
}
case TABWIDGET_INSERTTAB: {
self->insertTab(drvGetInt(a1),drvGetWidget(a2),drvGetString(a3));
break;
}
case TABWIDGET_REMOVETAB: {
self->removeTab(drvGetInt(a1));
break;
}
case TABWIDGET_SETTABTEXT: {
self->setTabText(drvGetInt(a1),drvGetString(a2));
break;
}
case TABWIDGET_SETTABTOOLTIP: {
self->setTabToolTip(drvGetInt(a1),drvGetString(a2));
break;
}
case TABWIDGET_TABTEXT: {
drvSetString(a2,self->tabText(drvGetInt(a1)));
break;
}
case TABWIDGET_TABTOOLTIP: {
drvSetString(a2,self->tabToolTip(drvGetInt(a1)));
break;
}
case TABWIDGET_WIDGETOF: {
drvSetHandle(a2,self->widget(drvGetInt(a1)));
break;
}
case TABWIDGET_ONCURRENTCHANGED: {
QObject::connect(self,SIGNAL(currentChanged(int)),drvNewSignal(self,a1,a2),SLOT(call(int)));
break;
}
default:
return 0;
}
return 1;
}
示例10: currentWidget
int TabWidget::currentWidget ( lua_State * L )// const QWidget
{
QTabWidget* obj = ObjectHelper<QTabWidget>::check( L, 1 );
ObjectPeer::pushPeer( L, obj->currentWidget() );
return 1;
}