summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrell Anderson <humanreadable@yahoo.com>2012-11-02 15:27:42 -0500
committerDarrell Anderson <humanreadable@yahoo.com>2012-11-02 15:27:42 -0500
commit1ae1be3065a315252a7dfac96a9c981ed6727ae6 (patch)
treec4d51d9066fd845714fe305c9709c33db8073998
parent308537cb0eb307820f385f38c55dc1ccc47b343b (diff)
parent573f18421513021eee6b951b542574cdaf1e868a (diff)
downloadtqt3-1ae1be3065a315252a7dfac96a9c981ed6727ae6.tar.gz
tqt3-1ae1be3065a315252a7dfac96a9c981ed6727ae6.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tqt3
-rw-r--r--src/kernel/ntqstyle.h6
-rw-r--r--src/styles/qcommonstyle.cpp4
-rw-r--r--src/widgets/ntqlistview.h1
-rw-r--r--src/widgets/ntqpopupmenu.h3
-rw-r--r--src/widgets/qlistview.cpp9
-rw-r--r--src/widgets/qpopupmenu.cpp27
6 files changed, 50 insertions, 0 deletions
diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h
index 994eff811..90f4eacff 100644
--- a/src/kernel/ntqstyle.h
+++ b/src/kernel/ntqstyle.h
@@ -178,6 +178,11 @@ class TQStyleControlElementDockWidgetData {
TQt::Orientation areaOrientation;
};
+class TQStyleControlElementToolBarWidgetData {
+ public:
+ TQt::Orientation orientation;
+};
+
class TQStyleControlElementGenericWidgetData {
public:
TQStringList widgetObjectTypes;
@@ -270,6 +275,7 @@ class Q_EXPORT TQStyleControlElementData {
TQ_UINT32 frameStyle;
TQRect sliderRect;
TQPainter* activePainter;
+ TQStyleControlElementToolBarWidgetData toolBarData;
public:
TQStyleControlElementData();
diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp
index 213f04781..402354c62 100644
--- a/src/styles/qcommonstyle.cpp
+++ b/src/styles/qcommonstyle.cpp
@@ -576,6 +576,10 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
}
ceData.dwData.closeEnabled = dw->isCloseEnabled();
}
+ const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(parentWidget);
+ if (toolbar) {
+ ceData.toolBarData.orientation = toolbar->orientation();
+ }
}
TQCheckListItem *item = opt.checkListItem();
diff --git a/src/widgets/ntqlistview.h b/src/widgets/ntqlistview.h
index 5c976bd8a..de41e07f3 100644
--- a/src/widgets/ntqlistview.h
+++ b/src/widgets/ntqlistview.h
@@ -69,6 +69,7 @@ class Q_EXPORT TQListViewItem : public TQt
friend class TQListViewToolTip;
public:
+ TQListViewItem( );
TQListViewItem( TQListView * parent );
TQListViewItem( TQListViewItem * parent );
TQListViewItem( TQListView * parent, TQListViewItem * after );
diff --git a/src/widgets/ntqpopupmenu.h b/src/widgets/ntqpopupmenu.h
index c4415fdfb..a028d82fe 100644
--- a/src/widgets/ntqpopupmenu.h
+++ b/src/widgets/ntqpopupmenu.h
@@ -193,6 +193,9 @@ private: // Disabled copy constructor and operator=
TQPopupMenu( const TQPopupMenu & );
TQPopupMenu &operator=( const TQPopupMenu & );
#endif
+
+public:
+ static int menuItemHeight( TQMenuItem* mi, TQFontMetrics fm );
};
diff --git a/src/widgets/qlistview.cpp b/src/widgets/qlistview.cpp
index 9946319a7..37d3b0d2c 100644
--- a/src/widgets/qlistview.cpp
+++ b/src/widgets/qlistview.cpp
@@ -490,6 +490,15 @@ static TQString qEllipsisText( const TQString &org, const TQFontMetrics &fm, int
*/
/*!
+ Constructs a new top-level list view item with no parent
+*/
+
+TQListViewItem::TQListViewItem( )
+{
+ init();
+}
+
+/*!
Constructs a new top-level list view item in the TQListView \a
parent.
*/
diff --git a/src/widgets/qpopupmenu.cpp b/src/widgets/qpopupmenu.cpp
index c52878679..afff582b5 100644
--- a/src/widgets/qpopupmenu.cpp
+++ b/src/widgets/qpopupmenu.cpp
@@ -2882,5 +2882,32 @@ TQPopupMenu::updateScrollerState()
d->scroll.topScrollableIndex++;
}
+/*!
+ Calculates the height in pixels of the menu item \a mi.
+*/
+int TQPopupMenu::menuItemHeight( TQMenuItem *mi, TQFontMetrics fm )
+{
+ if ( mi->widget() )
+ return mi->widget()->height();
+ if ( mi->custom() && mi->custom()->fullSpan() )
+ return mi->custom()->sizeHint().height();
+
+ int h = 0;
+ if ( mi->isSeparator() ) // separator height
+ h = 2;
+ else if ( mi->pixmap() ) // pixmap height
+ h = mi->pixmap()->height();
+ else // text height
+ h = fm.height();
+
+ if ( !mi->isSeparator() && mi->iconSet() != 0 )
+ h = TQMAX(h, mi->iconSet()->pixmap( TQIconSet::Small,
+ TQIconSet::Normal ).height());
+ if ( mi->custom() )
+ h = TQMAX(h, mi->custom()->sizeHint().height());
+
+ return h;
+}
+
#endif // QT_NO_POPUPMENU