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. QTableWidget with QPushbutton inside: resize problem
Forum Updated to NodeBB v4.3 + New Features

QTableWidget with QPushbutton inside: resize problem

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 550 Views 2 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
    pogmat
    wrote on last edited by
    #1

    I'm an absolute beginner of Qt. I have the following MWE.

    #include <QApplication>
    #include <QTableWidget>
    #include <QPushButton>
    
    int main(int argc, char *argv[])
    {
        QApplication a(argc, argv);
        QTableWidget table;
    
        table.setRowCount(2);
        table.setColumnCount(3);
    	
        QPushButton button("Push me");
    
        table.setCellWidget(1, 1, &button);
        
        table.show();
    
        return a.exec();
    }
    

    I notice that when I resize the column of the table holding the mousebutton down the PushButton remain of the same dimension and it adjust to the correct size only when the mousebutton is released. Is this a wanted feature. How can I avoid it?

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

      Hi and welcome to devnet,

      What version of Qt ?
      On what platform ?

      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
      2
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi
        Win 10, Qt 5.14

        alt text

        1 Reply Last reply
        2
        • P Offline
          P Offline
          pogmat
          wrote on last edited by pogmat
          #4

          Hi,
          I have the following setups

          1. Qt 5.15.0 on Linux
          2. Qt 5.15.0 on Linux with PySide2
          3. Qt 5.15.0 on Windows

          resize.png

          I always get the same result.
          Do you think it is a regression?

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

            Looks like it yes.

            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