Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QProgressDialog Cannot show its contents

QProgressDialog Cannot show its contents

Scheduled Pinned Locked Moved General and Desktop
5 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.
  • L Offline
    L Offline
    Lohia
    wrote on last edited by
    #1

    !http://tieba.baidu.com/photo/p?kw=qt&flux=1&tid=2493730139&pic_id=d31b0ef41bd5ad6e0b05ae1280cb39dbb7fd3c4e&pn=1&see_lz=1(123)!

    Following code can perform progressbar in other functions but not this
    @QProgressDialog *progressDlg = new QProgressDialog;
    progressDlg->setWindowModality(Qt::WindowModal);
    progressDlg->setModal(true);
    progressDlg->show();
    progressDlg->setWindowTitle("Loading...");
    progressDlg->setRange(1, n);

    for(int i = 1; i <= n; ++i)
    {
    Taxi t;
    char fileName[256];
    sprintf(fileName, "%s%d%s", fileDir, i, ".txt");
    progressDlg->setValue(i);
    progressDlg->setLabelText(fileName);
    t.readData(fileName);

    if(t.getId() != -1)
    m_vTaxi.push_back(t);
    }@

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lohia
      wrote on last edited by
      #2

      !http://tieba.baidu.com/photo/p?kw=qt&flux=1&tid=2493730139&pic_id=d31b0ef41bd5ad6e0b05ae1280cb39dbb7fd3c4e&pn=1&see_lz=1#!/pid0e681330e924b89942a1b3c06f061d950b7bf67e/pn1(sd)!

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

        Hi and welcome to devnet,

        Since your modifying QProgressDialog modality, I guess that the call to setValue doesn't call processEvents(), you'll have to do it in your loop.

        Hope it helps

        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
        • L Offline
          L Offline
          Lohia
          wrote on last edited by
          #4

          [quote author="SGaist" date="1375091635"]Hi and welcome to devnet,

          Since your modifying QProgressDialog modality, I guess that the call to setValue doesn't call processEvents(), you'll have to do it in your loop.

          Hope it helps[/quote]
          Thanks a lot ! It really helps!

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

            You're welcome !

            If this solves your problem, you can update the thread's title to solved so other forum users may know that a solution has been found :)

            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

            • Login

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