Results 1 to 2 of 2

Thread: multiply a widget by pushing a button

  1. #1
    Join Date
    Oct 2015
    Posts
    1
    Qt products
    PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default multiply a widget by pushing a button

    Hi everybody,
    I'm quite new in Qt programming and i'm facing a problem.
    Here is what I want to do :
    going from
    Capture du 2015-10-25 17:57:26.jpg
    to
    Capture du 2015-10-25 17:57:05.jpg

    by pushing the 'Add' button.
    I'veput the 3 comboboxes in a gridlayout and trying to insert signal/slot in to the 'Add' button to multiply le layout but it doesnt work. I'm doing this under Qt Designer.

    Please help and sorry for my english i'm not fluent.

    Thanks

  2. #2
    Join Date
    Oct 2009
    Location
    Germany
    Posts
    120
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: multiply a widget by pushing a button

    Hello,

    so what's your problem with this? What have you tried so far?

    Here is how I would do it, assuming that your grid layout is in the main window:
    1. Create a slot addRow() to your main window class and connect that to your Add button. Connection can be done in designer.
    2. Implement the addRow() method to work as follows:
    - determine the current number of rows of your grid layout and store it in a variable rows (http://doc.qt.io/qt-4.8/qgridlayout.html#rowCount)
    - Add 3 new QComboBox instances into a new row (corresponding to row index rows) and columns 0, 1, 2. See http://doc.qt.io/qt-4.8/qgridlayout.html#addWidget

    Best regards
    ars

Similar Threads

  1. Replies: 2
    Last Post: 2nd July 2013, 05:52
  2. Multiply defined symbols found - compiling with VC++
    By bmahf in forum Installation and Deployment
    Replies: 1
    Last Post: 20th October 2009, 16:05
  3. Multiply defined symbols
    By jblovloss in forum Qwt
    Replies: 0
    Last Post: 17th July 2009, 17:47
  4. Linking problems with multiply defined symbols
    By JimBrown in forum Qt Programming
    Replies: 5
    Last Post: 2nd March 2007, 17:48
  5. QRegion multiply
    By xgoan in forum Qt Programming
    Replies: 1
    Last Post: 4th August 2006, 10:54

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.