[beginner] Scrollbars in QTableWidget not clickable by mouse



  • I have written the following simple code:
    @#include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QTableWidget>

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    QTableWidget *peter = new QTableWidget(this);
    peter->resize(200,200);
    peter->setRowCount(10);
    peter->setColumnCount(5);
    peter->move(50,50);
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    @

    The QTableWidget shows fine. I can navigate the table using the arrow keys on the keyboard. It shows scrollbars (vertical and horizontical)

    but

    the scrollbar-up/down buttons and the bar itself are not clickable/dragable with the mouse. Any idea how to fix this?

    edit: included mainwindow.h and ui_mainwindow.h in header


  • Moderators

    it's definitely not caused by the code you posted. So there must be somewhere else the reason for this issue.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.