我想在 QGraphicsView 中移动 QPushButton 或某种 QWidget,例如 QListWidet、QTableWidget 等。
所以,我使用了 QGraphicsProxyWidget。
然后我单击小部件并拖动。但它没有动。
我怎样才能移动QWidget?
这是我的代码。
ui->graphicsView->setGeometry(0,0,geometry().width(),geometry().height());
scene = new QGraphicsScene(0, 0, geometry().width(), geometry().height(), this);
ui->graphicsView->setScene(scene);
btn =new QPushButton(NULL);
QGraphicsProxyWidget *proxy = scene->addWidget(btn);
proxy->setFlags(QGraphicsItem::ItemIsMovable|QGraphicsItem::ItemIsSelectable);
scene->addItem(proxy);
Run Code Online (Sandbox Code Playgroud)
你能告诉我出了什么问题吗?
谢谢。
我正在使用 Wordpress 的高级自定义字段并尝试在组内循环转发器。我得到的只是“注意:数组到字符串的转换......”
出了什么问题,我该如何解决?
<?php if( have_rows('start_horlurar') ): while ( have_rows('start_horlurar') ) : the_row(); ?>
<?php $horlur = get_sub_field('horlur'); ?>
<?php if( have_rows( $horlur['arsmodeller_lankar']) ): while ( have_rows($horlur['arsmodeller_lankar']) ) : the_row(); ?>
<?php echo get_sub_field('lank'); ?>
<?php endwhile; endif; ?>
<?php endwhile; endif; ?>
Run Code Online (Sandbox Code Playgroud) php wordpress while-loop nested-loops advanced-custom-fields