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. get rid of ugly background on qprogressbar

get rid of ugly background on qprogressbar

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 670 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.
  • P Offline
    P Offline
    phirestalker
    wrote on last edited by phirestalker
    #1

    I have created a qprogressbar programmatically and it is showing up with a grey background darker than the grey the statusbar has. I want to know what might be causing it and how to remove it. Here is the relevant code area

        progress = new QProgressBar(this);
        statuslabel.setText("Idle");
        progress->setVisible(true);
        progress->setMinimum(0);
        progress->setMaximum(0);
        ui->statusbar->addWidget(&statuslabel);
        ui->statusbar->addPermanentWidget(progress);
        ui->statusbar->update();
    
    

    and here is where they are declared

    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        QProgressBar *progress;
        QLabel statuslabel;
        QStringList videofiles;
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
        void processDir(QString file);
        QSqlDatabase db;
    
    private slots:
        void on_actionPreferences_triggered();
    
        void on_actionExit_triggered();
    
        void on_addFilesButton_clicked();
    
        void on_scanFilesList_itemSelectionChanged();
    
        void on_removeFilesbutton_clicked();
    
        void on_startButton_clicked();
    
        void on_actionOpen_triggered();
    
    private:
        Ui::MainWindow *ui;
        QString cfgfile;
        bool scanloaded;
        void closeEvent(QCloseEvent *event);
        bool userReallyWantsToQuit();
    };
    

    I am on osx 10.11.2

    1 Reply Last reply
    0
    • P Offline
      P Offline
      phirestalker
      wrote on last edited by phirestalker
      #2

      now the background is the matching color for the statusbar, but I didn't change anything that I can see, what the heck?

      ok I see what's happening, when the app first launches the background for qprogressbar is wrong, but if I turn focus to another app and then back it paints it with the correct background color. What could cause that?

      ok edit again. Now I notice that it is the statusbar that is originally painted with a lighter grey and IT is the one repainted when I change focus back to the app, maybe if I set the palette of the statusbar. Maybe the way I created it doesn't use the qapplication default palette?

      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