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. [SOLVED] progress bar problem
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] progress bar problem

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 806 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.
  • H Offline
    H Offline
    habbas33
    wrote on last edited by
    #1

    hello , i want to update a progress bar from the function in a external file but i am unable to call the object and it says

    error: C2143: syntax error : missing ';' before '.'
    for code Ui::subwindow.progressbar.setValue(value+1) //can be seen below

    please guide how to solve the problem

    ---------file.cpp-----------------
    @include <otherfile.h>
    include ....

    subwindow::subwindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::subwindow)
    {
    ui->setupUi(this);
    fxn();
    }

    int subwindow::fxn
    {
    ui->progress_bar->setMinimum(0);
    ui->progress_bar->setMaximum(100);
    abc(x,y);
    }@

    ---------------------------------otherfile.cpp---------
    @include <file.h>

    abc(int x,int y)
    {
    value = Ui::subwindow.progressbar->value();
    do {
    if (xxx == false)
    Ui::subwindow.progressbar->setValue(value+1)
    } while (xxx =! false);

    }@

    qxoz: code tags added

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      You are calling the class directly. You need to access your progress bar through object. In this example

      It should be like

      <object ofsubwindow class>.ui->progress_bar->setvalue(10)

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        qxoz
        wrote on last edited by
        #3

        You need fix compilation error at first. Add ; after Ui::subwindow.progressbar->setValue(value+1) .

        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