adding Image to tab












2














i have encountered another problem maybe you all could help with i cant seem to add a photo to any of my tabs could you help?



here is my code



import sys
import webbrowser
import random
import time
import os
from PyQt4.QtGui import QApplication, QMainWindow, QPushButton, QWidget, QIcon, QLabel, QPixmap


class UICreator(QWidget): # |||| CREATOR TAB |||
def __init__(self, parent=None):
super(UICreator, self).__init__(parent)

self.Back = QPushButton("<- Back", self)
self.Back.resize(50, 25)
self.Back.move(0, 425)
self.Creator = QPushButton("YouTube", self)
self.Creator.resize(100, 40)
self.Creator.move(25, 50)
self.CreatorB2 = QPushButton("Twitter", self)
self.CreatorB2.resize(100, 40)
self.CreatorB2.move(275, 50)
self.CreatorL = QLabel("Created By: PapaKliffy", self)
self.CreatorL.move(20, 350)


MainWindow here



def startUICreatorTab(self):

self.Creator = UICreator(self)
self.setWindowTitle("Kliffy's SS Tool V2.0 | Creator Tab")
self.setCentralWidget(self.Creator)
self.Creator.Back.clicked.connect(self.startUIWindow)
self.Creator.Creator.clicked.connect(self.Kliffy)
self.Creator.CreatorB2.clicked.connect(self.Kliffy2)
self.show()









share|improve this question
























  • You want to put pictures to the buttons? Because I do not see any tab.
    – eyllanesc
    Dec 24 '16 at 0:55










  • explain more please
    – eyllanesc
    Dec 24 '16 at 1:15










  • prntscr.com/dna24j
    – Tyrell
    Dec 24 '16 at 1:18










  • this is what i have i just want to add a picture to the back of it not sure on how to do so
    – Tyrell
    Dec 24 '16 at 1:19










  • Do you want to add a background image?
    – eyllanesc
    Dec 24 '16 at 1:27
















2














i have encountered another problem maybe you all could help with i cant seem to add a photo to any of my tabs could you help?



here is my code



import sys
import webbrowser
import random
import time
import os
from PyQt4.QtGui import QApplication, QMainWindow, QPushButton, QWidget, QIcon, QLabel, QPixmap


class UICreator(QWidget): # |||| CREATOR TAB |||
def __init__(self, parent=None):
super(UICreator, self).__init__(parent)

self.Back = QPushButton("<- Back", self)
self.Back.resize(50, 25)
self.Back.move(0, 425)
self.Creator = QPushButton("YouTube", self)
self.Creator.resize(100, 40)
self.Creator.move(25, 50)
self.CreatorB2 = QPushButton("Twitter", self)
self.CreatorB2.resize(100, 40)
self.CreatorB2.move(275, 50)
self.CreatorL = QLabel("Created By: PapaKliffy", self)
self.CreatorL.move(20, 350)


MainWindow here



def startUICreatorTab(self):

self.Creator = UICreator(self)
self.setWindowTitle("Kliffy's SS Tool V2.0 | Creator Tab")
self.setCentralWidget(self.Creator)
self.Creator.Back.clicked.connect(self.startUIWindow)
self.Creator.Creator.clicked.connect(self.Kliffy)
self.Creator.CreatorB2.clicked.connect(self.Kliffy2)
self.show()









share|improve this question
























  • You want to put pictures to the buttons? Because I do not see any tab.
    – eyllanesc
    Dec 24 '16 at 0:55










  • explain more please
    – eyllanesc
    Dec 24 '16 at 1:15










  • prntscr.com/dna24j
    – Tyrell
    Dec 24 '16 at 1:18










  • this is what i have i just want to add a picture to the back of it not sure on how to do so
    – Tyrell
    Dec 24 '16 at 1:19










  • Do you want to add a background image?
    – eyllanesc
    Dec 24 '16 at 1:27














2












2








