Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QCombobox causes updating problem
Qt 6.11 is out! See what's new in the release blog

QCombobox causes updating problem

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
7 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wohehe
    wrote on last edited by
    #1

    Hello everyone!
    I am using Qt on ARM-64 embedded system,my qt version is v5.11.3,my problem is when I use a QCombobox in a graphicView and click it,everything seems ok. But when I want to close the graphicview,the page can not update itself.By the way, if I use update(),the page will refresh. I just wonder why.
    Hope for reply!

    My code is

    mainWindow.h
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QMainWindow>
    #include <QGraphicsView>
    #include <QGraphicsProxyWidget>
    #include "ui/custom_optionui.h"
    #include <QTimer>
    
    QT_BEGIN_NAMESPACE
    namespace Ui { class MainWindow; }
    QT_END_NAMESPACE
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        MainWindow(QWidget *parent = nullptr);
        ~MainWindow();
        customOptionUi * subWin_1;
        QGraphicsView *view_1;
    
    private slots:
    
        void on_pushButton_2_clicked();
        void view_close_1();
    
    private:
        Ui::MainWindow *ui;
    };
    #endif // MAINWINDOW_H```
    
    mainWindow.cpp
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "ui_optionui.h"
    #include "ui/custom_optionui.h"
    #include <QTimer>
    #include <QDebug>
    #include <QAbstractItemView>
    
    static void ui_rotate_1(MainWindow *mainWin, optionUi *subWin, int angle_z)
    {
        QGraphicsScene *scene = new QGraphicsScene;
        QGraphicsProxyWidget *graph = scene->addWidget(subWin);
        graph->setRotation(angle_z);
        mainWin->view_1 = new QGraphicsView(scene);
        mainWin->view_1->setGeometry(0, 0, 720, 1280);
        mainWin->view_1->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        mainWin->view_1->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
        mainWin->view_1->setAttribute(Qt::WA_TranslucentBackground,true);
        mainWin->view_1->setStyleSheet("background-color:transparent");
    }
    
    MainWindow::MainWindow(QWidget *parent)
        : QMainWindow(parent)
        , ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        subWin_1 = new customOptionUi();
        ui_rotate_1(this, subWin_1, 90);
        view_1->hide();
        connect(timer,SIGNAL(timeout()),this,SLOT(timerout_code()));
        connect(subWin_1->ui->closeButton,SIGNAL(clicked()),this,SLOT(view_close_1()));
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    void MainWindow::on_pushButton_2_clicked()
    {
        view_1->show();
    }
    
    void MainWindow::view_close_1()
    {
        view_1->close();
    
    }
    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you mean by "the page can not update" ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wohehe
        wrote on last edited by
        #3
        Thanks for reply! The page is the screen on my embedded system. When this problem appears, the graphicsview still on the screen, just like it is not closed. But in fact, the graphicsview has been closed.
        
        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What if you call hide rather than close ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          W 1 Reply Last reply
          0
          • SGaistS SGaist

            What if you call hide rather than close ?

            W Offline
            W Offline
            wohehe
            wrote on last edited by
            #5

            @SGaist The problem stiil appears.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Can you use a more recent version of Qt to see if it's still happening ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • W Offline
                W Offline
                wohehe
                wrote on last edited by
                #7

                OK, I will use :) Thanks a lot.

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved