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. how to set alignment of combo box added in QTablewidget?

how to set alignment of combo box added in QTablewidget?

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 835 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.
  • V Offline
    V Offline
    veer
    wrote on last edited by
    #1

    hi I added combo box in one column of QtableWidget , All the functionality is fine styling of combo box is also Ok but I problem in positioning the combo box , I want to align it as Qt::AlignVCenter and I have no idea how to do it.
    QuoteSetup4.PNG

    m_grid is QtableWidget

    slabThicknessComboBox * temp9 = new slabThicknessComboBox(m_grid->rowCount() - 1,3,levelToAddToTable->getSlabDepth(),m_slabDepths,this);
        connect(this,SIGNAL(setComboBoxStylSheetSignal()),temp9,SLOT(setComboBoxStylSheetSlot()));
        emit setComboBoxStylSheetSignal();
    
        connect(temp9, SIGNAL(mouseEnteredBoxSignal(int)), this, SLOT(comboboxWasHovered(int)));
        connect(temp9,SIGNAL(indexChangeSignal(int,int,int)),this, SLOT(enablecellInGridClickedFromSlecBoxSlot(int ,int,int)));
    m_grid->setCellWidget(m_grid->rowCount() - 1, 3, temp9);
    
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Widgets placed on top of a cell with setCellWidget normally fill the whole cell
      so im not really sure what you want to align ?
      You mean the actual text of it / the items ?

      https://forum.qt.io/topic/49122/solved-qcombobox-align-center/3

      V 1 Reply Last reply
      0
      • mrjjM mrjj

        Hi
        Widgets placed on top of a cell with setCellWidget normally fill the whole cell
        so im not really sure what you want to align ?
        You mean the actual text of it / the items ?

        https://forum.qt.io/topic/49122/solved-qcombobox-align-center/3

        V Offline
        V Offline
        veer
        wrote on last edited by
        #3

        @mrjj thanks man problem is solved , actually I had issue with stylesheet.

        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