Skip to content

Neal Bürger

Neal Bürger

  • Home
  • Programming
  • Computer
  • Projects
  • About
Search

Aptana / Eclipse: Set up Git Repository (Github, Bitbucket)

First posted: November 19, 2013February 2, 2018Filed under: Programming8 Comments

If you code for yourself or with a team you should be using a code repository. However getting started you need a dedicated server, installation etc. or you take the more convenient route and use one of the many repository providers. Step 1: Get a Repository For small teams, you can get free Repositories. The two …

Keep Reading
Programming
  • aptana
  • bitbucket
  • eclipse
  • git
  • github
8 Comments

PySide: QPushbutton Text below Icon

First posted: November 10, 2013February 2, 2018Filed under: PythonComment

Apparently using a QPushbutton with an Icon does not work. As alternative, I am going to use a QToolbutton.

[python]
import sys
from PySide.QtCore import *
from PySide.QtGui import *

class Widget(QWidget):

def __init__(self, parent= None):
super(Widget, self).__init__()

layout = QVBoxLayout(self)

#QToolButton
btn = QToolButton()
btn.setToolButtonStyle(Qt.ToolButtonTextUnderIcon)
btn.setText("test")
btn.setIcon(btn.style().standardIcon(QStyle.SP_DirIcon))
btn.setIconSize(QSize(54,54))

layout.addWidget(btn)

self.setLayout(layout)

if __name__ == ‘__main__’:
app = QApplication(sys.argv)

dialog = Widget()
dialog.show()

app.exec_()
[/python]

Python
  • icon
  • pyqt
  • PySide
  • python
Leave a comment

PySide: QVBoxLayout with QScrollArea

First posted: November 7, 2013January 3, 2016Filed under: Python1 Comment

Here is an example that adds Scrollbars to a QVBoxLayout. The one thing that tripped me up was that you need to explicitly create a Widget for the QScrollArea.

[python]
import sys
from PySide.QtCore import *
from PySide.QtGui import *

class Widget(QWidget):

def __init__(self, parent= None):
super(Widget, self).__init__()
self.setFixedHeight(200)

#Container Widget
widget = QWidget()
#Layout of Container Widget
layout = QVBoxLayout(self)
for _ in range(20):
btn = QPushButton("test")
layout.addWidget(btn)
widget.setLayout(layout)

#Scroll Area Properties
scroll = QScrollArea()
scroll.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOn)
scroll.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
scroll.setWidgetResizable(False)
scroll.setWidget(widget)

#Scroll Area Layer add
vLayout = QVBoxLayout(self)
vLayout.addWidget(scroll)
self.setLayout(vLayout)

if __name__ == ‘__main__’:
app = QApplication(sys.argv)

dialog = Widget()
dialog.show()

app.exec_()
[/python]

Python
  • pyqt
  • PySide
  • qscrollarea
  • Qt
1 Comment

PySide: QTreeListWidget deleting an Item, editing an Item

First posted: November 2, 2013January 3, 2016Filed under: PythonComment

This example creates a QTreeListWidget to display a folder-structure. [python] import sys, os from PySide.QtCore import * from PySide.QtGui import * class TreeTest(QTreeWidget): def __init__(self, parent = None): super(TreeTest, self).__init__(parent) self.setColumnCount(1) self.setHeaderLabel("Folders") actionEdit = QAction("New Folder", self) actionEdit.triggered.connect(self.addItemAction) self.setContextMenuPolicy(Qt.ActionsContextMenu) self.addAction(actionEdit) actionDelete = QAction("Delete", self) actionDelete.triggered.connect(self.deleteItem) self.addAction(actionDelete) self.style() def addItem(self, name, parent): self.expandItem(parent) item = QTreeWidgetItem(parent) …

Keep Reading
Python
  • PySide
  • python
  • Qt
  • treelistwidget
Leave a comment

PySide: Using standard system Icons

First posted: November 1, 2013January 3, 2016Filed under: Python1 Comment

You can add Icons to many types of QWidgets. PySide provides you with a method to access the native system icons. A complete list of icons can be found here: PySide.QtGui.PySide.QtGui.QStyle.StandardPixmap To apply the QIcon you need to [python] btn = QPushButton("Folder") style = btn.style() icon = style.standardIcon(QStyle.SP_DirIcon) btn.setIcon(icon) #or short: btn.setIcon(btn.style().standardIcon(QStyle.SP_DirIcon)) [/python] Here a …

Keep Reading
Python
  • default
  • PySide
  • python
  • qicon
  • Qt
  • standard icons
  • system icons
1 Comment

PySide: QMessageBox with QCheckBox

First posted: October 27, 2013March 3, 2018Filed under: PythonComment

The QMessageBox is very useful for creating standard filesystem dialogs (it even comes with alert sounds) and is limited to display an icon, text and standard buttons. If you want to add something extra like a checkbox for “do not ask me again”, you need to extend the base class. import sys from PySide.QtCore import …

Keep Reading
Python
  • checkbox
  • messagebox
  • pyqt
  • PySide
  • python
  • qcheckbox
  • qmessagebox
Leave a comment

Posts navigation

  • Previous
  • 1
  • …
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • Next

Search

Social

  • View nealbuerger’s profile on LinkedIn

Categories

  • Blog
    • Books
  • Computer
    • Hardware
    • Linux
    • Windows
  • Programming
    • Java
    • News
    • NodeJS
    • Python
    • Web Technologies
  • Typescript
  • Bewerbungsunterlagen
  • Blog
  • Contact
  • Cookie Policy
  • Resume
  • About
Proudly powered by WordPress | Theme: Jinn by Aaron Snowberger.
© 2010 – 2018 Neal Bürger
This site uses cookies: Find out more.