welcome QxtLabel
new directory designer for qxt designer plugins
This commit is contained in:
parent
b5e169b66d
commit
8aaad7922f
|
@ -36,6 +36,7 @@ width="32" height="32" border="0" /></a></td>
|
|||
<tr><td class="indexkey"><a class="el" href="classQxtAudioPlayer.html">QxtAudioPlayer</a></td><td class="indexvalue">Simple player using the <a class="el" href="classQxtAVFile.html">QxtAVFile</a> and portaudio </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="classQxtAVFile.html">QxtAVFile</a></td><td class="indexvalue">AV decoder </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="classQxtBlowFish.html">QxtBlowFish</a></td><td class="indexvalue">Blowfish Encryption Class </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="classQxtLabel.html">QxtLabel</a></td><td class="indexvalue">A simple label which is able to show elided and rotated text </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="classQxtMetaBall.html">QxtMetaBall</a></td><td class="indexvalue">Signal/slot connections with expressions </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="structQxtNull.html">QxtNull</a></td><td class="indexvalue">An object representing the "null" value for <a class="el" href="classQxtNullable.html">QxtNullable</a> </td></tr>
|
||||
<tr><td class="indexkey"><a class="el" href="classQxtNullable.html">QxtNullable< T ></a></td><td class="indexvalue">Distinct null value compatible with any data type </td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtAVFile" -->AV decoder.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtAVFile></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Signals</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtAudioPlayer" -->simple player using the <a class="el" href="classQxtAVFile.html">QxtAVFile</a> and portaudio
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtAudioPlayer></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Slots</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtBlowFish" -->Blowfish Encryption Class.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtBlowFish></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtMetaBall" -->signal/slot connections with expressions
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtMetaBall></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtNullable" -->distinct null value compatible with any data type.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtNullable></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtPairList" -->Searchable List of Pairs.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtPairList></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtPimpl" -->hide implementaion with PIMPL
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtPimpl></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
</table>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtRPCPeer" -->transmitts Qt signals over a network connection
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtRPCPeer></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtSdlWidget" -->use SDL inside a QWidget
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtSdlWidget></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtSignalWaiter" -->Wait until a signal ocured.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtSignalWaiter></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtSingleInstance" -->make sure something is run only once on a system
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtSingleInstance></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtSqlPackage" -->full serialiseable QSqlQuery storage
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtSqlPackage></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtSqlPackageModel" -->provides a read-only data model for <a class="el" href="classQxtSqlPackage.html">QxtSqlPackage</a> result..
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtSqlPackageModel></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtTabWidget" -->Office like TabWidget.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtTabWidget></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Signals</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtTreeWidget" -->QTreeWidget with a customized drawing for parent items.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtTreeWidget></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtTripple" -->Template class that stores three values.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtTripple></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtTrippleList" -->Searchable List of Tripples.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtTrippleList></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtTuple" -->Arbitrary-length templated list.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtTuple></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Related Functions</h2></td></tr>
|
||||
|
|
|
@ -32,17 +32,18 @@ width="32" height="32" border="0" /></a></td>
|
|||
|
||||
</table>
|
||||
<!-- Generated by Doxygen 1.5.1 -->
|
||||
<h1>QtExtendedLibrary Data Structure Index</h1><p><div class="qindex"><a class="qindex" href="#letter_A">A</a> | <a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_N">N</a> | <a class="qindex" href="#letter_P">P</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a> | <a class="qindex" href="#letter_T">T</a></div><p>
|
||||
<h1>QtExtendedLibrary Data Structure Index</h1><p><div class="qindex"><a class="qindex" href="#letter_A">A</a> | <a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_L">L</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_N">N</a> | <a class="qindex" href="#letter_P">P</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a> | <a class="qindex" href="#letter_T">T</a></div><p>
|
||||
<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr><td><a name="letter_A"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> A </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtMetaBall.html">QxtMetaBall</a> </td><td><a class="el" href="classQxtPimpl.html">QxtPimpl</a> </td><td><a class="el" href="classQxtSignalWaiter.html">QxtSignalWaiter</a> </td><td><a class="el" href="classQxtTabWidget.html">QxtTabWidget</a> </td></tr><tr><td><a class="el" href="classQxtAudioPlayer.html">QxtAudioPlayer</a> </td><td><a name="letter_N"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> N </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtLabel.html">QxtLabel</a> </td><td><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> P </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtSdlWidget.html">QxtSdlWidget</a> </td><td><a class="el" href="classQxtTabWidget.html">QxtTabWidget</a> </td></tr><tr><td><a class="el" href="classQxtAudioPlayer.html">QxtAudioPlayer</a> </td><td><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> M </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtPairList.html">QxtPairList</a> </td><td><a class="el" href="classQxtSignalWaiter.html">QxtSignalWaiter</a> </td><td><a class="el" href="classQxtTreeWidget.html">QxtTreeWidget</a> </td></tr><tr><td><a class="el" href="classQxtAVFile.html">QxtAVFile</a> </td><td><a class="el" href="classQxtMetaBall.html">QxtMetaBall</a> </td><td><a class="el" href="classQxtPimpl.html">QxtPimpl</a> </td><td><a class="el" href="classQxtSingleInstance.html">QxtSingleInstance</a> </td><td><a class="el" href="classQxtTripple.html">QxtTripple</a> </td></tr><tr><td><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> B </div></td></tr></table>
|
||||
</td><td><a name="letter_N"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> N </div></td></tr></table>
|
||||
</td><td><a name="letter_R"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> R </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtSingleInstance.html">QxtSingleInstance</a> </td><td><a class="el" href="classQxtTreeWidget.html">QxtTreeWidget</a> </td></tr><tr><td><a class="el" href="classQxtAVFile.html">QxtAVFile</a> </td><td><a class="el" href="structQxtNull.html">QxtNull</a> </td><td><a class="el" href="classQxtRPCPeer.html">QxtRPCPeer</a> </td><td><a class="el" href="classQxtSqlPackage.html">QxtSqlPackage</a> </td><td><a class="el" href="classQxtTripple.html">QxtTripple</a> </td></tr><tr><td><a name="letter_B"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> B </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtSqlPackage.html">QxtSqlPackage</a> </td><td><a class="el" href="classQxtTrippleList.html">QxtTrippleList</a> </td></tr><tr><td><a class="el" href="classQxtBlowFish.html">QxtBlowFish</a> </td><td><a class="el" href="structQxtNull.html">QxtNull</a> </td><td><a class="el" href="classQxtRPCPeer.html">QxtRPCPeer</a> </td><td><a class="el" href="classQxtSqlPackageModel.html">QxtSqlPackageModel</a> </td><td><a class="el" href="classQxtTuple.html">QxtTuple</a> </td></tr><tr><td><a name="letter_L"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> L </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtNullable.html">QxtNullable</a> </td><td><a name="letter_S"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> S </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtSqlPackageModel.html">QxtSqlPackageModel</a> </td><td><a class="el" href="classQxtTrippleList.html">QxtTrippleList</a> </td></tr><tr><td><a class="el" href="classQxtBlowFish.html">QxtBlowFish</a> </td><td><a name="letter_P"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> P </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtSdlWidget.html">QxtSdlWidget</a> </td><td><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> T </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtTuple.html">QxtTuple</a> </td></tr><tr><td><a name="letter_M"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> M </div></td></tr></table>
|
||||
</td><td><a class="el" href="classQxtPairList.html">QxtPairList</a> </td></tr></table><p><div class="qindex"><a class="qindex" href="#letter_A">A</a> | <a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_N">N</a> | <a class="qindex" href="#letter_P">P</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a> | <a class="qindex" href="#letter_T">T</a></div><p>
|
||||
</td><td><a name="letter_T"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> T </div></td></tr></table>
|
||||
</td></tr></table><p><div class="qindex"><a class="qindex" href="#letter_A">A</a> | <a class="qindex" href="#letter_B">B</a> | <a class="qindex" href="#letter_L">L</a> | <a class="qindex" href="#letter_M">M</a> | <a class="qindex" href="#letter_N">N</a> | <a class="qindex" href="#letter_P">P</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a> | <a class="qindex" href="#letter_T">T</a></div><p>
|
||||
<address><hr />
|
||||
|
||||
<div align="center">
|
||||
|
|
|
@ -35,6 +35,9 @@ width="32" height="32" border="0" /></a></td>
|
|||
<h1>Gui</h1><table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Data Structures</h2></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classQxtLabel.html">QxtLabel</a></td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A simple label which is able to show elided and rotated text. <a href="classQxtLabel.html#_details">More...</a><br></td></tr>
|
||||
<tr><td class="memItemLeft" nowrap align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classQxtTabWidget.html">QxtTabWidget</a></td></tr>
|
||||
|
||||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Office like TabWidget. <a href="classQxtTabWidget.html#_details">More...</a><br></td></tr>
|
||||
|
|
|
@ -38,6 +38,8 @@ width="32" height="32" border="0" /></a></td>
|
|||
</h1><!-- doxytag: class="QxtNull" -->An object representing the "null" value for <a class="el" href="classQxtNullable.html">QxtNullable</a>.
|
||||
<a href="#_details">More...</a>
|
||||
<p>
|
||||
<code>#include <QxtNull></code>
|
||||
<p>
|
||||
<table border="0" cellpadding="0" cellspacing="0">
|
||||
<tr><td></td></tr>
|
||||
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
|
||||
|
|
1
deploy/include/gui/QxtLabel
Normal file
1
deploy/include/gui/QxtLabel
Normal file
|
@ -0,0 +1 @@
|
|||
#include "QxtLabel.h"
|
86
designer/QxtLabelPlugin.cpp
Normal file
86
designer/QxtLabelPlugin.cpp
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*******************************************************************
|
||||
Qt extended Library
|
||||
Copyright (C) 2007 J-P Nurmi <jpnurmi@gmail.com>
|
||||
released under the Terms of LGPL (see the LICENSE file)
|
||||
*******************************************************************/
|
||||
|
||||
#include "QxtLabel.h"
|
||||
#include "QxtLabelPlugin.h"
|
||||
#include <QtPlugin>
|
||||
|
||||
QxtLabelPlugin::QxtLabelPlugin(QObject* parent)
|
||||
: QObject(parent), initialized(false)
|
||||
{
|
||||
}
|
||||
|
||||
void QxtLabelPlugin::initialize(QDesignerFormEditorInterface* core)
|
||||
{
|
||||
Q_UNUSED(core);
|
||||
if (initialized)
|
||||
return;
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
bool QxtLabelPlugin::isInitialized() const
|
||||
{
|
||||
return initialized;
|
||||
}
|
||||
|
||||
QWidget* QxtLabelPlugin::createWidget(QWidget* parent)
|
||||
{
|
||||
return new QxtLabel(parent);
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::name() const
|
||||
{
|
||||
return "QxtLabel";
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::group() const
|
||||
{
|
||||
return "Display Widgets [Qxt]";
|
||||
}
|
||||
|
||||
QIcon QxtLabelPlugin::icon() const
|
||||
{
|
||||
return QIcon();
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::toolTip() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::whatsThis() const
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
bool QxtLabelPlugin::isContainer() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::domXml() const
|
||||
{
|
||||
return "<widget class=\"QxtLabel\" name=\"qxtLabel\">\n"
|
||||
" <property name=\"geometry\">\n"
|
||||
" <rect>\n"
|
||||
" <x>0</x>\n"
|
||||
" <y>0</y>\n"
|
||||
" <width>57</width>\n"
|
||||
" <height>17</height>\n"
|
||||
" </rect>\n"
|
||||
" </property>\n"
|
||||
" <property name=\"text\" >\n"
|
||||
" <string>QxtLabel</string>\n"
|
||||
" </property>\n"
|
||||
"</widget>\n";
|
||||
}
|
||||
|
||||
QString QxtLabelPlugin::includeFile() const
|
||||
{
|
||||
return "QxtLabel";
|
||||
}
|
||||
|
||||
Q_EXPORT_PLUGIN2(qxtlabelplugin, QxtLabelPlugin)
|
39
designer/QxtLabelPlugin.h
Normal file
39
designer/QxtLabelPlugin.h
Normal file
|
@ -0,0 +1,39 @@
|
|||
/*******************************************************************
|
||||
Qt extended Library
|
||||
Copyright (C) 2007 J-P Nurmi <jpnurmi@gmail.com>
|
||||
released under the Terms of LGPL (see the LICENSE file)
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef QXTLABELPLUGIN_H
|
||||
#define QXTLABELPLUGIN_H
|
||||
|
||||
#include <QDesignerCustomWidgetInterface>
|
||||
|
||||
|
||||
|
||||
|
||||
class QxtLabelPlugin : public QObject, public QDesignerCustomWidgetInterface
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(QDesignerCustomWidgetInterface)
|
||||
|
||||
public:
|
||||
QxtLabelPlugin(QObject* parent = 0);
|
||||
|
||||
bool isContainer() const;
|
||||
bool isInitialized() const;
|
||||
QIcon icon() const;
|
||||
QString domXml() const;
|
||||
QString group() const;
|
||||
QString includeFile() const;
|
||||
QString name() const;
|
||||
QString toolTip() const;
|
||||
QString whatsThis() const;
|
||||
QWidget *createWidget(QWidget *parent);
|
||||
void initialize(QDesignerFormEditorInterface *core);
|
||||
|
||||
private:
|
||||
bool initialized;
|
||||
};
|
||||
|
||||
#endif // QXTLABELPLUGIN_H
|
15
designer/designer.pro
Normal file
15
designer/designer.pro
Normal file
|
@ -0,0 +1,15 @@
|
|||
TEMPLATE = lib
|
||||
DESTDIR= .
|
||||
TARGET = QxtDesignerPlugins
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += ../src ../src/gui ../deploy/include
|
||||
CONFIG += designer plugin debug_and_releas
|
||||
|
||||
HEADERS += QxtLabelPlugin.h ../src/gui/QxtLabel.h
|
||||
SOURCES += QxtLabelPlugin.cpp ../src/gui/QxtLabel.cpp
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
CONFIG += build_all
|
|
@ -459,7 +459,7 @@ WARN_LOGFILE =
|
|||
# directories like "/usr/src/myproject". Separate the files or directories
|
||||
# with spaces.
|
||||
|
||||
INPUT = src include
|
||||
INPUT = src deploy/include
|
||||
|
||||
# If the value of the INPUT tag contains directories, you can use the
|
||||
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
|
||||
|
|
|
@ -94,6 +94,12 @@ contains( QXT, gui ){
|
|||
gui.files += deploy/include/gui/*
|
||||
gui.path = $${include.path}/gui
|
||||
INSTALLS += gui
|
||||
|
||||
|
||||
SUBDIRS += designer
|
||||
designer.path = $$[QT_INSTALL_PLUGINS]/designer
|
||||
designer.files = designer/libQxtDesignerPlugins.*
|
||||
INSTALLS += designer
|
||||
}
|
||||
|
||||
contains( QXT, network ){
|
||||
|
|
270
src/gui/QxtLabel.cpp
Normal file
270
src/gui/QxtLabel.cpp
Normal file
|
@ -0,0 +1,270 @@
|
|||
/*******************************************************************
|
||||
Qt extended Library
|
||||
Copyright (C) 2007 J-P Nurmi <jpnurmi@gmail.com>
|
||||
released under the Terms of LGPL (see the LICENSE file)
|
||||
*******************************************************************/
|
||||
|
||||
#include "QxtLabel.h"
|
||||
#include <QEvent>
|
||||
#include <QPainter>
|
||||
#include <QFontMetrics>
|
||||
|
||||
class QxtLabelPrivate : public QxtPrivate<QxtLabel>
|
||||
{
|
||||
public:
|
||||
QXT_DECLARE_PUBLIC(QxtLabel);
|
||||
|
||||
void init(const QString& txt = QString());
|
||||
void updateLabel();
|
||||
|
||||
QString text;
|
||||
Qt::Alignment align;
|
||||
Qt::TextElideMode mode;
|
||||
QxtLabel::Rotation rot;
|
||||
};
|
||||
|
||||
void QxtLabelPrivate::init(const QString& txt)
|
||||
{
|
||||
text = txt;
|
||||
align = Qt::AlignLeft | Qt::AlignTop;
|
||||
mode = Qt::ElideMiddle;
|
||||
rot = QxtLabel::NoRotation;
|
||||
}
|
||||
|
||||
void QxtLabelPrivate::updateLabel()
|
||||
{
|
||||
qxt_p().updateGeometry();
|
||||
qxt_p().update();
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QxtLabel QxtLabel
|
||||
\ingroup gui
|
||||
\brief A simple label which is able to show elided and rotated text.
|
||||
|
||||
QxtLabel is a simple label widget able to show elided and rotated plain text.
|
||||
*/
|
||||
|
||||
/*!
|
||||
\enum QxtLabel::Rotation
|
||||
|
||||
This enum describes the rotation of the text.
|
||||
|
||||
\value NoRotation No rotation.
|
||||
\value UpsideDown Upside down (180 degrees).
|
||||
\value Clockwise Clockwise (90 degrees).
|
||||
\value CounterClockwise CounterClockwise (-90 degrees).
|
||||
*/
|
||||
|
||||
/*!
|
||||
Constructs a new QxtLabel with \a parent and \a flags.
|
||||
*/
|
||||
QxtLabel::QxtLabel(QWidget* parent, Qt::WindowFlags flags) : QWidget(parent, flags)
|
||||
{
|
||||
QXT_INIT_PRIVATE(QxtLabel);
|
||||
qxt_d().init();
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs a new QxtLabel with \a text, \a parent and \a flags.
|
||||
*/
|
||||
QxtLabel::QxtLabel(const QString& text, QWidget* parent, Qt::WindowFlags flags) : QWidget(parent, flags)
|
||||
{
|
||||
QXT_INIT_PRIVATE(QxtLabel);
|
||||
qxt_d().init(text);
|
||||
}
|
||||
|
||||
/*!
|
||||
Destructs the label.
|
||||
*/
|
||||
QxtLabel::~QxtLabel()
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the text.
|
||||
|
||||
\sa setText()
|
||||
*/
|
||||
QString QxtLabel::text() const
|
||||
{
|
||||
return qxt_d().text;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the text to \a text.
|
||||
|
||||
\sa text()
|
||||
*/
|
||||
void QxtLabel::setText(const QString& text)
|
||||
{
|
||||
qxt_d().text = text;
|
||||
qxt_d().updateLabel();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the alignment.
|
||||
|
||||
The default value of this property is Qt::AlignLeft | Qt::AlignTop.
|
||||
|
||||
\sa setAlignment()
|
||||
*/
|
||||
Qt::Alignment QxtLabel::alignment() const
|
||||
{
|
||||
return qxt_d().align;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the alignment to \a alignment.
|
||||
|
||||
\sa alignment()
|
||||
*/
|
||||
void QxtLabel::setAlignment(Qt::Alignment alignment)
|
||||
{
|
||||
qxt_d().align = alignment;
|
||||
update(); // no geometry change, repaint is sufficient
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the text elide mode.
|
||||
|
||||
The default value of this property is Qt::ElideMiddle.
|
||||
|
||||
\sa setElideMode()
|
||||
*/
|
||||
Qt::TextElideMode QxtLabel::elideMode() const
|
||||
{
|
||||
return qxt_d().mode;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the text elide mode to \a mode.
|
||||
|
||||
\sa elideMode()
|
||||
*/
|
||||
void QxtLabel::setElideMode(Qt::TextElideMode mode)
|
||||
{
|
||||
qxt_d().mode = mode;
|
||||
qxt_d().updateLabel();
|
||||
}
|
||||
|
||||
/*!
|
||||
Returns the rotation.
|
||||
|
||||
The default value of this property is QxtLabel::NoRotation.
|
||||
|
||||
\sa setRotation() QxtLabel::Rotation
|
||||
*/
|
||||
QxtLabel::Rotation QxtLabel::rotation() const
|
||||
{
|
||||
return qxt_d().rot;
|
||||
}
|
||||
|
||||
/*!
|
||||
Sets the rotation to \a rotation.
|
||||
|
||||
\sa rotation()
|
||||
*/
|
||||
void QxtLabel::setRotation(Rotation rotation)
|
||||
{
|
||||
Rotation prev = qxt_d().rot;
|
||||
qxt_d().rot = rotation;
|
||||
switch (rotation)
|
||||
{
|
||||
case NoRotation:
|
||||
case UpsideDown:
|
||||
if (prev == Clockwise || prev == CounterClockwise)
|
||||
{
|
||||
updateGeometry();
|
||||
}
|
||||
break;
|
||||
case Clockwise:
|
||||
case CounterClockwise:
|
||||
if (prev == NoRotation || prev == UpsideDown)
|
||||
{
|
||||
updateGeometry();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
// nothing to do
|
||||
break;
|
||||
}
|
||||
update();
|
||||
}
|
||||
|
||||
QSize QxtLabel::sizeHint() const
|
||||
{
|
||||
const QFontMetrics& fm = fontMetrics();
|
||||
QSize size(fm.width(qxt_d().text), fm.height());
|
||||
if (qxt_d().rot == Clockwise || qxt_d().rot == CounterClockwise)
|
||||
size.transpose();
|
||||
return size;
|
||||
}
|
||||
|
||||
QSize QxtLabel::minimumSizeHint() const
|
||||
{
|
||||
switch (qxt_d().mode)
|
||||
{
|
||||
case Qt::ElideNone:
|
||||
return sizeHint();
|
||||
default:
|
||||
{
|
||||
const QFontMetrics& fm = fontMetrics();
|
||||
QSize size(fm.width("..."), fm.height());
|
||||
if (qxt_d().rot == Clockwise || qxt_d().rot == CounterClockwise)
|
||||
size.transpose();
|
||||
return size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void QxtLabel::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
QPainter p(this);
|
||||
p.rotate(qxt_d().rot);
|
||||
QRect r = contentsRect();
|
||||
switch (qxt_d().rot)
|
||||
{
|
||||
case UpsideDown:
|
||||
p.translate(-r.width(), -r.height());
|
||||
break;
|
||||
|
||||
case Clockwise:
|
||||
p.translate(0, -r.width());
|
||||
break;
|
||||
|
||||
case CounterClockwise:
|
||||
p.translate(-r.height(), 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
// nothing to do
|
||||
break;
|
||||
}
|
||||
|
||||
if (qxt_d().rot == Clockwise || qxt_d().rot == CounterClockwise)
|
||||
{
|
||||
QSize s = r.size();
|
||||
s.transpose();
|
||||
r = QRect(r.topLeft(), s);
|
||||
}
|
||||
|
||||
const QFontMetrics& fm = fontMetrics();
|
||||
p.drawText(r, qxt_d().align, fm.elidedText(qxt_d().text, qxt_d().mode, r.width()));
|
||||
}
|
||||
|
||||
void QxtLabel::changeEvent(QEvent* event)
|
||||
{
|
||||
QWidget::changeEvent(event);
|
||||
switch (event->type())
|
||||
{
|
||||
case QEvent::FontChange:
|
||||
case QEvent::ApplicationFontChange:
|
||||
qxt_d().updateLabel();
|
||||
break;
|
||||
default:
|
||||
// nothing to do
|
||||
break;
|
||||
}
|
||||
}
|
59
src/gui/QxtLabel.h
Normal file
59
src/gui/QxtLabel.h
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*******************************************************************
|
||||
Qt extended Library
|
||||
Copyright (C) 2007 J-P Nurmi <jpnurmi@gmail.com>
|
||||
released under the Terms of LGPL (see the LICENSE file)
|
||||
*******************************************************************/
|
||||
|
||||
#ifndef QXTLABEL_H
|
||||
#define QXTLABEL_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QxtDefines.h>
|
||||
#include <core/QxtPimpl.h>
|
||||
|
||||
class QxtLabelPrivate;
|
||||
|
||||
class QXT_DLLEXPORT QxtLabel : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
QXT_DECLARE_PRIVATE(QxtLabel);
|
||||
Q_PROPERTY(QString text READ text WRITE setText)
|
||||
Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment)
|
||||
Q_PROPERTY(Qt::TextElideMode elideMode READ elideMode WRITE setElideMode)
|
||||
Q_PROPERTY(Rotation rotation READ rotation WRITE setRotation)
|
||||
Q_ENUMS(Rotation)
|
||||
|
||||
public:
|
||||
enum Rotation
|
||||
{
|
||||
NoRotation = 0,
|
||||
UpsideDown = 180,
|
||||
Clockwise = 90,
|
||||
CounterClockwise = 270
|
||||
};
|
||||
|
||||
explicit QxtLabel(QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
||||
QxtLabel(const QString& text, QWidget* parent = 0, Qt::WindowFlags flags = 0);
|
||||
~QxtLabel();
|
||||
|
||||
QString text() const;
|
||||
void setText(const QString& text);
|
||||
|
||||
Qt::Alignment alignment() const;
|
||||
void setAlignment(Qt::Alignment alignment);
|
||||
|
||||
Qt::TextElideMode elideMode() const;
|
||||
void setElideMode(Qt::TextElideMode mode);
|
||||
|
||||
Rotation rotation() const;
|
||||
void setRotation(Rotation rotation);
|
||||
|
||||
QSize sizeHint() const;
|
||||
QSize minimumSizeHint() const;
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent* event);
|
||||
void paintEvent(QPaintEvent* event);
|
||||
};
|
||||
|
||||
#endif // QXTELIDELABEL_H
|
|
@ -15,6 +15,11 @@ QXT_HEADERS_QxtTreeWidget = QxtTreeWidget.h
|
|||
QXT_SOURCES_QxtTreeWidget = QxtTreeWidget.cpp
|
||||
QXT_STABILITY_QxtTreeWidget = +linux-g++
|
||||
|
||||
QXT_GUI += QxtLabel
|
||||
QXT_HEADERS_QxtLabel = QxtLabel.h
|
||||
QXT_SOURCES_QxtLabel = QxtLabel.cpp
|
||||
QXT_STABILITY_QxtLabel = +linux-g++
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user