2







i have encountered another problem maybe you all could help with i cant seem to add a photo to any of my tabs could you help?



here is my code



import sys
import webbrowser
import random
import time
import os
from PyQt4.QtGui import QApplication, QMainWindow, QPushButton, QWidget, QIcon, QLabel, QPixmap


class UICreator(QWidget): # |||| CREATOR TAB |||
def __init__(self, parent=None):
super(UICreator, self).__init__(parent)

self.Back = QPushButton("<- Back", self)
self.Back.resize(50, 25)
self.Back.move(0, 425)
self.Creator = QPushButton("YouTube", self)
self.Creator.resize(100, 40)
self.Creator.move(25, 50)
self.CreatorB2 = QPushButton("Twitter", self)
self.CreatorB2.resize(100, 40)
self.CreatorB2.move(275, 50)
self.CreatorL = QLabel("Created By: PapaKliffy", self)
self.CreatorL.move(20, 350)


MainWindow here



def startUICreatorTab(self):

self.Creator = UICreator(self)
self.setWindowTitle("Kliffy's SS Tool V2.0 | Creator Tab")
self.setCentralWidget(self.Creator)
self.Creator.Back.clicked.connect(self.startUIWindow)
self.Creator.Creator.clicked.connect(self.Kliffy)
self.Creator.CreatorB2.clicked.connect(self.Kliffy2)
self.show()









share|improve this question















i have encountered another problem maybe you all could help with i cant seem to add a photo to any of my tabs could you help?



here is my code



import sys
import webbrowser
import random
import time
import os
from PyQt4.QtGui import QApplication, QMainWindow, QPushButton, QWidget, QIcon, QLabel, QPixmap


class UICreator(QWidget): # |||| CREATOR TAB |||
def __init__(self, parent=None):
super(UICreator, self).__init__(parent)

self.Back = QPushButton("<- Back", self)
self.Back.resize(50, 25)
self.Back.move(0, 425)
self.Creator = QPushButton("YouTube", self)
self.Creator.resize(100, 40)
self.Creator.move(25, 50)
self.CreatorB2 = QPushButton("Twitter", self)
self.CreatorB2.resize(100, 40)
self.CreatorB2.move(275, 50)
self.CreatorL = QLabel("Created By: PapaKliffy", self)
self.CreatorL.move(20, 350)


MainWindow here



def startUICreatorTab(self):

self.Creator = UICreator(self)
self.setWindowTitle("Kliffy's SS Tool V2.0 | Creator Tab")
self.setCentralWidget(self.Creator)
self.Creator.Back.clicked.connect(self.startUIWindow)
self.Creator.Creator.clicked.connect(self.Kliffy)
self.Creator.CreatorB2.clicked.connect(self.Kliffy2)
self.show()






python pyqt pyqt4 qimage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 4:27









eyllanesc

73.7k103056




73.7k103056










asked Dec 24 '16 at 0:27









Tyrell

2312719




2312719












  • You want to put pictures to the buttons? Because I do not see any tab.
    – eyllanesc
    Dec 24 '16 at 0:55










  • explain more please
    – eyllanesc
    Dec 24 '16 at 1:15










  • prntscr.com/dna24j
    – Tyrell
    Dec 24 '16 at 1:18










  • this is what i have i just want to add a picture to the back of it not sure on how to do so
    – Tyrell
    Dec 24 '16 at 1:19










  • Do you want to add a background image?
    – eyllanesc
    Dec 24 '16 at 1:27


















  • You want to put pictures to the buttons? Because I do not see any tab.
    – eyllanesc
    Dec 24 '16 at 0:55










  • explain more please
    – eyllanesc
    Dec 24 '16 at 1:15










  • prntscr.com/dna24j
    – Tyrell
    Dec 24 '16 at 1:18










  • this is what i have i just want to add a picture to the back of it not sure on how to do so
    – Tyrell
    Dec 24 '16 at 1:19










  • Do you want to add a background image?
    – eyllanesc
    Dec 24 '16 at 1:27
















You want to put pictures to the buttons? Because I do not see any tab.
– eyllanesc
Dec 24 '16 at 0:55




You want to put pictures to the buttons? Because I do not see any tab.
– eyllanesc
Dec 24 '16 at 0:55












explain more please
– eyllanesc
Dec 24 '16 at 1:15




explain more please
– eyllanesc
Dec 24 '16 at 1:15












prntscr.com/dna24j
– Tyrell
Dec 24 '16 at 1:18




prntscr.com/dna24j
– Tyrell
Dec 24 '16 at 1:18












this is what i have i just want to add a picture to the back of it not sure on how to do so
– Tyrell
Dec 24 '16 at 1:19




this is what i have i just want to add a picture to the back of it not sure on how to do so
– Tyrell
Dec 24 '16 at 1:19












Do you want to add a background image?
– eyllanesc
Dec 24 '16 at 1:27




Do you want to add a background image?
– eyllanesc
Dec 24 '16 at 1:27












1 Answer
1






active

oldest

votes


















1














You must be override paintEvent



import sys

from PyQt4.QtCore import QSize
from PyQt4.QtGui import QApplication, QPainter, QPixmap, QPushButton, QWidget, QLabel


class UICreator(QWidget): # |||| CREATOR TAB |||
def __init__(self, parent=None):
super(UICreator, self).__init__(parent)
self.resize(QSize(450, 450))
self.Back = QPushButton("<- Back", self)
self.Back.resize(50, 25)
self.Back.move(0, 425)
self.Creator = QPushButton("Youtube", self)
self.Creator.resize(100, 40)
self.Creator.move(50, 50)
self.CreatorB2 = QPushButton("Twitter", self)
self.CreatorB2.resize(100, 40)
self.CreatorB2.move(275, 50)
self.CreatorL = QLabel("Created By: PapaKliffy", self)
self.CreatorL.move(20, 350)

def paintEvent(self, event):
painter = QPainter(self)
painter.drawPixmap(self.rect(), QPixmap("background.jpg"))


if __name__ == '__main__':
app = QApplication(sys.argv)
w = UICreator()
w.show()
sys.exit(app.exec_())


background.png:



enter image description here



Output:



enter image description here






