Results 1 to 17 of 17

Thread: how to create column headers by selecting radiobuttons and checkboxes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2013
    Posts
    18
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to create column headers by selecting radiobuttons and checkboxes

    this is mainwindow.cpp content

    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4. MainWindow::MainWindow(QWidget *parent) :
    5. QMainWindow(parent),
    6. ui(new Ui::MainWindow)
    7. {
    8. ui->setupUi(this);
    9. }
    10.  
    11. MainWindow::~MainWindow()
    12. {
    13. delete ui;
    14. }
    15.  
    16. void MainWindow::on_pushButton_clicked()
    17. {
    18. QString name = ui->checkBox->text();
    19. ui->checkBox->setChecked(true);
    20. if(ui->checkBox_2->text() == name) ui->checkBox_2->setChecked(true);
    21. if(ui->checkBox_3->text() == name) ui->checkBox_3->setChecked(true);
    22. }
    To copy to clipboard, switch view to plain text mode 

    other files are same (mainwindow.h,main.cpp and .pro files)

    .ui file appearance

    ui_file.png

  2. #2
    Join Date
    Sep 2013
    Posts
    25
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to create column headers by selecting radiobuttons and checkboxes

    But how does that relate to creating columns with the same name as the checkboxes??

  3. #3
    Join Date
    Jul 2013
    Posts
    18
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: how to create column headers by selecting radiobuttons and checkboxes

    sorry , I'll try on it

Similar Threads

  1. How to add 2 column of RadioButtons in qtableview ?
    By smichaud in forum Qt Programming
    Replies: 1
    Last Post: 23rd July 2011, 08:52
  2. Replies: 3
    Last Post: 9th May 2011, 17:23
  3. QTableView column-headers too short ...
    By kerim in forum Newbie
    Replies: 2
    Last Post: 20th April 2011, 09:09
  4. Replies: 1
    Last Post: 16th April 2010, 21:59
  5. QTableView + column span of headers
    By NoRulez in forum Qt Programming
    Replies: 2
    Last Post: 11th November 2009, 14:29

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.