Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Unsolved Q table widget problem, Urgent!!!!!!

    General and Desktop
    qtablewidget
    3
    16
    4825
    Loading More Posts
    • 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.
    • ?
      A Former User last edited by

      Maybe the workaround mentioned in QTBUG-7483 can help.

      1 Reply Last reply Reply Quote 0
      • kshegunov
        kshegunov Moderators @Guest last edited by

        @VInay123 said:

        i have created a 3 table widget using designer, and their respective items has been declered in the header files.

        What items are declared in the header, how and why? Please show how you populate the widget(s) and other relevant pieces of the code.

        I cannot use tableview.

        You are already using a table view. QTableWidget derives from QTableView.

        Also what version of Qt are you using?

        Read and abide by the Qt Code of Conduct

        ? 1 Reply Last reply Reply Quote 1
        • ?
          A Former User @kshegunov last edited by

          @kshegunov
          From the designer i get a header file where the Qtablewidget is declared.

          I have a separate cpp and header file for development process, this header file has the inclusion of the header file obtained from designer.

          In the development header file i declare a pointer of Qtablewidget items[][];

          and in cpp the constructor i populate the items so a table is created .

          and in my funtion i fill the table

          I use qt 4.7.8

          ? 1 Reply Last reply Reply Quote 0
          • ?
            A Former User @Guest last edited by

            @VInay123 said:

            I use qt 4.7.8

            Ok, then it's clearly the bug I refered to before, QTBUG-7483.

            1 Reply Last reply Reply Quote 2
            • ?
              A Former User last edited by

              @Wieland when we click the column names of the table widget i get a small arrow inside and sorting happens one click ascending and one click descending. How do i disable it?? i tried setsortingenabled(false) but its still sorting

              ? 2 Replies Last reply Reply Quote 0
              • ?
                A Former User @Guest last edited by

                @VInay123 I can only test it with Qt 5.6. With this, in the designer there is a property sortingEnabled. When this isn't selected I don't get the small arrow and clicking the header does not cause any sorting.

                1 Reply Last reply Reply Quote 2
                • ?
                  A Former User @Guest last edited by

                  @VInay123 Also with Qt 5.6 ascending and descending sorting works as expected. Can't you update to a more recent Qt version?

                  ? 2 Replies Last reply Reply Quote 0
                  • ?
                    A Former User @Guest last edited by

                    @Wieland I havent check that box of sort enabled in the property box, but it is in bold compared to other properties. And because i work with a other software called ADTF , higher versions are not compatible :(

                    1 Reply Last reply Reply Quote 0
                    • ?
                      A Former User @Guest last edited by

                      @Wieland
                      I have a question, i think i could use the signal when i click header.

                      Actually with designer i have created rows and column names. now i would like to use the signal when i click the column.
                      right now i use QObject::connect(ui.tablewidget->verticalheader(), SIGNAL(sectionPressed(int)), this, SLOT(function(int))).
                      But i am never receiving a signal. I tried using sectionClicked(int) or sectionDoubleClicked(int). which is an approporiate one to know whther a user has clicked the header or column name ones or twice?

                      ? 1 Reply Last reply Reply Quote 0
                      • ?
                        A Former User @Guest last edited by

                        @VInay123 Hi! This works for me (Qt 5.6):

                        connect( ui->tableWidget->verticalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(sayHi()) );
                        
                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post