adding Image to tab
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
|
show 1 more comment
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
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
|
show 1 more comment
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
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
python pyqt pyqt4 qimage
edited Nov 23 '18 at 4:27
eyllanesc
77.1k103156
77.1k103156
asked Dec 24 '16 at 0:27
TyrellTyrell
2362719
2362719
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
|
show 1 more comment
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
|
show 1 more comment
1 Answer
1
active
oldest
votes
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:
Output:
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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:
Output:
add a comment |
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:
Output:
add a comment |
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:
Output:
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:
Output:
answered Dec 24 '16 at 2:04
eyllanesceyllanesc
77.1k103156
77.1k103156
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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