Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [Solved] Dialog show is does not happen immediately
Qt 6.11 is out! See what's new in the release blog

[Solved] Dialog show is does not happen immediately

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.3k 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.
  • A Offline
    A Offline
    Abin
    wrote on last edited by
    #1

    I have a sever client application and in the beginning client loads data from server. I have a dialog showing status of getting data from server (has progress bar). But when I call the function the dialog appears with no contents in it with white background and suddenly changes to completed status.

    @void SystemScreen::loadServerData()
    {
    qDebug() << Q_FUNC_INFO << "Invoked";

    if (NULL != mpDataManagerDlg)
    {
        qDebug() << Q_FUNC_INFO << "show progres screen";
        mpDataManagerDlg->showScreen();
    }
    
    loadData();
    
    qDebug() << Q_FUNC_INFO << "Exits";
    

    }

    void SystemScreen::loadData()
    {
    qDebug() << Q_FUNC_INFO << "Invoked";

    if (NULL != mpDataManager)
    {
        mpDataManager->loadDataFromServer();
    }
    
    qDebug() << Q_FUNC_INFO << "Exits";
    

    }@

    I feel that dialog is displayed only after loadData() function is completed. Is there any alternative to do this?

    I used a timer to start @QTimer::singleShot(100, this, SLOT(loadData()));@ But then I have some trouble in getting data. ie data is empty if I read suddenly.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #2

      Hi,

      Try to put
      @
      qApp->processEvent();
      @

      Somewhere in your code, i had the same problem with my progress bar and this line works for me.

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Abin
        wrote on last edited by
        #3

        Thanks .. it works

        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
        • Unsolved