#include <QWidgetAction>
#include <QLinearGradient>
#include <QAbstractTextDocumentLayout>
+#include <QTimer>
/*!
\class QtxMenu::Title
removeTitle();
insertTitle();
}
+
+/*!
+ \brief Paint event
+*/
+void QtxMenu::paintEvent( QPaintEvent* e )
+{
+ // Force menu resizing, see resizeAfterRepaint().
+ QMenu::paintEvent(e);
+ QTimer::singleShot( 0, this, SLOT( resizeAfterRepaint() ) );
+}
+
+void QtxMenu::resizeAfterRepaint()
+{
+ // this slot is used as a workaround about annoying problem
+ // on some X window System desktops like KDE 5, Unity and other
+ // that causes setting incorrect menu's geometry
+ // after it appears on a screen.
+ resize( sizeHint() );
+}
public slots:
virtual void setVisible( bool );
+protected:
+ virtual void paintEvent( QPaintEvent* );
+
private:
void updateTitle();
void insertTitle();
void removeTitle();
+private slots:
+ void resizeAfterRepaint();
+
private:
TitleMode myMode;
Title* myTitle;