Results 1 to 4 of 4

Thread: Combining two guis into one widget

  1. #1
    Join Date
    Jan 2020
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Combining two guis into one widget

    im trying to add my widget to another persons widget, we are both working on the same project but im not as adept in qt as he is and he is busy with another project, im trying to out how to add my widget to his, the My_widget is where my widget is suppose to go in his

    self.centralWidget.setObjectName("centralWidget")
    self.verticalLayout = QtWidgets.QVBoxLayout(self.centralWidget)
    self.verticalLayout.setSpacing(0)
    self.verticalLayout.setContentsMargins(0, 0, 0, 0)
    self.verticalLayout.setObjectName("verticalLayout" )
    self.splitter_2 = QtWidgets.QSplitter(self.centralWidget)
    self.splitter_2.setOrientation(QtCore.Qt.Horizonta l)
    self.splitter_2.setObjectName("splitter_2")
    self.My_Widget = QtWidgets.QWidget(self.splitter_2)
    sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Prefer red, QtWidgets.QSizePolicy.Preferred)
    sizePolicy.setHorizontalStretch(0)
    sizePolicy.setVerticalStretch(0)
    sizePolicy.setHeightForWidth(self.My_Widget.sizePo licy().hasHeightForWidth())
    self.My_Widget.setSizePolicy(sizePolicy)
    self.My_Widget.setMinimumSize(QtCore.QSize(200, 100))
    self.My_Widget.setStyleSheet("background-color: rgb(200, 200, 200);\n"
    "border: 3px solid grey;")
    self.Jodies_Widget.setObjectName("My_Widget")

    self.tabWidget = QtWidgets.QTabWidget(self.splitter_2)
    sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expand ing, QtWidgets.QSizePolicy.Expanding)
    sizePolicy.setHorizontalStretch(0)
    sizePolicy.setVerticalStretch(0)
    sizePolicy.setHeightForWidth(self.tabWidget.sizePo licy().hasHeightForWidth())
    self.tabWidget.setSizePolicy(sizePolicy)
    self.tabWidget.setMinimumSize(QtCore.QSize(0, 0))
    self.tabWidget.setStyleSheet("")
    self.tabWidget.setTabBarAutoHide(False)
    self.tabWidget.setObjectName("tabWidget")
    self.tab_1 = QtWidgets.QWidget()
    self.tab_1.setObjectName("tab_1")
    self.gridLayout = QtWidgets.QGridLayout(self.tab_1)
    self.gridLayout.setObjectName("gridLayout")
    self.verticalLayout_2 = QtWidgets.QVBoxLayout()
    self.verticalLayout_2.setObjectName("verticalLayou t_2")
    self.label_33 = QtWidgets.QLabel(self.tab_1)
    self.label_33.setStyleSheet("")
    self.label_33.setObjectName("label_33")
    self.verticalLayout_2.addWidget(self.label_33)
    self.label_34 = QtWidgets.QLabel(self.tab_1)

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Combining two guis into one widget

    If your "another person" is the forum user named "AzureSkgale", then the question has already been addressed. Reply to that thread, don't double post.

    And as ChrisW67 said in his answer, it isn't clear at all which "two widgets" you want to "add" and how.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jan 2020
    Posts
    2
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: Combining two guis into one widget

    not sure if he is he might but im trying to add the other widget by creating a button, i cant post everything due limitations on what can be sent i posted where i was stuck

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Combining two guis into one widget

    OK, maybe it isn't the same person, but it is a bit suspicious when two posts under different user names contain identical code...

    You have to understand that we have no idea from the piece of code you have both posted what you are trying to do, and we can't tell from the code what you expect your UI to look like. You have many widgets declared in your code - a "central widget" of some type, a QSplitter, several QWidget instances, a tab widget, two QLabel widgets, something called "Jodies_Widget", and a bunch of layouts.

    So when you say you want to "add my widget to another person's widget" we have no clue what that means.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Combining events in QT
    By kinglui987 in forum Qt Programming
    Replies: 5
    Last Post: 7th November 2012, 15:18
  2. Qt Designer making dynamic GUIs
    By JeffMGreg in forum Qt Tools
    Replies: 1
    Last Post: 8th October 2011, 09:32
  3. Problem with GUIs
    By trallallero in forum Qt Programming
    Replies: 4
    Last Post: 28th October 2009, 16:08
  4. Widgets combining CSS and SVG
    By yop in forum Qt Programming
    Replies: 3
    Last Post: 15th October 2008, 11:02
  5. Any Toolkit for designing VisualStudio-like GUIs?
    By burn2themax in forum Qt Programming
    Replies: 11
    Last Post: 29th July 2006, 11:00

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.