<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8716145306968537510</id><updated>2012-02-16T13:12:46.113-08:00</updated><category term='qxt'/><title type='text'>zbenjamin's blog</title><subtitle type='html'>blog about qt and qxt related stuff</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://zbenjamin.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://zbenjamin.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>zbenjamin</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8716145306968537510.post-497759639646107326</id><published>2008-01-22T00:40:00.000-08:00</published><updated>2008-01-22T01:25:04.777-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qxt'/><title type='text'>qxt po module</title><content type='html'>Hi there,&lt;br /&gt;&lt;br /&gt;i know it has been a long time since i wrote my last blog. Sorry for that.&lt;br /&gt;But now i'm back and want to introduce a new module that is currently&lt;br /&gt;more in planning than in an implemented state, but it slowly evolves.&lt;br /&gt;Me and Mark started to work on a module called the PO module. PO means Persistent Objects.&lt;br /&gt;Now some of you will get excited because it seems object persistence is a feature that is really&lt;br /&gt;needed out there. We still need to figure out some basic stuff but i want to show you the current state.&lt;br /&gt;&lt;br /&gt;So what does it take to make your objects persistent? Here is the good part: Not much.&lt;br /&gt;The PO module uses the Qt property system to load and save your object dynamically.&lt;br /&gt;So your Objects only need to be derivered from QObject and add a small Macro:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-style: italic;"&gt;QXT_DECLARE_PERSISTENT(YourObject);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Every Q_PROPERTY in your Object that sets STORED to true is pushed into the Database.&lt;br /&gt;To register a Object with a database you have to create a QxtPOManager:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-style: italic;"&gt;QxtPOManager manager;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-style: italic;"&gt;manager.registerPOType &amp;lt; YourFirstObject &amp;gt; ();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-style: italic;"&gt;manager.registerPOType &amp;lt; YourSecondObject &amp;gt; ();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0); font-style: italic;"&gt;manager.registerPOType &amp;lt; YourThirdObject &amp;gt; ();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Thats everything. After you did that work your classes are fully useable with the PO module.&lt;br /&gt;The manager will handle load/save/deletetion of your objects.&lt;br /&gt;Well there is still a lot of work to do so don't expect something in the next time. I guess before libqxt 0.3.3 or .0.3.4 there will be nothing useable. But we are working on it and will provide a tarball when there is something to test.&lt;br /&gt;If someone is interested or has expirience with creating peristence frameworks and wants to contribute, post a comment to this blog, write me a mail or join the #qxt channel on irc freenode and just ask.&lt;br /&gt;&lt;br /&gt;zbenjamin&lt;br /&gt;"your friendly developer from the neighbourhood"&lt;br /&gt;&lt;br /&gt;p.s. the ScheduleView is still in work, but we are currently testing if there is a better way to&lt;br /&gt;implement it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8716145306968537510-497759639646107326?l=zbenjamin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zbenjamin.blogspot.com/feeds/497759639646107326/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8716145306968537510&amp;postID=497759639646107326' title='8 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/497759639646107326'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/497759639646107326'/><link rel='alternate' type='text/html' href='http://zbenjamin.blogspot.com/2008/01/qxt-po-module.html' title='qxt po module'/><author><name>zbenjamin</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8716145306968537510.post-4718962175981838274</id><published>2007-08-27T07:00:00.000-07:00</published><updated>2007-08-27T13:45:37.768-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qxt'/><title type='text'>About locks and validations</title><content type='html'>&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;Hi there,&lt;br /&gt;&lt;br /&gt;last time i added two new classes to Qxt:&lt;br /&gt;&lt;/span&gt;&lt;ul style="color: rgb(0, 0, 0);"&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;QxtStringValidator&lt;br /&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:85%;"&gt;QxtFileLock.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(0, 0, 0);font-size:85%;" &gt;&lt;br /&gt;QxtStringValidator was initialliy a class to validate over a QStringList, but this was not really worth to put it into Qxt. So i decided to make it more powerfull. Now it provides a String based validation over a QAbstractItemModel. :&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;QxtStringValidator validator = new QxtStringValidator();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;validator-&gt;setLookupModel(myCoolCustomModel);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;/*now we have to choose the right column&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;    this will lookup in column 3, starting from row 0&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;*/&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;validator-&gt;setStartModelIndex(myCoolCustomModel-&gt;index(0,3));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;//case insensitive lookup&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;validator-&gt;setCaseSensitivity(Qt::CaseInsensitive);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;//and now set the validator to a lineEdit&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;lineEdit-&gt;setValidator(validator);&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;br /&gt;There are some other features like :&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;wrapping lookup&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;case sensitive/insensitive lookup&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;recursive lookups&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;looking up different model rows&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;And it is also possible to use a QStringList as data source (never forget your roots ;) ).&lt;br /&gt;&lt;br /&gt;QxtFileLock is something i had in my mind for a long time since i thought about writing a isam filemanager based on QT. The first thing i realized was that there is no file lock available in Qt. Well it is possible but not using a nice crossplattform class like Qt offers them. So here is my solution for that:&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;void doSomeOpOnFile()&lt;br /&gt;{&lt;br /&gt;off_t lockStart = 0x10;&lt;br /&gt;off_t lockLength = 20;&lt;br /&gt;QxtFileLock readLock(&amp;file,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;lockStart,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;lockLength&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;,QxtFileLock::ReadLock);&lt;br /&gt;if(readLock.lock())&lt;br /&gt;{&lt;br /&gt;  /*do some read operations*/&lt;br /&gt;  /*the lock gets cleaned up after it is deleted  it is not needed to call unlock()*/&lt;br /&gt;  QxtFileLock writeLock (&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&amp;file,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-size:85%;" &gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;lockStart,&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;lockLength&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;,QxtFileLock::WriteLock);&lt;br /&gt;  if(writeLock.lock())&lt;br /&gt;  {&lt;br /&gt;      /*do some write operations*/&lt;br /&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;    }&lt;br /&gt;/*in this case we don't have to care about releasing the lock. QxtFileLock will do it when the instance is destroyed*/&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="color: rgb(51, 204, 0);font-size:85%;" &gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;span style="color: rgb(51, 51, 51);"&gt;I had to do some extra work on *nix based systems. On *nix a lock does not behave like a normal unix lock. In fact on *nix locks are process wide, means a process can get a lock on a file as often as it wants to. With QxtFileLock this is not possible, locks are threads and handles bound. That means: A Thread can writelock the same region of a file twice only if it uses the SAME handle. If a different handle holds the lock a call to lock() will fail.&lt;br /&gt;On *nix we use fcntl and on windows LockFileEx to implement the locking stuff.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;Attention: don't mix QxtFileLock and lockf or flock on linux they are NOT compatible.&lt;br /&gt;                        Also use only fcntl to lock the files in other apps.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;Well i hope these two classes can go into the 0.2.4 release.&lt;br /&gt;Due to vacation and other things i had to do the QxtScheduleView did not make it into the trunk.&lt;br /&gt;&lt;br /&gt;zbenjamin&lt;br /&gt;"your friendly developer from the neighbourhood"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:85%;" &gt;&lt;span style="color: rgb(51, 204, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8716145306968537510-4718962175981838274?l=zbenjamin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zbenjamin.blogspot.com/feeds/4718962175981838274/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8716145306968537510&amp;postID=4718962175981838274' title='1 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/4718962175981838274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/4718962175981838274'/><link rel='alternate' type='text/html' href='http://zbenjamin.blogspot.com/2007/08/about-locks-and-validations.html' title='About locks and validations'/><author><name>zbenjamin</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8716145306968537510.post-2029266659866533941</id><published>2007-07-23T15:00:00.000-07:00</published><updated>2007-08-27T08:02:46.384-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='qxt'/><title type='text'>The raise of QxtScheduleView</title><content type='html'>&lt;a class="xleft" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp3.blogger.com/_KXPtGsBIsS4/RqSn-NEt54I/AAAAAAAAAAM/dkmSLFqj3iI/s1600-h/QMac_1.PNG"&gt;&lt;img style="margin: 5px; float: left;" src="http://bp3.blogger.com/_KXPtGsBIsS4/RqSn-NEt54I/AAAAAAAAAAM/dkmSLFqj3iI/s320/QMac_1.PNG" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;After long time of developing (well the real work did not took so long, but there were so much other things to do) i have some working QxtScheduleView class.&lt;br /&gt;I already used it in one of my other apps and it worked nice ;).&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: left;"&gt;Its a plannig app for modelplane shows.The Item Color indicates collisions of the plane's rc - quartz. So yellow indicates it may work, and red ... well i think you know the answer.&lt;br /&gt;&lt;br /&gt;Now after i got this stuff working i have to &lt;span style="font-weight: bold;"&gt;refactor &lt;/span&gt;the class and that will take some time.&lt;br /&gt;&lt;/div&gt;&lt;p&gt;I'm not shure if i can put QxtScheduleView in the next release of libqxt.&lt;br /&gt;But it will go into trunk in the next weeks. It also lacks all kind of docs so noone will know how to use it.&lt;br /&gt;After i have QxtScheduleView finished for trunk i will start hacking the QxtScheduleWidget . It will have a internal Model and QxtScheduleWidgetItem that will make your life easier.&lt;br /&gt;&lt;br /&gt;Well if someone wants to have a look at the current state,&lt;br /&gt;the source can be checked out of my repository:&lt;br /&gt;&lt;br /&gt;&lt;a href="https://libqxt.svn.sourceforge.net/svnroot/libqxt/sandbox/zbenjamin/QxtScheduleView/"&gt;zbenjamin's sandbox&lt;/a&gt;&lt;br /&gt;(https://libqxt.svn.sourceforge.net/svnroot/libqxt/sandbox/zbenjamin/QxtScheduleView/)&lt;br /&gt;&lt;br /&gt;cya zbenjamin&lt;br /&gt;"your friendly developer from the neighbourhood"&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8716145306968537510-2029266659866533941?l=zbenjamin.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://zbenjamin.blogspot.com/feeds/2029266659866533941/comments/default' title='Kommentare zum Post'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8716145306968537510&amp;postID=2029266659866533941' title='2 Kommentare'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/2029266659866533941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8716145306968537510/posts/default/2029266659866533941'/><link rel='alternate' type='text/html' href='http://zbenjamin.blogspot.com/2007/07/raise-of-qxtscheduleview.html' title='The raise of QxtScheduleView'/><author><name>zbenjamin</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp3.blogger.com/_KXPtGsBIsS4/RqSn-NEt54I/AAAAAAAAAAM/dkmSLFqj3iI/s72-c/QMac_1.PNG' height='72' width='72'/><thr:total>2</thr:total></entry></feed>
