我默认QT编程语言是english既然english是left to right 我有一个菜单,并在左侧的一些按钮,但是当我改变我的计划对那些具有语言right to left方向,放置菜单,并在左侧的按钮是没有意义的.
所以我想知道是否可以选择将所有小部件撤销到正确的位置?
我有一个QGraphicsView在MainWindow我的 Ui 中创建的(当然是使用基本线程),我想QGraphicsScene从另一个线程在它上面设置一个。
所以在MainWindow我的构造函数中有:
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
...
connect(this,&MainWindow::graphSceneSignal,this,&MainWindow::graphSceneSlot);
...
QFuture<void> future;
future = QtConcurrent::run(this,&MainWindow::generateGraph);
...
}
Run Code Online (Sandbox Code Playgroud)
我有MainWindow::generateGraph:
void MainWindow::generateGraph()
{
...
QPixmap p("myPix.png");
QGraphicsScene* scene = new QGraphicsScene();
scene->addPixmap(p);
emit graphSceneSignal(scene);
...
}
Run Code Online (Sandbox Code Playgroud)
里面MainWindow::graphSceneSlot有:
void MainWindow::graphSceneSlot(QGraphicsScene* scene)
{
ui->graph_graphicsView->setScene(scene);
ui->graph_graphicsView->show();
}
Run Code Online (Sandbox Code Playgroud)
但出现这个警告我想解决这个问题:
QObject::killTimer: Timers cannot be stopped from another thread
Run Code Online (Sandbox Code Playgroud)
又怎样?
更新
我可以通过移动来解决这个问题:
QPixmap p("myPix.png");
QGraphicsScene* scene = new QGraphicsScene();
scene->addPixmap(p);
Run Code Online (Sandbox Code Playgroud)
进入MainWindow::graphSceneSlot
我在我的c ++程序中使用第三个库,在某些情况下会发出SIGABRT信号.我知道尝试释放非初始化指针或类似的东西可能是这个信号的原因.不过,我希望在发出此信号后继续运行我的程序,以显示消息并允许用户更改设置,以便处理此信号.
(我使用QT进行开发.)
我怎样才能做到这一点?
我知道我可以在使用这些标志.pro来增大的尺寸stack和heap在QT在我的C++项目.但在linux中它没有任何影响,我仍然有堆栈大小问题.我怎样才能在linux中解决这个问题,还是有其他解决方案?
QMAKE_CXXFLAGS += -Wl,--stack,100000000
QMAKE_CXXFLAGS += -Wl,--heap,100000000
Run Code Online (Sandbox Code Playgroud)