Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Qt Creator QTableview Questions
Forum Updated to NodeBB v4.3 + New Features

Qt Creator QTableview Questions

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
5 Posts 3 Posters 508 Views
  • 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.
  • OscarTheGrouchO Offline
    OscarTheGrouchO Offline
    OscarTheGrouch
    wrote on last edited by
    #1

    Hello All,
    Have some questions about QTableview.
    I have a QTableview based on a Custom Model/Delegate.
    It displays but has a few issues I'd like to fix.

    I originally wrote this code using (I think) Qt 4.8 when I had Linux Mint 18.0 MATE.
    After upgrade/install to LM 20 MATE, I had to get a new version of Qt Creator.
    I'm using version 6 (I think, it's hard to tell About says 4.13.3 based on 5.15.2 but Kit is 'Desktop Qt 6.0.0 GCC 64bit')
    Anyway, the App I was making before I'm trying to finish now and have it working OK with new version of Qt Creator, with a few issues.

    My QTableview doesn't stay on the main window if I click a menu item.
    The View also doesn't place itself at the very top and left side of the main window. Can't seem to find the method to set it there.
    It also doesn't display the complete view of ALL the columns and rows. I have set both with ..
    view->resizeColumnsToContents();
    view->resizeRowsToContents();
    The Table is 72 x 32.

    Last thing I made this using the Pixalator Example. As I remember, before my Tableview did not have a Window Title and Window Size controls before. The Pixalator Example does not show them either. Did that change or is there a way to set it that way?

    Thanks,
    OtG

    jsulmJ aha_1980A 2 Replies Last reply
    0
    • OscarTheGrouchO OscarTheGrouch

      Hello All,
      Have some questions about QTableview.
      I have a QTableview based on a Custom Model/Delegate.
      It displays but has a few issues I'd like to fix.

      I originally wrote this code using (I think) Qt 4.8 when I had Linux Mint 18.0 MATE.
      After upgrade/install to LM 20 MATE, I had to get a new version of Qt Creator.
      I'm using version 6 (I think, it's hard to tell About says 4.13.3 based on 5.15.2 but Kit is 'Desktop Qt 6.0.0 GCC 64bit')
      Anyway, the App I was making before I'm trying to finish now and have it working OK with new version of Qt Creator, with a few issues.

      My QTableview doesn't stay on the main window if I click a menu item.
      The View also doesn't place itself at the very top and left side of the main window. Can't seem to find the method to set it there.
      It also doesn't display the complete view of ALL the columns and rows. I have set both with ..
      view->resizeColumnsToContents();
      view->resizeRowsToContents();
      The Table is 72 x 32.

      Last thing I made this using the Pixalator Example. As I remember, before my Tableview did not have a Window Title and Window Size controls before. The Pixalator Example does not show them either. Did that change or is there a way to set it that way?

      Thanks,
      OtG

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @OscarTheGrouch said in Qt Creator QTableview Questions:

      The View also doesn't place itself at the very top and left side of the main window

      Do you use layouts to position it?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      OscarTheGrouchO 1 Reply Last reply
      1
      • OscarTheGrouchO OscarTheGrouch

        Hello All,
        Have some questions about QTableview.
        I have a QTableview based on a Custom Model/Delegate.
        It displays but has a few issues I'd like to fix.

        I originally wrote this code using (I think) Qt 4.8 when I had Linux Mint 18.0 MATE.
        After upgrade/install to LM 20 MATE, I had to get a new version of Qt Creator.
        I'm using version 6 (I think, it's hard to tell About says 4.13.3 based on 5.15.2 but Kit is 'Desktop Qt 6.0.0 GCC 64bit')
        Anyway, the App I was making before I'm trying to finish now and have it working OK with new version of Qt Creator, with a few issues.

        My QTableview doesn't stay on the main window if I click a menu item.
        The View also doesn't place itself at the very top and left side of the main window. Can't seem to find the method to set it there.
        It also doesn't display the complete view of ALL the columns and rows. I have set both with ..
        view->resizeColumnsToContents();
        view->resizeRowsToContents();
        The Table is 72 x 32.

        Last thing I made this using the Pixalator Example. As I remember, before my Tableview did not have a Window Title and Window Size controls before. The Pixalator Example does not show them either. Did that change or is there a way to set it that way?

        Thanks,
        OtG

        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi @OscarTheGrouch

        I'm using version 6 (I think, it's hard to tell About says 4.13.3 based on 5.15.2 but Kit is 'Desktop Qt 6.0.0 GCC 64bit')

        QtCreator is an IDE, Qt is a library. Your app is created with Creator, but uses just Qt.

        The same way, Creator uses Qt, in your case 5.15.2.

        Your app instead, will use Qt 6.0.

        I hope that cleared it a bit.

        Regard

        Qt has to stay free or it will die.

        OscarTheGrouchO 1 Reply Last reply
        2
        • aha_1980A aha_1980

          Hi @OscarTheGrouch

          I'm using version 6 (I think, it's hard to tell About says 4.13.3 based on 5.15.2 but Kit is 'Desktop Qt 6.0.0 GCC 64bit')

          QtCreator is an IDE, Qt is a library. Your app is created with Creator, but uses just Qt.

          The same way, Creator uses Qt, in your case 5.15.2.

          Your app instead, will use Qt 6.0.

          I hope that cleared it a bit.

          Regard

          OscarTheGrouchO Offline
          OscarTheGrouchO Offline
          OscarTheGrouch
          wrote on last edited by
          #4

          @aha_1980 Yes! Thanks.
          OtG

          1 Reply Last reply
          1
          • jsulmJ jsulm

            @OscarTheGrouch said in Qt Creator QTableview Questions:

            The View also doesn't place itself at the very top and left side of the main window

            Do you use layouts to position it?

            OscarTheGrouchO Offline
            OscarTheGrouchO Offline
            OscarTheGrouch
            wrote on last edited by
            #5

            @jsulm said in Qt Creator QTableview Questions:

            @OscarTheGrouch said in Qt Creator QTableview Questions:

            The View also doesn't place itself at the very top and left side of the main window

            Do you use layouts to position it?

            No, that seems to be the issue. My original program did not use the Designer so I did not include some of that code in my current version. Added this ..

            QWidget *centralWidget = new QWidget;
            
            QVBoxLayout *mainLayout = new QVBoxLayout;
            mainLayout->addWidget(view);
            centralWidget->setLayout(mainLayout);
            setCentralWidget(centralWidget);
            

            And it works now as expected. Thanks!!
            OtG

            1 Reply Last reply
            1

            • Login

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