| The Following User Says Thank You to caco3 For This Useful Post: | ||
|
|
2010-08-23
, 08:18
|
|
|
Posts: 1,012 |
Thanked: 817 times |
Joined on Jul 2007
@ France
|
#2
|
|
|
2010-08-23
, 20:29
|
|
|
Posts: 560 |
Thanked: 423 times |
Joined on May 2010
@ Switzerland
|
#3
|

| The Following User Says Thank You to caco3 For This Useful Post: | ||
|
|
2010-08-24
, 23:34
|
|
|
Posts: 560 |
Thanked: 423 times |
Joined on May 2010
@ Switzerland
|
#4
|

| The Following User Says Thank You to caco3 For This Useful Post: | ||
|
|
2010-09-02
, 20:33
|
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#5
|
under self.scrollarea = QtGui.QScrollArea(...) in ui_ConfigWindow.py
add :
scroller = self.scrollArea.property("kineticScroller").toPyOb ject()
scroller.setEnabled(True)
if you want an example in the method setupGui of KhweeteurPref class:
http://gitorious.org/khweeteur/khwee...ur/__init__.py
| The Following User Says Thank You to fpp For This Useful Post: | ||
|
|
2010-09-03
, 13:52
|
|
|
Posts: 1,012 |
Thanked: 817 times |
Joined on Jul 2007
@ France
|
#6
|
|
|
2010-09-03
, 18:13
|
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#7
|
In fact it s depends on object you put in your scrollarea ... if you put a QTextEdit like in KhtEditor (http://gitorious.org/khteditor) you need to use this crappy trick.
Ps:KhtEditor already have ctrl-d shortcut
|
|
2010-09-06
, 04:44
|
|
|
Posts: 1,012 |
Thanked: 817 times |
Joined on Jul 2007
@ France
|
#8
|
|
|
2010-09-06
, 07:51
|
|
|
Posts: 2,853 |
Thanked: 968 times |
Joined on Nov 2005
|
#9
|
I need some help with a QScrollArea in Python (PyQt).
I made a window in QT Designer for my application and would like to have a scrollable area with all the buttons and so on inside.
I can see the scrollable area, but it does not scroll, even it is hiding some of the objects.
Could somebody have a look on the code below (main.py) and Ui_ConfigWindow.py, generated from QT Designer .ui file) and help me with telling what the missing code piece is?
Thanks a lot!
main.py:
#!/usr/bin/env python import sys from PyQt4.QtCore import * from PyQt4.QtGui import * from Ui_ConfigWindow import * ##################################################### ## Main function ##################################################### def main(): global app, ConfigWindow app = QApplication(sys.argv) ConfigWindow = frmConfigWindow() ConfigWindow.show() sys.exit(app.exec_()) ##################################################### ## Class for Configuration Window ##################################################### class frmConfigWindow(QMainWindow): def __init__(self): QMainWindow.__init__(self) self.ui = Ui_ConfigWindow() self.ui.setupUi(self) ##################################################### main() # Now we can start it.Ui_ConfigWindow.py:
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file '/home/gruinelli/Maemo/SleepAnalyser/N900/ConfigWindow.ui' # # Created: Sun Aug 22 14:06:27 2010 # by: PyQt4 UI code generator 4.7.3 # # WARNING! All changes made in this file will be lost! from PyQt4 import QtCore, QtGui class Ui_ConfigWindow(object): def setupUi(self, ConfigWindow): ConfigWindow.setObjectName("ConfigWindow") ConfigWindow.resize(800, 440) ConfigWindow.setSizeIncrement(QtCore.QSize(0, 0)) self.centralwidget = QtGui.QWidget(ConfigWindow) self.centralwidget.setObjectName("centralwidget") self.lblIcon = QtGui.QLabel(self.centralwidget) self.lblIcon.setGeometry(QtCore.QRect(660, 10, 117, 128)) self.lblIcon.setText("") self.lblIcon.setPixmap(QtGui.QPixmap("img/SleepAnalyser.png")) self.lblIcon.setScaledContents(True) self.lblIcon.setObjectName("lblIcon") self.scrollArea = QtGui.QScrollArea(self.centralwidget) self.scrollArea.setGeometry(QtCore.QRect(0, 0, 651, 421)) self.scrollArea.setFrameShape(QtGui.QFrame.StyledPanel) self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.scrollArea.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn) self.scrollArea.setWidgetResizable(True) self.scrollArea.setObjectName("scrollArea") self.scrollAreaWidgetContents = QtGui.QWidget(self.scrollArea) self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 628, 398)) self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents") self.SlrDelayStart = QtGui.QSlider(self.scrollAreaWidgetContents) self.SlrDelayStart.setEnabled(True) self.SlrDelayStart.setGeometry(QtCore.QRect(250, 320, 211, 71)) self.SlrDelayStart.setMaximum(120) self.SlrDelayStart.setOrientation(QtCore.Qt.Horizontal) self.SlrDelayStart.setObjectName("SlrDelayStart") self.cSilentProfile = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.cSilentProfile.setGeometry(QtCore.QRect(10, 80, 611, 71)) font = QtGui.QFont() font.setPointSize(16) self.cSilentProfile.setFont(font) self.cSilentProfile.setObjectName("cSilentProfile") self.lblUserName = QtGui.QLabel(self.scrollAreaWidgetContents) self.lblUserName.setGeometry(QtCore.QRect(150, 230, 161, 71)) font = QtGui.QFont() font.setPointSize(16) self.lblUserName.setFont(font) self.lblUserName.setText("") self.lblUserName.setObjectName("lblUserName") self.lblDelayStart = QtGui.QLabel(self.scrollAreaWidgetContents) self.lblDelayStart.setEnabled(True) self.lblDelayStart.setGeometry(QtCore.QRect(150, 320, 91, 71)) font = QtGui.QFont() font.setPointSize(16) self.lblDelayStart.setFont(font) self.lblDelayStart.setObjectName("lblDelayStart") self.cOfflineMode = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.cOfflineMode.setGeometry(QtCore.QRect(10, 10, 611, 71)) font = QtGui.QFont() font.setPointSize(16) self.cOfflineMode.setFont(font) self.cOfflineMode.setObjectName("cOfflineMode") self.cStopAfterAlarm = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.cStopAfterAlarm.setGeometry(QtCore.QRect(10, 150, 611, 71)) font = QtGui.QFont() font.setPointSize(16) self.cStopAfterAlarm.setFont(font) self.cStopAfterAlarm.setObjectName("cStopAfterAlarm") self.label_7 = QtGui.QLabel(self.scrollAreaWidgetContents) self.label_7.setGeometry(QtCore.QRect(20, 230, 131, 71)) font = QtGui.QFont() font.setPointSize(16) self.label_7.setFont(font) self.label_7.setObjectName("label_7") self.bEditUserName = QtGui.QPushButton(self.scrollAreaWidgetContents) self.bEditUserName.setGeometry(QtCore.QRect(320, 230, 141, 71)) font = QtGui.QFont() font.setPointSize(18) self.bEditUserName.setFont(font) self.bEditUserName.setIconSize(QtCore.QSize(24, 24)) self.bEditUserName.setObjectName("bEditUserName") self.label_8 = QtGui.QLabel(self.scrollAreaWidgetContents) self.label_8.setEnabled(True) self.label_8.setGeometry(QtCore.QRect(20, 320, 131, 71)) font = QtGui.QFont() font.setPointSize(16) self.label_8.setFont(font) self.label_8.setObjectName("label_8") self.plainTextEdit = QtGui.QPlainTextEdit(self.scrollAreaWidgetContents) self.plainTextEdit.setEnabled(True) self.plainTextEdit.setGeometry(QtCore.QRect(0, 540, 621, 91)) font = QtGui.QFont() font.setPointSize(16) self.plainTextEdit.setFont(font) self.plainTextEdit.setReadOnly(True) self.plainTextEdit.setObjectName("plainTextEdit") self.cSilentProfile_2 = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.cSilentProfile_2.setGeometry(QtCore.QRect(10, 400, 611, 71)) font = QtGui.QFont() font.setPointSize(16) self.cSilentProfile_2.setFont(font) self.cSilentProfile_2.setObjectName("cSilentProfile_2") self.cSilentProfile_3 = QtGui.QCheckBox(self.scrollAreaWidgetContents) self.cSilentProfile_3.setGeometry(QtCore.QRect(10, 470, 611, 71)) font = QtGui.QFont() font.setPointSize(16) self.cSilentProfile_3.setFont(font) self.cSilentProfile_3.setObjectName("cSilentProfile_3") self.scrollArea.setWidget(self.scrollAreaWidgetContents) ConfigWindow.setCentralWidget(self.centralwidget) self.retranslateUi(ConfigWindow) QtCore.QMetaObject.connectSlotsByName(ConfigWindow) def retranslateUi(self, ConfigWindow): ConfigWindow.setWindowTitle(QtGui.QApplication.translate("ConfigWindow", "SleepAnalyser (Settings)", None, QtGui.QApplication.UnicodeUTF8)) self.cSilentProfile.setText(QtGui.QApplication.translate("ConfigWindow", "Change to Silent Profile while recording", None, QtGui.QApplication.UnicodeUTF8)) self.lblDelayStart.setText(QtGui.QApplication.translate("ConfigWindow", "120 sec", None, QtGui.QApplication.UnicodeUTF8)) self.cOfflineMode.setText(QtGui.QApplication.translate("ConfigWindow", "Change to Offline Mode while recording", None, QtGui.QApplication.UnicodeUTF8)) self.cStopAfterAlarm.setText(QtGui.QApplication.translate("ConfigWindow", "Stop recording after alarm occured", None, QtGui.QApplication.UnicodeUTF8)) self.label_7.setText(QtGui.QApplication.translate("ConfigWindow", "User name:", None, QtGui.QApplication.UnicodeUTF8)) self.bEditUserName.setText(QtGui.QApplication.translate("ConfigWindow", "Change", None, QtGui.QApplication.UnicodeUTF8)) self.label_8.setText(QtGui.QApplication.translate("ConfigWindow", "Start delay:", None, QtGui.QApplication.UnicodeUTF8)) self.plainTextEdit.setPlainText(QtGui.QApplication.translate("ConfigWindow", "More settings can be changed at your own risk in the file ~/.SleepAnalyer/SleepAnalyser.conf", None, QtGui.QApplication.UnicodeUTF8)) self.cSilentProfile_2.setText(QtGui.QApplication.translate("ConfigWindow", "bla", None, QtGui.QApplication.UnicodeUTF8)) self.cSilentProfile_3.setText(QtGui.QApplication.translate("ConfigWindow", "bla", None, QtGui.QApplication.UnicodeUTF8)) if __name__ == "__main__": import sys app = QtGui.QApplication(sys.argv) ConfigWindow = QtGui.QMainWindow() ui = Ui_ConfigWindow() ui.setupUi(ConfigWindow) ConfigWindow.show() sys.exit(app.exec_())On N9 check out this:
CacheMe 4 the N9, a geocaching client / MiniBible, a bible viewer / TheWord brings daily bible verses onto your phone / BatteryGraph to monitor the battery drainage / doublepress2unlock to unlock your phone with a double press onto the power button / GPRS Data Usage to monitor your GPRS data usage /
and more...
On N900 check out this: SleepAnalyser to analyse your sleep movements / PasswordMaker a for a password generator
Last edited by caco3; 2010-08-22 at 22:59.