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. Need help of code to create a protoptype
Forum Updated to NodeBB v4.3 + New Features

Need help of code to create a protoptype

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 399 Views 1 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by
    #1

    0_1544461380167_Temp444.png

    #include "mainwindow.h"
    #include <QHeaderView>

    myWidget::myWidget(QWidget* parent): QWidget(parent) {

    QLabel* label = new QLabel("Options");
    QPushButton * button22 = new QPushButton;
    button22->setText("+");
    QHBoxLayout* hbox1 = new QHBoxLayout ;
    
    button22->setText("+");
    
    hbox1->addWidget(label);
    hbox1->addWidget(button22);
    setLayout(hbox1);
    

    }

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent)
    {

    QTableWidget * t = new QTableWidget;
    t->setColumnCount(5);
    t->setRowCount(3);
    QStringList headerLabels;

    QString col1 = "No of Mappings";
    QString col2 = "Set";

    QString col3 = "Type";

    QString col4 = " Mapping rules : spec_string : spec_string2 ";

    QString col5 = "Options";

    headerLabels << col1 << col2 << col3 << col4 << col5;
    t->setHorizontalHeaderLabels(headerLabels);
    QTableWidgetItem* item = new QTableWidgetItem;
    item->setText("Cell");
    t->setColumnWidth(3,50);

    myWidget* myWid = new myWidget;
    //t->setCellWidget(1,1,myWid);

    t->verticalHeader()->hide();

    t->show();

    }

    MainWindow::~MainWindow()
    {

    }

    Need help in creating the Table . Please help me in coding

    jsulmJ 1 Reply Last reply
    -1
    • Q Qt Enthusiast

      0_1544461380167_Temp444.png

      #include "mainwindow.h"
      #include <QHeaderView>

      myWidget::myWidget(QWidget* parent): QWidget(parent) {

      QLabel* label = new QLabel("Options");
      QPushButton * button22 = new QPushButton;
      button22->setText("+");
      QHBoxLayout* hbox1 = new QHBoxLayout ;
      
      button22->setText("+");
      
      hbox1->addWidget(label);
      hbox1->addWidget(button22);
      setLayout(hbox1);
      

      }

      MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent)
      {

      QTableWidget * t = new QTableWidget;
      t->setColumnCount(5);
      t->setRowCount(3);
      QStringList headerLabels;

      QString col1 = "No of Mappings";
      QString col2 = "Set";

      QString col3 = "Type";

      QString col4 = " Mapping rules : spec_string : spec_string2 ";

      QString col5 = "Options";

      headerLabels << col1 << col2 << col3 << col4 << col5;
      t->setHorizontalHeaderLabels(headerLabels);
      QTableWidgetItem* item = new QTableWidgetItem;
      item->setText("Cell");
      t->setColumnWidth(3,50);

      myWidget* myWid = new myWidget;
      //t->setCellWidget(1,1,myWid);

      t->verticalHeader()->hide();

      t->show();

      }

      MainWindow::~MainWindow()
      {

      }

      Need help in creating the Table . Please help me in coding

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

      @Qt-Enthusiast said in Need help of code to create a protoptype:

      Please help me in coding

      Please ask specific questions. This is a forum and not outsourcing company...
      What does not work?
      I don't see you doing anything with item.

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

      1 Reply Last reply
      1
      • dheerendraD Offline
        dheerendraD Offline
        dheerendra
        Qt Champions 2022
        wrote on last edited by dheerendra
        #3

        @Qt-Enthusiast I think you asked this question many times. People in the group have already given you so much of information. You need to read the documents & links given to you. Once you do some prototype, ask very specific question to group. They will help. No body will help in coding for you.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply
        2
        • Q Offline
          Q Offline
          Qt Enthusiast
          wrote on last edited by
          #4

          Thanks I will take care

          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