[PyQt] strange scrolling behavior everywhere

Peter Schmidtke pschmidtke at mmb.pcb.ub.es
Wed Feb 17 00:43:36 GMT 2010


Thanks for answering already :) I know I did not provide lots of
information, but more because I thought that this behaviour was somehow
normal.

Find attached to this mail my ui file. It behaves the same way when I do
the preview in the qt designer.

some info about the system and versions. 
openSuse 11.1 64 bit
Qt Open Source Edition version 4.4.3
same qt designer
pyqt4-4.4.3-1.41 from the official repo oss from opensuse
python 2.6 (GCC 4.3.2 [gcc-4_3-branch revision 141291])

If I remember well (I'm getting old), I installed Qt4, but surely not over
the rpm package manager. Probably I got it shipped with eric + qt designer
etc.... I still have qt3 packages installed on the machine, can they
interfere?

I do not know if this is linked, but I also can not use "normally again"
the dock widgets. I can not pull them around, even when they should float,
they are indeed detached from the main window...but I can not drag them
around like I normally should be able to do. I tried pretty much everything
in the qt designer and finally gave it up (so there aren't in the current
ui file).

thanks again.

Peter



On Wed, 17 Feb 2010 00:47:17 +0100, David Boddie <david at boddie.org.uk>
wrote:
> On Tue Feb 16 13:32:12 GMT 2010, Peter Schmidtke wrote:
> 
>> I have several widgets in my MainWindow (desinged with QtDesigner), like
>> a
>> QTableView and some QPlainTextEdit, where I enable automatic scrollbars
>> (not as seperate widget) if necessary.
>> The thing is, when scrolling is needed, scrollbars appear, but the
>> scrolling behavior is strange. For instance for my vertical scrollbars
>> when
>> you click left with the mouse wherever on the scrollbar it is scrolling
>> down. But I can not drag the slider to scroll. Furthermore when you
click
>> right on it, you have menu, for where to scroll (top, bottom etc..)
> 
> This sounds strangely familiar, but is not normal behaviour. What is the
> behaviour of the scrollbars when you preview the form in Qt Designer?
> (You may have to add some content to the QPlainTextEdit to make sure you
> get scrollbars.)
> 
>> Is there a way to get a more "normal" behaviour of the scrollbars
without
>> implementing them as separated widgets and controlling their action by
>> "hand", that is to say with in python, by capturing the sliding events
>> etc...?
> 
> Usually, scrolling should just work "normally". If possible, can you put
> your
> .ui file somewhere for us to take a look at? I'm wondering if there's
> something strange in the way these widgets are configured.
> 
> By the way, you don't say which platform you are running on, or the
> versions
> of Qt and PyQt you are using. Those pieces of information might also be
> helpful in figuring out the cause of the problem.
> 
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

-- 

Peter Schmidtke

----------------------
PhD Student at the Molecular Modeling and Bioinformatics Group
Dep. Physical Chemistry
Faculty of Pharmacy
University of Barcelona
-------------- next part --------------
<ui version="4.0" >
 <class>pocketDBMainWindow</class>
 <widget class="QMainWindow" name="pocketDBMainWindow" >
  <property name="geometry" >
   <rect>
    <x>0</x>
    <y>0</y>
    <width>1920</width>
    <height>800</height>
   </rect>
  </property>
  <property name="sizePolicy" >
   <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="minimumSize" >
   <size>
    <width>0</width>
    <height>0</height>
   </size>
  </property>
  <property name="baseSize" >
   <size>
    <width>0</width>
    <height>0</height>
   </size>
  </property>
  <property name="windowTitle" >
   <string>pocketDB Browser</string>
  </property>
  <property name="windowIcon" >
   <iconset>
    <normaloff>:/pocketDBIcon.png</normaloff>
    <normalon>:/pocketDBIcon.png</normalon>
    <activeon>:/pocketDBIcon.png</activeon>
    <selectedon>:/pocketDBIcon.png</selectedon>:/pocketDBIcon.png</iconset>
  </property>
  <property name="styleSheet" >
   <string notr="true" >#molViewer{
	border: 1px solid gray;
	border-radius: 10px;
}
#UniprotPlainTextEdit{
	border: 1px solid gray;
	border-radius: 10px;
}
#queryEdit{
	border: 1px solid gray;
	border-radius: 10px;
}</string>
  </property>
  <property name="iconSize" >
   <size>
    <width>64</width>
    <height>64</height>
   </size>
  </property>
  <property name="dockNestingEnabled" >
   <bool>true</bool>
  </property>
  <property name="unifiedTitleAndToolBarOnMac" >
   <bool>false</bool>
  </property>
  <widget class="QWidget" name="centralwidget" >
   <layout class="QGridLayout" name="gridLayout" >
    <item row="0" column="0" >
     <layout class="QHBoxLayout" name="horizontalLayout" >
      <item>
       <widget class="QLineEdit" name="searchField" >
        <property name="minimumSize" >
         <size>
          <width>200</width>
          <height>0</height>
         </size>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="searchButton" >
        <property name="text" >
         <string>search</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QCheckBox" name="combineSearchQueryCB" >
        <property name="text" >
         <string>Combine selected query with search</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="Line" name="line_4" >
        <property name="orientation" >
         <enum>Qt::Vertical</enum>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLabel" name="label" >
        <property name="text" >
         <string>PDB Code</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLineEdit" name="pdb_code" >
        <property name="minimumSize" >
         <size>
          <width>0</width>
          <height>15</height>
         </size>
        </property>
        <property name="maximumSize" >
         <size>
          <width>50</width>
          <height>16777215</height>
         </size>
        </property>
        <property name="font" >
         <font>
          <pointsize>8</pointsize>
          <weight>75</weight>
          <bold>true</bold>
         </font>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QToolButton" name="openFileButton" >
        <property name="minimumSize" >
         <size>
          <width>0</width>
          <height>15</height>
         </size>
        </property>
        <property name="text" >
         <string>...</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLabel" name="label_cav" >
        <property name="text" >
         <string>Cavity ID</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QLineEdit" name="pdb_cavity" >
        <property name="maximumSize" >
         <size>
          <width>60</width>
          <height>16777215</height>
         </size>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QPushButton" name="compareButton" >
        <property name="text" >
         <string>compare</string>
        </property>
       </widget>
      </item>
      <item>
       <widget class="Line" name="line_3" >
        <property name="orientation" >
         <enum>Qt::Vertical</enum>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QRadioButton" name="pqsRadioButton" >
        <property name="text" >
         <string>PQS</string>
        </property>
        <property name="checked" >
         <bool>false</bool>
        </property>
       </widget>
      </item>
      <item>
       <widget class="QRadioButton" name="pdbRadioButton" >
        <property name="text" >
         <string>PDB</string>
        </property>
        <property name="checked" >
         <bool>true</bool>
        </property>
       </widget>
      </item>
     </layout>
    </item>
    <item row="1" column="0" >
     <widget class="QGroupBox" name="pocketDBGroupBox" >
      <property name="sizePolicy" >
       <sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="title" >
       <string>pocketDB View</string>
      </property>
      <property name="flat" >
       <bool>false</bool>
      </property>
      <property name="checkable" >
       <bool>false</bool>
      </property>
      <layout class="QGridLayout" name="gridLayout_3" >
       <item row="0" column="0" >
        <layout class="QGridLayout" name="gridLayout_2" >
         <property name="verticalSpacing" >
          <number>5</number>
         </property>
         <property name="bottomMargin" >
          <number>0</number>
         </property>
         <item row="10" column="0" colspan="2" >
          <widget class="QPushButton" name="queryButton" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text" >
            <string>Run Query</string>
           </property>
          </widget>
         </item>
         <item rowspan="7" row="0" column="1" >
          <widget class="QTableView" name="pocketDBView" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Preferred" hsizetype="Expanding" >
             <horstretch>50</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="minimumSize" >
            <size>
             <width>500</width>
             <height>0</height>
            </size>
           </property>
           <property name="mouseTracking" >
            <bool>false</bool>
           </property>
           <property name="acceptDrops" >
            <bool>true</bool>
           </property>
           <property name="styleSheet" >
            <string notr="true" >background:qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(219, 219, 219, 255), stop:1 rgba(255, 255, 255, 255))</string>
           </property>
           <property name="frameShape" >
            <enum>QFrame::StyledPanel</enum>
           </property>
           <property name="frameShadow" >
            <enum>QFrame::Plain</enum>
           </property>
           <property name="verticalScrollBarPolicy" >
            <enum>Qt::ScrollBarAsNeeded</enum>
           </property>
           <property name="horizontalScrollBarPolicy" >
            <enum>Qt::ScrollBarAsNeeded</enum>
           </property>
           <property name="autoScroll" >
            <bool>true</bool>
           </property>
           <property name="dragEnabled" >
            <bool>false</bool>
           </property>
           <property name="dragDropMode" >
            <enum>QAbstractItemView::NoDragDrop</enum>
           </property>
           <property name="alternatingRowColors" >
            <bool>true</bool>
           </property>
           <property name="verticalScrollMode" >
            <enum>QAbstractItemView::ScrollPerItem</enum>
           </property>
           <property name="showGrid" >
            <bool>true</bool>
           </property>
           <property name="gridStyle" >
            <enum>Qt::DotLine</enum>
           </property>
           <property name="sortingEnabled" >
            <bool>false</bool>
           </property>
           <property name="cornerButtonEnabled" >
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="6" column="0" >
          <widget class="QTextEdit" name="queryEdit" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Expanding" hsizetype="MinimumExpanding" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="minimumSize" >
            <size>
             <width>0</width>
             <height>0</height>
            </size>
           </property>
           <property name="maximumSize" >
            <size>
             <width>16777215</width>
             <height>150</height>
            </size>
           </property>
           <property name="styleSheet" >
            <string notr="true" >background:qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(255,255,255,255), stop:1 rgba(210,210,250,230))</string>
           </property>
           <property name="frameShape" >
            <enum>QFrame::StyledPanel</enum>
           </property>
           <property name="lineWidth" >
            <number>1</number>
           </property>
          </widget>
         </item>
         <item row="3" column="0" >
          <widget class="QPlainTextEdit" name="UniprotPlainTextEdit" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
             <horstretch>0</horstretch>
             <verstretch>2</verstretch>
            </sizepolicy>
           </property>
           <property name="minimumSize" >
            <size>
             <width>0</width>
             <height>0</height>
            </size>
           </property>
           <property name="font" >
            <font>
             <pointsize>8</pointsize>
            </font>
           </property>
           <property name="autoFillBackground" >
            <bool>false</bool>
           </property>
           <property name="styleSheet" >
            <string notr="true" >background:qlineargradient(spread:pad, x1:1, y1:1, x2:1, y2:0, stop:0 rgba(219, 219, 219, 219), stop:1 rgba(240,240,240,240))</string>
           </property>
           <property name="frameShape" >
            <enum>QFrame::StyledPanel</enum>
           </property>
           <property name="lineWidth" >
            <number>1</number>
           </property>
          </widget>
         </item>
         <item row="9" column="0" >
          <widget class="Line" name="line_2" >
           <property name="orientation" >
            <enum>Qt::Horizontal</enum>
           </property>
          </widget>
         </item>
         <item row="1" column="0" >
          <widget class="QLabel" name="molViewer" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="minimumSize" >
            <size>
             <width>0</width>
             <height>200</height>
            </size>
           </property>
           <property name="autoFillBackground" >
            <bool>false</bool>
           </property>
           <property name="text" >
            <string/>
           </property>
           <property name="scaledContents" >
            <bool>false</bool>
           </property>
           <property name="alignment" >
            <set>Qt::AlignCenter</set>
           </property>
           <property name="margin" >
            <number>0</number>
           </property>
           <property name="indent" >
            <number>-1</number>
           </property>
          </widget>
         </item>
         <item row="5" column="0" >
          <widget class="QComboBox" name="queryBuilder" >
           <property name="sizePolicy" >
            <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="minimumSize" >
            <size>
             <width>0</width>
             <height>0</height>
            </size>
           </property>
           <property name="frame" >
            <bool>false</bool>
           </property>
           <property name="modelColumn" >
            <number>0</number>
           </property>
           <item>
            <property name="text" >
             <string>Get reasonably sized cavities with good drug score</string>
            </property>
           </item>
           <item>
            <property name="text" >
             <string>Get reasonably sized cavities with good drug score containing ligands</string>
            </property>
           </item>
           <item>
            <property name="text" >
             <string>Get reasonably sized non flexible cavities like in 2</string>
            </property>
           </item>
          </widget>
         </item>
         <item row="2" column="0" >
          <widget class="QLabel" name="label_2" >
           <property name="text" >
            <string>Ligand Name</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
    </item>
    <item row="1" column="1" >
     <widget class="QGroupBox" name="PyMolGroupBox" >
      <property name="sizePolicy" >
       <sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
        <horstretch>0</horstretch>
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
      <property name="title" >
       <string>PyMol</string>
      </property>
      <layout class="QHBoxLayout" name="horizontalLayout_2" >
       <item>
        <layout class="QVBoxLayout" name="PyMOLLayout" >
         <property name="sizeConstraint" >
          <enum>QLayout::SetMaximumSize</enum>
         </property>
        </layout>
       </item>
      </layout>
     </widget>
    </item>
   </layout>
  </widget>
  <widget class="QMenuBar" name="menubar" >
   <property name="geometry" >
    <rect>
     <x>0</x>
     <y>0</y>
     <width>1920</width>
     <height>28</height>
    </rect>
   </property>
   <widget class="QMenu" name="menuFile" >
    <property name="title" >
     <string>File</string>
    </property>
    <addaction name="actionSave_Query" />
    <addaction name="actionLoad_Query" />
   </widget>
   <widget class="QMenu" name="menuCluster" >
    <property name="title" >
     <string>Cluster</string>
    </property>
    <addaction name="actionRun_hclust_on_current_query" />
   </widget>
   <addaction name="menuFile" />
   <addaction name="menuCluster" />
  </widget>
  <widget class="QStatusBar" name="statusbar" >
   <property name="enabled" >
    <bool>false</bool>
   </property>
  </widget>
  <action name="actionSave_Query" >
   <property name="text" >
    <string>Save Query</string>
   </property>
  </action>
  <action name="actionLoad_Query" >
   <property name="text" >
    <string>Load Query</string>
   </property>
  </action>
  <action name="actionRun_hclust_on_current_query" >
   <property name="text" >
    <string>Run hclust on current query</string>
   </property>
  </action>
 </widget>
 <resources>
  <include location="icons.qrc" />
 </resources>
 <connections/>
</ui>


More information about the PyQt mailing list