share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41309243%2fadding-image-to-tab%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    You must be override paintEvent



    import sys

    from PyQt4.QtCore import QSize
    from PyQt4.QtGui import QApplication, QPainter, QPixmap, QPushButton, QWidget, QLabel


    class UICreator(QWidget): # |||| CREATOR TAB |||
    def __init__(self, parent=None):
    super(UICreator, self).__init__(parent)
    self.resize(QSize(450, 450))
    self.Back = QPushButton("<- Back", self)
    self.Back.resize(50, 25)
    self.Back.move(0, 425)
    self.Creator = QPushButton("Youtube", self)
    self.Creator.resize(100, 40)
    self.Creator.move(50, 50)
    self.CreatorB2 = QPushButton("Twitter", self)
    self.CreatorB2.resize(100, 40)
    self.CreatorB2.move(275, 50)
    self.CreatorL = QLabel("Created By: PapaKliffy", self)
    self.CreatorL.move(20, 350)

    def paintEvent(self, event):
    painter = QPainter(self)
    painter.drawPixmap(self.rect(), QPixmap("background.jpg"))


    if __name__ == '__main__':
    app = QApplication(sys.argv)
    w = UICreator()
    w.show()
    sys.exit(app.exec_())


    background.png:



    enter image description here



    Output:



    enter image description here






    share|improve this answer


























      1














      You must be override paintEvent



      import sys

      from PyQt4.QtCore import QSize
      from PyQt4.QtGui import QApplication, QPainter, QPixmap, QPushButton, QWidget, QLabel


      class UICreator(QWidget): # |||| CREATOR TAB |||
      def __init__(self, parent=None):
      super(UICreator, self).__init__(parent)
      self.resize(QSize(450, 450))
      self.Back = QPushButton("<- Back", self)
      self.Back.resize(50, 25)
      self.Back.move(0, 425)
      self.Creator = QPushButton("Youtube", self)
      self.Creator.resize(100, 40)
      self.Creator.move(50, 50)
      self.CreatorB2 = QPushButton("Twitter", self)
      self.CreatorB2.resize(100, 40)
      self.CreatorB2.move(275, 50)
      self.CreatorL = QLabel("Created By: PapaKliffy", self)
      self.CreatorL.move(20, 350)

      def paintEvent(self, event):
      painter = QPainter(self)
      painter.drawPixmap(self.rect(), QPixmap("background.jpg"))


      if __name__ == '__main__':
      app = QApplication(sys.argv)
      w = UICreator()
      w.show()
      sys.exit(app.exec_())


      background.png:



      enter image description here



      Output:



      enter image description here






      share|improve this answer
























        1












        1








        1






        You must be override paintEvent



        import sys

        from PyQt4.QtCore import QSize
        from PyQt4.QtGui import QApplication, QPainter, QPixmap, QPushButton, QWidget, QLabel


        class UICreator(QWidget): # |||| CREATOR TAB |||
        def __init__(self, parent=None):
        super(UICreator, self).__init__(parent)
        self.resize(QSize(450, 450))
        self.Back = QPushButton("<- Back", self)
        self.Back.resize(50, 25)
        self.Back.move(0, 425)
        self.Creator = QPushButton("Youtube", self)
        self.Creator.resize(100, 40)
        self.Creator.move(50, 50)
        self.CreatorB2 = QPushButton("Twitter", self)
        self.CreatorB2.resize(100, 40)
        self.CreatorB2.move(275, 50)
        self.CreatorL = QLabel("Created By: PapaKliffy", self)
        self.CreatorL.move(20, 350)

        def paintEvent(self, event):
        painter = QPainter(self)
        painter.drawPixmap(self.rect(), QPixmap("background.jpg"))


        if __name__ == '__main__':
        app = QApplication(sys.argv)
        w = UICreator()
        w.show()
        sys.exit(app.exec_())


        background.png:



        enter image description here



        Output:



        enter image description here






        share|improve this answer












        You must be override paintEvent



        import sys

        from PyQt4.QtCore import QSize
        from PyQt4.QtGui import QApplication, QPainter, QPixmap, QPushButton, QWidget, QLabel


        class UICreator(QWidget): # |||| CREATOR TAB |||
        def __init__(self, parent=None):
        super(UICreator, self).__init__(parent)
        self.resize(QSize(450, 450))
        self.Back = QPushButton("<- Back", self)
        self.Back.resize(50, 25)
        self.Back.move(0, 425)
        self.Creator = QPushButton("Youtube", self)
        self.Creator.resize(100, 40)
        self.Creator.move(50, 50)
        self.CreatorB2 = QPushButton("Twitter", self)
        self.CreatorB2.resize(100, 40)
        self.CreatorB2.move(275, 50)
        self.CreatorL = QLabel("Created By: PapaKliffy", self)
        self.CreatorL.move(20, 350)

        def paintEvent(self, event):
        painter = QPainter(self)
        painter.drawPixmap(self.rect(), QPixmap("background.jpg"))


        if __name__ == '__main__':
        app = QApplication(sys.argv)
        w = UICreator()
        w.show()
        sys.exit(app.exec_())


        background.png:



        enter image description here



        Output:



        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 24 '16 at 2:04









        eyllanesc

        73.7k103056




        73.7k103056






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f41309243%2fadding-image-to-tab%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            What visual should I use to simply compare current year value vs last year in Power BI desktop

            Alexandru Averescu

            Trompette piccolo